A Model Context Protocol (MCP) server that provides code analysis capabilities using tree-sitter, designed to give AI assistants intelligent access to codebases with appropriate context management. Claude Desktop is the reference implementation target.
- ๐ Flexible Exploration: Examine code at multiple levels of granularity
- ๐ง Context Management: Provides just enough information without overwhelming the context window
- ๐ Language Agnostic: Supports many programming languages including Python, JavaScript, TypeScript, Go, Rust, C, C++, C#, Swift, Java, Kotlin, Dart, Julia, and APL via tree-sitter-language-pack
- ๐ณ Structure-Aware: Uses AST-based understanding with efficient cursor-based traversal
- ๐ Searchable: Find specific patterns using text search and tree-sitter queries
- ๐ Caching: Optimized performance through parse tree caching
- ๐ Symbol Extraction: Extract and analyze functions, classes, and other code symbols
- ๐ Dependency Analysis: Identify and analyze code dependencies and relationships
- ๐งฉ State Persistence: Maintains project registrations and cached data between invocations
- ๐ Secure: Built-in security boundaries and input validation
For a comprehensive list of all available commands, their current implementation status, and detailed feature matrix, please refer to the
- Python 3.10+
- Tree-sitter language parsers for your preferred languages
pip install mcp-server-tree-sittergit clone https://github.com/wrale/mcp-server-tree-sitter.git
cd mcp-server-tree-sitter
pip install -e ".[dev]"