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
//! MCP (Model Context Protocol) server implementation for ctx.
//!
//! This module exposes ctx's code intelligence capabilities via the MCP protocol,
//! allowing AI assistants like Claude to query codebases through standardized tools.
//!
//! # Available Tools
//!
//! - `search_symbols`: Search for symbols by name pattern
//! - `get_definition`: Get the source code for a symbol
//! - `find_references`: Find all references to a symbol
//! - `get_callers`: Get functions that call a given function
//! - `get_callees`: Get functions called by a given function
//! - `get_file`: Read a file's contents
//! - `get_file_tree`: List files in the project
//! - `smart_context`: Intelligently select files for a task
//!
//! # Usage
//!
//! Start the MCP server with:
//! ```bash
//! ctx serve --mcp
//! ```
//!
//! Configure Claude Desktop by adding to `claude_desktop_config.json`:
//! ```json
//! {
//! "mcpServers": {
//! "ctx": {
//! "command": "ctx",
//! "args": ["serve", "--mcp"],
//! "cwd": "/path/to/your/project"
//! }
//! }
//! }
//! ```
pub use ;