MCP server with 23 tools for structured code understanding via tree-sitter. 10 languages. 999 tests. One-command install.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"codetree": {
"args": [
"--from",
"mcp-server-codetree",
"codetree",
"--root",
"${workspaceFolder}"
],
"command": "uvx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
codetree is an MCP server that gives coding agents structured code understanding via tree-sitter — so they ask precise questions instead of reading thousands of lines. 23 tools, 10 languages, ~1 second startup. No vector DB, no embedding model, no config.
This server supports HTTP transport. Be the first to test it — help the community know if it works.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked tree-sitter-LANG against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Copy/paste detector for programming source code, supports 223 formats. AI-ready with token-efficient reporter, skill and MCP server.
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Manage Supabase projects — databases, auth, storage, and edge functions
MCP Security Weekly
Get CVE alerts and security updates for CodeTree and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Stop feeding entire files to your AI agent.
codetree is an MCP server that gives coding agents structured code understanding via tree-sitter — so they ask precise questions instead of reading thousands of lines. 23 tools, 11 languages, ~1 second startup. No vector DB, no embedding model, no config.
Prerequisite: Install uv if you don't have it (curl -LsSf https://astral.sh/uv/install.sh | sh).
Then cd into any project and run:
claude mcp add codetree -- uvx --from mcp-server-codetree codetree --root .
That's it. The . means "this project." Your agent now has structured code understanding.
Not using Claude Code? See Editor Setup for Cursor, VS Code, Windsurf, and Claude Desktop.
$ cat calculator.py
import math
from typing import Optional
class Calculator:
"""A scientific calculator with memory."""
def __init__(self):
self.memory = 0
self.history = []
def add(self, a: float, b: float) -> float:
"""Add two numbers."""
result = a + b
self.history.append(('add', a, b, result))
return result
def divide(self, a: float, b: float) -> Optional[float]:
"""Divide a by b, returns None on zero division."""
if b == 0:
return None
result = a / b
self.history.append(('divide', a, b, result))
return result
# ... 200 more lines of methods ...
Tokens consumed: ~2,000+ for the full file
class Calculator → line 4
"A scientific calculator with memory."
def __init__(self) (in Calculator) → line 7
def add(self, a: float, b: float) (in Calculator) → line 11
"Add two numbers."
def divide(self, a: float, b: float) (in Calculator) → line 17
"Divide a by b, returns None on zero division."
def sqrt(self, x: float) (in Calculator) → line 24
"Square root using math.sqrt."
Tokens consumed: ~80. That's a 25x reduction.
The agent sees every class, method, and docstring — with line numbers — without reading a single function body. When it needs the full source of divide, it calls get_symbol("calculator.py", "divide") and gets just those 6 lines.
| Tool | Purpose |
|---|---|
get_file_skeleton(file_path) | Classes, functions, methods with line numbers + doc comments |
get_symbol(file_path, symbol_name) | Full source of a function or class |
get_skeletons(file_paths) | Batch skeletons for multiple files |
get_symbols(symbols) | Batch source for multiple symbols |
get_imports(file_path) | Import statements with line numbers |
| Tool | Purpose |
|---|---|
find_references(symbol_name) | All usages of a symbol across the repo |
get_call_graph(file_path, function_name) | What a function calls + what calls it |
get_blast_radius(file_path, symbol_name) | Transitive impact — what breaks if you change this |
| Tool | Purpose |
|---|---|
get_complexity(file_path, function_name) | Cyclomatic complexity breakdown |
find_dead_code(file_path?) | Symbols defined but never referenced |
detect_clones(file_path?, min_lines?) | Duplicate / near-duplicate functions |