1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! MCP (Model Context Protocol) Server for Jarvy
//!
//! This module exposes Jarvy as an MCP server, enabling LLMs (Claude, GPT, etc.)
//! to safely discover, verify, and install development tools with mandatory user confirmation.
//!
//! ## Architecture
//!
//! The MCP server uses JSON-RPC 2.0 over stdio transport:
//! - `server.rs` - Main server loop and request routing
//! - `transport.rs` - Stdio transport implementation
//! - `tools.rs` - MCP tool handlers (jarvy_list_tools, jarvy_check_tool, etc.)
//! - `resources.rs` - MCP resource handlers
//! - `prompts.rs` - MCP prompt handlers
//! - `safety.rs` - Rate limiting, allowlist/denylist, confirmation
//! - `config.rs` - MCP-specific configuration
//! - `audit.rs` - Audit logging
//! - `error.rs` - Error types with JSON-RPC error codes
//!
//! ## Safety
//!
//! The MCP server is designed with safety as the primary concern:
//! - `dry_run: true` by default for all installs
//! - Confirmation prompts via stderr (not MCP response)
//! - Rate limiting (10 checks/min, 3 installs/min)
//! - Configurable allowlist/denylist via ~/.jarvy/mcp-config.toml
//! - Audit logging to ~/.jarvy/mcp-audit.log
pub use McpConfig;
pub use ;
pub use McpServer;
/// MCP protocol version supported by this implementation
pub const PROTOCOL_VERSION: &str = "2024-11-05";
/// Server name for MCP identification
pub const SERVER_NAME: &str = "jarvy";
/// Server version (matches Cargo.toml version)
pub const SERVER_VERSION: &str = env!;
/// Run the MCP server with the given configuration