mcp-server-tree-sitter
by wrale·★ 303·Score 50
MCP server providing code analysis capabilities using Tree-sitter for multiple programming languages.
Overview
The MCP Tree-sitter Server offers comprehensive code analysis capabilities through Tree-sitter parsers, enabling AI assistants to intelligently explore and understand codebases. It provides flexible exploration at multiple levels of granularity with efficient context management, preventing overwhelming context windows. The server supports numerous programming languages including Python, JavaScript, TypeScript, Go, Rust, C/C++, and more, making it highly versatile for different development environments.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this server when you need deep code analysis capabilities with AST parsing and want to maintain context management for large codebases across multiple programming languages.
When NOT to choose this
Don't choose this if you need write access to codebases (this is read-only only) or if you're working with very specialized domain-specific languages not supported by Tree-sitter.
Tools this server exposes
12 tools extracted from the READMEregister_project_toolregister_project_tool(path, name)Register a project for code analysis
list_fileslist_files(project, pattern)List files in a project matching a pattern
get_fileget_file(project, path)Get content of a specific file in a project
get_astget_ast(project, path, max_depth)Get the abstract syntax tree for a file
get_symbolsget_symbols(project, path)Extract code symbols like functions and classes
find_textfind_text(project, pattern, file_pattern)Search for text patterns in files
run_queryrun_query(project, query, language)Run a tree-sitter query on code
analyze_complexityanalyze_complexity(project, path)Analyze code complexity metrics
list_projects_toollist_projects_tool()List all registered projects
find_similar_codefind_similar_code(project, path)Find similar code patterns in a project
analyze_projectanalyze_project(project)Perform comprehensive project analysis
get_dependenciesget_dependencies(project, path)Extract and analyze code dependencies
Comparable tools
Installation
Installation
Basic Installation
pip install mcp-server-tree-sitterClaude Desktop Configuration
Using MCP CLI:
mcp install mcp_server_tree_sitter.server:mcp --name "tree_sitter"Manual Configuration:
{
"mcpServers": {
"tree_sitter": {
"command": "python",
"args": [
"-m",
"mcp_server_tree_sitter.server"
]
}
}
}FAQ
- Which programming languages are supported?
- The server supports many languages including Python, JavaScript, TypeScript, Go, Rust, C, C++, C#, Swift, Java, Kotlin, Dart, Julia, and APL via tree-sitter-language-pack.
- How do I register a project for analysis?
- Use the `register_project_tool(path="/path/to/your/project", name="my-project")` command to register a project that the server can analyze.
On Hacker News
Recent discussion from the developer community.
- Story by jmdots · 2025-04-08
Compare mcp-server-tree-sitter with
Last updated · Auto-generated from public README + GitHub signals.