Migration Guide: v1.x → v2.0 (66 Tools → 8 Facades)

June 12, 2026 · View on GitHub

Why 66 → 8?

Tree-sitter Analyzer v1.x registered 66 discrete MCP tools into every connected client. That worked on the CLI and in curl-style clients, but it created two real problems:

Token cost. Every MCP client (Roo Code, Cline, Copilot, Cursor) injects all tool definitions into every prompt. With 66 tools the eager payload hit 24,318 tokens of pure tool-definition overhead per session — exactly the waste that TOON output was designed to avoid. The irony: the server that saved 50-70% on response tokens was burning 24k tokens on discovery.

Client breakage. Cursor caps composed MCP tool names at 60 characters (<server>__<tool>). Several v1.x names were approaching that limit. Roo Code reports degraded tool-selection accuracy above ~50 tools because the LLM's tool picker is overwhelmed by near-duplicate names (codegraph_callers vs codegraph_call_graph mode=callers).

v2.0 collapses all 66 tools into 8 domain facades (search, nav, structure, health, edit, project, index, viz). Each facade exposes an action parameter that routes to the same inner logic. No capability is removed — every tool is reachable via (facade, action). The token cost drops to ~4,873 tokens (~80% less) day-one.

Comparison (tool count in eager MCP surface):

ServerTools
CodeGraph~12
Rhizome / mycelium1 (unified)
Tree-sitter Analyzer v2.08 (rich-output: verdict + TOON)
Tree-sitter Analyzer v1.x66

Shim: one release cycle, then removed

v2.0 ships a backwards-compatibility shim in the MCP server layer. Any call that arrives using a v1.x tool name is transparently forwarded to the correct facade action. The shim emits a deprecation warning on stderr and includes a deprecation field in the response envelope so agent-side code can detect it:

{
  "verdict": "INFO",
  "deprecation": "codegraph_callers is deprecated (v1.x). Use: nav action=callers",
  "data": { ... }
}

The shim is present in v2.0 and v2.1 and will be removed in v2.2.


Pin to v1.x (escape hatch)

If you need uninterrupted v1.x behaviour while your tooling migrates, pin:

pip install "tree-sitter-analyzer<2"

Or in pyproject.toml:

[tool.uv.sources]
tree-sitter-analyzer = { version = "<2" }

Old → New crosswalk (all 66 legacy tools)

The table below is the canonical mapping maintained in tree_sitter_analyzer/mcp/facade_map.py. The shim is derived from this same table.

search facade

v1.x tool namev2.0 call
codegraph_symbol_searchsearch action=symbol
query_codesearch action=query (tree-sitter .scm DSL — distinct from symbol search)
search_contentsearch action=content
find_and_grepsearch action=grep
batch_searchsearch action=batch
codegraph_querysearch action=chain
v1.x tool namev2.0 call
codegraph_navigatenav action=navigate
codegraph_call_pathnav action=call_path
codegraph_xrefnav action=xref
codegraph_resolvenav action=resolve
symbol_lineagenav action=lineage
codegraph_impactnav action=impact
trace_impactnav action=trace
codegraph_contextnav action=context
codegraph_callersnav action=callers (default scope=point)
codegraph_calleesnav action=callees (default scope=point)
codegraph_call_graphnav action=callers scope=graph
codegraph_callee_treenav action=callee_tree
codegraph_caller_treenav action=caller_tree

structure facade

v1.x tool namev2.0 call
get_code_outlinestructure action=outline
analyze_code_structurestructure action=analyze
codegraph_ast_pathstructure action=ast_path
codegraph_sitemapstructure action=sitemap
codegraph_class_hierarchystructure action=class_tree
codegraph_class_inspectstructure action=class_detail
codegraph_explorestructure action=explore
extract_code_sectionstructure action=read

health facade

v1.x tool namev2.0 call
check_project_healthhealth action=project
check_file_healthhealth action=file
check_code_scalehealth action=scale
code_patternshealth action=patterns
codegraph_complexity_heatmaphealth action=heatmap
codegraph_import_graphhealth action=imports
codegraph_dependency_matrixhealth action=matrix
codegraph_dead_codehealth action=dead
detect_routeshealth action=routes
codegraph_overviewhealth action=overview
analyze_dependencieshealth action=deps
codegraph_test_gaphealth action=test_gap

edit facade

v1.x tool namev2.0 call
safe_to_editedit action=safe
modification_guardedit action=guard
analyze_change_impactedit action=impact
refactoring_suggestionsedit action=refactor
check_constraintsedit action=constraints
codegraph_pr_reviewedit action=pr
semantic_classifyedit action=classify
ast_diffedit action=ast_diff

project facade

v1.x tool namev2.0 call
get_project_overviewproject action=overview
list_filesproject action=files
smart_contextproject action=smart
advise_parser_readinessproject action=parser
check_toolsproject action=tools
codegraph_metricsproject action=metrics
list_agent_skillsproject action=skills
get_agent_workflowproject action=workflow
decision_journalproject action=journal
doc_syncproject action=doc_sync

index facade

v1.x tool namev2.0 call
codegraph_statusindex action=status
ast_cacheindex action=cache
build_project_indexindex action=build
codegraph_full_indexindex action=full
codegraph_autoindexindex action=auto
codegraph_incremental_syncindex action=sync

viz facade

v1.x tool namev2.0 call
codegraph_umlviz action=uml
codegraph_visualizeviz action=graph
codegraph_similarityviz action=similarity

Infrastructure tool (not shimmed)

set_project_path is not a facade and not in the crosswalk above. It mutates server-level state (analysis engine, security validator, inner-instance rebind) that no inner tool can reach, so it stays as a standalone entry in v2.0. No migration needed.


MCP call examples

v1.x style (still works via shim through v2.1):

{ "tool": "codegraph_callers", "arguments": { "function_name": "execute" } }

v2.0 style (preferred):

{ "tool": "nav", "arguments": { "action": "callers", "function_name": "execute" } }

v2.0 graph scope (was codegraph_call_graph):

{ "tool": "nav", "arguments": { "action": "callers", "function_name": "execute", "scope": "graph" } }

Agent skill allowlists

If you maintain custom agent skills that list mcp__tree-sitter-analyzer__<legacy_tool> in their allowed-tools frontmatter, update each entry to reference the facade:

# before
allowed-tools:
  - mcp__tree-sitter-analyzer__codegraph_callers
  - mcp__tree-sitter-analyzer__codegraph_symbol_search

# after
allowed-tools:
  - mcp__tree-sitter-analyzer__nav
  - mcp__tree-sitter-analyzer__search

The bundled tsa-* skills are updated in v2.0 as part of Wave D / G1.


Deprecation timeline

VersionStatus
v1.xAll 66 tools live, no deprecation
v2.08 facades live; shim forwards 66 legacy names with deprecation field
v2.1Shim still present; legacy names emit louder stderr warning
v2.2Shim removed; legacy names return NOT_FOUND

See also

  • tree_sitter_analyzer/mcp/facade_map.py — machine-readable crosswalk (single source of truth)
  • docs/CODEMAPS/mcp-tools.md — agent-facing codemap (facades + legacy names)
  • AGENTS.md — onboarding guide for AI agents