Codetree
MCP server with 23 tools for structured code understanding via tree-sitter. 10 languages. 999 tests. One-command install.
What is Codetree?
Codetree is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server with 23 tools for structured code understanding via tree-sitter. 10 languages. 999 tests. one-command install.
MCP server with 23 tools for structured code understanding via tree-sitter. 10 languages. 999 tests. One-command install.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server with 23 tools for structured code understanding v
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx codetreeConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codetree
Codetree is an MCP server that gives AI coding assistants deep structural understanding of codebases through 23 tree-sitter-powered tools, supporting 10 programming languages including Python, TypeScript, JavaScript, Rust, Go, and Java. Instead of consuming thousands of tokens reading raw source files, AI agents use Codetree to extract function skeletons, call graphs, blast radii, dead code, clone detection, dataflow analysis, and repository maps — achieving up to 25x token reduction. It ships with 999 tests and installs in a single command.
Prerequisites
- Python 3.10+ installed on your system
- uv package manager (recommended) or pip
- An MCP-compatible client such as Claude Desktop, Cursor, or GitHub Copilot
- A code repository to analyze (passed via the --root flag)
Add the Codetree server to Claude via the CLI (recommended)
The fastest installation is via the 'claude mcp add' command, which registers the server and its --root argument pointing to your project directory.
claude mcp add codetree -- uvx --from mcp-server-codetree codetree --root .Alternatively, configure manually in claude_desktop_config.json
For Claude Desktop or other clients without a CLI, add the server configuration manually. Set the --root value to the absolute path of the project you want to analyze.
{
"mcpServers": {
"codetree": {
"command": "uvx",
"args": ["--from", "mcp-server-codetree", "codetree", "--root", "/path/to/your/project"]
}
}
}Verify the server is running and tools are registered
Restart your MCP client. Ask Claude to call get_repository_map — it should return a structural overview of the project. If successful, all 23 tools are available.
Start using structural analysis instead of raw file reads
Replace 'read this file' requests with targeted Codetree queries. Use get_file_skeleton to see all classes and functions at a glance, then get_symbol to fetch only the specific implementation you need.
Codetree Examples
Client configuration
Claude Desktop configuration using uvx to run the mcp-server-codetree package against a local project directory.
{
"mcpServers": {
"codetree": {
"command": "uvx",
"args": [
"--from",
"mcp-server-codetree",
"codetree",
"--root",
"/Users/me/projects/my-app"
]
}
}
}Prompts to try
Structural code queries using Codetree's 23 tools for navigation, quality analysis, refactoring impact, and test discovery.
- "Get the skeleton of src/auth/service.py — show all classes and functions with line numbers"
- "Show me the full source of the 'divide' function in calculator.py"
- "Find all references to the 'UserRepository' class across the codebase"
- "What is the blast radius if I change the 'processPayment' function?"
- "Detect any dead code — functions defined but never called"
- "Generate a call graph for the checkout workflow starting from 'placeOrder'"
- "Find all tests related to the 'AuthService' module"Troubleshooting Codetree
uvx --from mcp-server-codetree fails with package not found
Ensure uv is installed: 'pip install uv' or follow instructions at https://astral.sh/uv. The PyPI package name is 'mcp-server-codetree' (with hyphens). Run 'uvx --from mcp-server-codetree codetree --help' directly in the terminal to confirm the package resolves before adding it to your MCP config.
get_file_skeleton returns an empty result or language not recognized
Codetree supports 10 languages via tree-sitter. Check that your file extension is one of the supported types (Python, TypeScript, JavaScript, Rust, Go, Java, C, C++, Ruby, or PHP). Files with non-standard extensions may not be parsed — rename or specify the language explicitly in the tool call.
Tools work but are very slow on a large monorepo
Point --root at a specific subdirectory rather than the repository root to reduce the analysis scope. For example, '--root /project/src/backend' instead of '--root /project'. This dramatically reduces tree-sitter parsing time for large codebases.
Frequently Asked Questions about Codetree
What is Codetree?
Codetree is a Model Context Protocol (MCP) server that mcp server with 23 tools for structured code understanding via tree-sitter. 10 languages. 999 tests. one-command install. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codetree?
Follow the installation instructions on the Codetree GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Codetree?
Codetree works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codetree free to use?
Yes, Codetree is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Codetree Alternatives — Similar Developer Tools Servers
Looking for alternatives to Codetree? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Codetree in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Codetree?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.