Expand description
Rust MCP server for code structure analysis using tree-sitter.
This crate exposes four MCP tools for multiple programming languages:
- analyze_directory: Directory tree with file counts and structure
- analyze_file: Semantic extraction (functions, classes, assignments, references)
- analyze_symbol: Call graph analysis (callers and callees)
- analyze_module: Lightweight function and import index
Key types:
analyze::analyze_directory: Analyze entire directory treeanalyze::analyze_file: Analyze single fileparser::ElementExtractor: Parse language-specific elements
Languages supported: Rust, Go, Java, Python, TypeScript, TSX, Fortran.
Modules§
- analyze
- Main analysis engine for extracting code structure from files and directories.
- cache
- LRU cache for analysis results indexed by path, modification time, and mode.
- completion
- Path completion support for file and directory paths.
- formatter
- Output formatting for analysis results across different modes.
- graph
- Call graph construction and analysis.
- lang
- Language detection by file extension.
- languages
- Language-specific handlers and query definitions for tree-sitter parsing.
- logging
- MCP logging integration via tracing.
- metrics
- Metrics collection and daily-rotating JSONL emission.
- pagination
- Cursor-based pagination for large result sets.
- parser
- Tree-sitter-based parser for extracting semantic structure from source code.
- test_
detection - Test file detection using path heuristics.
- traversal
- Directory traversal with .gitignore support.
- types
Structs§
- Code
Analyzer - MCP server handler that wires the four analysis tools to the rmcp transport.
Functions§
- summary_
cursor_ conflict - Returns
truewhensummary=trueand acursorare both provided, which is an invalid combination since summary mode and pagination are mutually exclusive.