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
// 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.
/// 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.
/// 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.
/// MCP server implementation.
/// SSE streaming support for indexing progress.
pub use ;
pub use ;
/// MCP server version
pub const VERSION: &str = env!;