Skip to main content

subcog/mcp/
mod.rs

1//! MCP server implementation.
2//!
3//! Provides Model Context Protocol server for AI agent interoperability.
4//!
5//! ## Features
6//!
7//! - **Tools**: `subcog_capture`, `subcog_recall`, `subcog_status`, `subcog_namespaces`
8//! - **Resources**: Help documentation via `subcog://help/{category}`
9//! - **Prompts**: Tutorial, capture assistant, decision documentation
10//!
11//! ## Usage
12//!
13//! ### Stdio Transport (Claude Desktop)
14//!
15//! ```bash
16//! subcog serve
17//! ```
18//!
19//! ### Claude Desktop Configuration
20//!
21//! ```json
22//! {
23//!   "mcpServers": {
24//!     "subcog": {
25//!       "command": "subcog",
26//!       "args": ["serve"]
27//!     }
28//!   }
29//! }
30//! ```
31
32// Allow unused_self for methods kept for API consistency or future use.
33#![allow(clippy::unused_self)]
34// Allow unnecessary wraps for methods that return Result for API consistency.
35#![allow(clippy::unnecessary_wraps)]
36// Allow ok_or with function calls - the error path is uncommon.
37#![allow(clippy::or_fun_call)]
38// Allow format_push_string - we prefer readability over micro-optimization here.
39#![allow(clippy::format_push_string)]
40// Allow option_if_let_else for clearer match statements.
41#![allow(clippy::option_if_let_else)]
42// Allow match_same_arms for explicit enum handling with default fallback.
43#![allow(clippy::match_same_arms)]
44
45mod auth;
46mod dispatch;
47mod help_content;
48mod prompt_understanding;
49mod prompts;
50mod resources;
51mod server;
52mod session;
53mod tool_types;
54mod tools;
55
56pub use auth::{Claims, JwtAuthenticator, JwtConfig};
57pub use prompts::{PromptArgument, PromptContent, PromptDefinition, PromptMessage, PromptRegistry};
58pub use resources::{HelpCategory, ResourceContent, ResourceDefinition, ResourceHandler};
59pub use server::{McpServer, Transport};
60pub use tools::{ToolContent, ToolDefinition, ToolRegistry, ToolResult};