codeTree MCP server
2026년 11월 12일 커밋tree-sitter를 사용하여 구조화된 코드 이해를 제공함으로써, 코딩 에이전트가 정밀한 쿼리를 수행하고 토큰 사용량을 크게 줄일 수 있도록 지원합니다.
다른 이름 ThinkyMiner/codeTree
- 스타
- 30
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 12일
- 라이선스
- MIT
codeTree MCP란?
tree-sitter를 사용하여 구조화된 코드 이해를 제공함으로써, 코딩 에이전트가 정밀한 쿼리를 수행하고 토큰 사용량을 크게 줄일 수 있도록 지원합니다.
프로젝트 README에서 생성된 요약
codeTree MCP server 정보
방대한 양의 토큰을 소비하지 않으면서 대규모 저장소를 탐색해야 하는 코딩 에이전트는 codeTree를 사용하여 코드베이스에 대한 구조화된 이해를 얻을 수 있습니다. 이 MCP server는 tree-sitter를 활용하여 AI 클라이언트가 전체 파일을 읽는 대신 클래스, 메서드, docstring과 같은 특정 코드 요소를 쿼리할 수 있는 방법을 제공합니다. 이 방식은 원본 소스 코드를 읽는 것과 비교했을 때 토큰 소비를 최대 25배까지 줄일 수 있습니다.
개발자는 이 서버를 Claude Code, Cursor, VS Code, Windsurf 또는 Claude Desktop과 같은 환경에 통합할 수 있습니다. Python, TypeScript, Go, Rust, Java를 포함한 11개의 언어를 지원합니다. 서버는 로컬에서 실행되며 외부 벡터 데이터베이스나 임베딩 모델이 필요하지 않아, 약 1초 내에 시작되는 가벼운 솔루션입니다. 백그라운드 인덱싱 프로세스를 통해 심볼 그래프를 구축하고 로컬 캐시를 사용하여 성능을 유지합니다.
23개의 특화된 도구를 통해 심볼 참조 찾기, 순환 복잡도 분석, 데드 코드 탐지, 데이터 흐름 또는 taint 분석과 같은 복잡한 작업을 수행할 수 있습니다. 또한 의존성 그래프 및 변경 영향 분석과 같은 저장소 전반의 인사이트를 제공하여 에이전트가 코드 수정에 따른 결과를 이해하도록 돕습니다.
활용 사례
- 1탐색 중 토큰 사용량 절감AI 에이전트가 구현부의 모든 줄을 읽지 않고도 파일 스켈레톤을 요청하여 클래스 구조를 확인할 수 있습니다.
- 2변수 데이터 흐름 추적개발자가 에이전트를 사용하여 taint 분석을 수행하거나 변수가 서로 다른 함수 사이에서 어떻게 이동하는지 추적할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능thinkyminer/codetree is public and reachablegithub.com/thinkyminer/codetree ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-12github.com/thinkyminer/codetree ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기codetree
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.
Quick Start
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.
Before / After
Before codetree — agent reads the raw file:
$ 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
After codetree — agent asks for the skeleton:
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.
23 Tools
Understand Structure
| 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 |
Navigate Relationships
| 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 |
Analyze Quality
| 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 |
Inspect & Search
| Tool | Purpose |
|---|---|
search_symbols(query?, type?, parent?) |
Flexible symbol search with filters |
find_tests(file_path, symbol_name) |
Find test functions for a symbol |
Onboarding & Graph
| Tool | Purpose |
|---|---|
index_status() |
Indexing progress, graph freshness and stats (never blocks) |
get_repository_map(max_items?) |
Compact repo overview: languages, entry points, hotspots |
resolve_symbol(query, kind?, path_hint?) |
Disambiguate short name into ranked qualified matches |
search_graph(query?, kind?, file_pattern?) |
Graph search with degree filters and pagination |
Change & Dataflow
| Tool | Purpose |
|---|---|
get_change_impact(symbol_query?, diff_scope?) |
Impact analysis via symbol or git diff, with risk levels |
analyze_dataflow(file_path, function_name, mode?) |
Variable dataflow, taint analysis, or cross-function taint tracing |
Visualization & History
| Tool | Purpose |
|---|---|
find_hot_paths(top_n?) |
High-complexity × high-call-count optimization targets |
get_dependency_graph(file_path?, format?) |
File-level dependency graph as Mermaid or list |
git_history(mode?, file_path?, top_n?) |
Git blame, file churn, or change coupling analysis |
suggest_docs(file_path?, symbol_name?) |
Find undocumented functions with context for doc generation |
get_file_skeleton,get_skeletons, andsearch_symbolsacceptformat="compact"for even fewer tokens.
Supported Languages
| Language | Extensions |
|---|---|
| Python | .py |
| JavaScript | .js, .jsx |
| TypeScript | .ts |
| TSX | .tsx |
| Go | .go |
| Rust | .rs |
| Java | .java |
| C | .c, .h |
| C++ | .cpp, .cc, .cxx, .hpp, .hh |
| Ruby | .rb |
| Kotlin | .kt |
Editor Setup
The --root flag tells codetree which project to analyze. Use . for the current directory, or a full path.
Claude Code
cd into your project, then:
claude mcp add codetree -- uvx --from mcp-server-codetree codetree --root .
Cursor
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"codetree": {
"command": "uvx",
"args": ["--from", "mcp-server-codetree", "codetree", "--root", "${workspaceFolder}"]
}
}
}
VS Code (Copilot)
Add to .vscode/mcp.json in your project:
{
"servers": {
"codetree": {
"command": "uvx",
"args": ["--from", "mcp-server-codetree", "codetree", "--root", "${workspaceFolder}"]
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"codetree": {
"command": "uvx",
"args": ["--from", "mcp-server-codetree", "codetree", "--root", "${workspaceFolder}"]
}
}
}
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"codetree": {
"command": "uvx",
"args": ["--from", "mcp-server-codetree", "codetree", "--root", "/path/to/your/project"]
}
}
}
Claude Desktop doesn't support
${workspaceFolder}, so use a full path here.
Why codetree?
| Alternative | Limitation | codetree |
|---|---|---|
| Reading files directly | Burns tokens, no structure, no relationships | 25x token reduction, structured output |
| grep / ripgrep | Text only, no AST awareness, no call graphs | Understands code structure, not just text |
| LSP servers | Heavyweight, stateful, language-specific setup | One command, 10 languages, stateless MCP |
| SCIP / LSIF indexers | Slow builds, complex setup, huge indexes | ~1s startup, JSON cache, zero config |
| AST-only tools | Raw trees are verbose and hard for agents | Pre-structured output designed for agents |
What Gets Indexed
- Git repositories: every file
git ls-filesreports — tracked files plus untracked files that.gitignoredoes not exclude. Tracked directories are indexed even if namedbuild/,dist/orenv/; untracked.venv/,node_modules/,__pycache__/and similar are skipped even when nobody ignored them. Nested worktrees (e.g..claude/worktrees/), nested repositories and submodules are not indexed. - Without git (not a repository,
gitmissing, or git refusing the repository, e.g.safe.directory): the tree is walked, skipping.venv,node_modules,__pycache__,.git,dist,build, … and nested worktrees. .codetree/(codetree's own cache) is never indexed.
The MCP handshake is answered immediately and indexing runs in the background.
Single-file tools answer right away; repo-wide and graph tools wait up to 20 s
for the index (set CODETREE_WAIT_TIMEOUT to change it), then report progress.
index_status() never blocks.
Architecture
Agent (Claude, Copilot, Cursor, etc.)
│ MCP (stdio)
▼
codetree server (FastMCP)
│
├── Indexer → LanguagePlugin → tree-sitter → structured results
│ Cache (.codetree/index.json, mtime-based)
│
└── Graph Layer → SQLite (.codetree/graph.db)
Persistent symbols + edges, incremental updates
Change impact, dataflow, taint analysis
| Module | Responsibility |
|---|---|
server.py |
FastMCP server — defines all 23 tools |
index_state.py |
Index lifecycle: background indexing, readiness, progress for index_status |
indexer.py |
File discovery, plugin dispatch, definition index |
cache.py |
Skeleton cache with mtime invalidation |
registry.py |
Maps file extensions to language plugins |
languages/ |
One plugin per language (Python, JS, TS, Go, Rust, Java, C, C++, Ruby) |
graph/store.py |
SQLite persistence for symbols and edges |
graph/builder.py |
Incremental graph builder (sha256 change detection) |
graph/queries.py |
Repository map, symbol resolution, change impact, hot paths, dependency graph, doc suggestions |
graph/dataflow.py |
Intra- and cross-function dataflow and taint analysis |
graph/git_analysis.py |
Git blame, churn, change coupling analysis |
Adding a Language
pip install tree-sitter-LANGand add topyproject.toml- Copy
src/codetree/languages/_template.pytolanguages/yourlang.py - Implement the abstract methods
- Register extensions in
registry.py - Add tests
Development
git clone https://github.com/ThinkyMiner/codeTree.git
cd codeTree
python -m venv .venv
source .venv/bin/activate
pip install -e .
pip install pytest
# Run all tests (~1200 tests, ~20s)
pytest
# Run a single test file
pytest tests/languages/test_python.py -v
Contributing
Contributions welcome! See CONTRIBUTING.md for setup instructions and guidelines.
codeTree MCP 질문
codeTree는 어떻게 토큰 사용량을 줄이나요?
에이전트가 전체 파일을 읽는 대신 코드 스켈레톤(클래스, 메서드, docstring)을 요청할 수 있게 하여, 토큰 소비량을 최대 25배까지 줄일 수 있습니다.
벡터 데이터베이스나 임베딩 모델이 필요한가요?
아니요, 벡터 DB나 임베딩 모델, 별도의 설정이 필요하지 않습니다.