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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// MCP (Model Context Protocol) JSON-RPC Server
//
// This module provides a pure Rust implementation of the MCP protocol
// for LeIndex, enabling AI assistant integration via JSON-RPC 2.0.
//
// # Example
//
// ```ignore
// use leindex::{LeIndex, mcp::McpServer};
//
// #[tokio::main]
// async fn main() -> anyhow::Result<()> {
// // Create LeIndex instance
// let leindex = LeIndex::new("/path/to/project")?;
//
// // Create and run MCP server
// let config = McpServerConfig::default();
// let server = McpServer::new(config, leindex);
// server.run().await?;
//
// Ok(())
// }
// ```
/// Dispatch macro for `ToolHandler` enum and match-arm generation.
/// Request handlers for MCP tools.
/// Shared helpers for MCP request processing.
/// Beautiful output formatting for LeIndex tools.
/// MCP protocol definitions and JSON-RPC types.
/// Handler for LeIndex [Context] — PDG-based context expansion.
/// Handler for LeIndex [Deep Analyze] — deep code analysis.
/// Handler for LeIndex [Diagnostics] — project diagnostics.
/// Handler for LeIndex [Edit Apply] — atomic code modifications.
/// Disk-persistent cache for edit previews.
/// Handler for LeIndex [Edit Preview] — dry-run code changes.
/// Handler for LeIndex [File Summary] — structured file analysis.
/// Handler for LeIndex [Git Status] — PDG-aware git status.
/// Handler for LeIndex [Grep Symbols] — structurally-aware symbol search.
/// Handler for LeIndex [Impact Analysis] — transitive dependency impact.
/// Handler for LeIndex [Index] — project indexing.
/// Handler for LeIndex [Phase Analysis] — multi-phase analysis.
/// Handler for LeIndex [Project Map] — annotated project tree.
/// Handler for LeIndex [Read File] — PDG-annotated file read.
/// Handler for LeIndex [Read Symbol] — targeted symbol source read.
/// Handler for LeIndex [Rename Symbol] — cross-file symbol rename.
/// Handler for LeIndex [Search] — semantic code search.
/// Handler for LeIndex [Symbol Lookup] — full call graph lookup.
/// Handler for LeIndex [Text Search] — raw text/regex search.
/// Handler for LeIndex [Write] — atomic file creation with PDG surfacing.
/// MCP server implementation.
/// SSE streaming support for indexing progress.
pub use ;
pub use ;
/// MCP server version
pub const VERSION: &str = env!;