Tree-sitter Analyzer MCP
A local MCP server with call graphs and symbol search: the agent sees code structure and what an edit affects in advance.
- 61 ★ on the repository
- Last commit
Extended access
Why this level
- The server reads the whole project source and writes an index to `.ast-cache`, and the installer may edit client configs and download `uv`.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/tree-sitter-analyzerDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The server reads the whole project source and writes an index to `.ast-cache`, and the installer may edit client configs and download `uv`.
This is third-party code. Review the repository files before installing.
What it does
Tree-sitter Analyzer indexes a codebase and serves agents correct call graphs, symbol search and structural queries. It runs locally with no telemetry. The server exposes eight tools (`nav`, `search`, `structure`, `index`, `health`, `edit`, `viz` and `project`), and responses arrive as JSON with a verdict such as SAFE, CAUTION or UNSAFE. Cross-language links are created only within a language family, and a name match alone creates no edge. Extras include an edit safety check, architectural constraint rules ("module A cannot import B"), a project health grade from A to F and Mermaid graph export. The package wheel bundles `tsa-*` skills, installed with `--install-skills`.
Who it is for. Developers of large multi-language repositories whose agents edit blindly because they cannot see who calls the function being changed.
Good fit when
- Before a refactor you need to know what breaks if a function signature changes.
- The agent needs a call map: who calls a method and what it calls itself.
- An architectural rule such as "layer A does not import layer B" must be checked on every edit.
- In a merge request review you want AST diffs and the blast radius of the changes.
Not a fit when
- The repository is small and plain text search is enough for the agent.
- The project language is not among the supported grammars.
- Installing dependencies through `uv` is not allowed: the automated installer downloads and runs the official installer when `uv` is missing.
Example request
Using tree-sitter-analyzer, show who calls the config parsing function and assess what changing its signature would affect.MCP
- Transport
- stdio
- Authentication
- not required
Environment variables
TREE_SITTER_PROJECT_ROOTrequired- Absolute path to the root of the analyzed project.
Limitations
Python 3.10 or newer is required. `TREE_SITTER_PROJECT_ROOT` must be an absolute path, otherwise the client will not see the server. The first run needs to build an index (`--full-index`), and the database lives in `.ast-cache/index.db`; on a lock error stop other processes holding it. When `uv` is missing, `install.sh` downloads an installer that is not content-bound and warns about it. `TSA_DISABLE_UNVERIFIED_UV_BOOTSTRAP=1` disables that download. Support depth differs between languages; the table is in the README.
How to disable. Remove the server entry from `.mcp.json`, `.cursor/mcp.json` or `.vscode/mcp.json`, and delete the `.ast-cache` folder and the copied `tsa-*` skills by hand.
FAQ
How do I connect the server to Claude Code?
Run `claude mcp add tree-sitter-analyzer --scope project --env TREE_SITTER_PROJECT_ROOT="$PWD" -- uvx --from "tree-sitter-analyzer[mcp]" tree-sitter-analyzer-mcp`. Then build the index.
How do I check that the index is ready?
Ask the agent to run the `index` tool with `action=status`: a reply of `indexed: true` means success. Without an agent, `tree-sitter-analyzer --codegraph-status` works.
How do I install the tsa skills?
With `uvx --from tree-sitter-analyzer tree-sitter-analyzer --install-skills` for the current project or `--install-skills-global` for all projects.
Which agents are supported?
The automated installer configures Claude Code, Cursor, VS Code, Claude Desktop and Codex. Copilot, Cline, Continue and Roo Code are covered in the Supported agents section.
Does it send code out?
No. It runs locally and the README declares no telemetry.
Discussion
No questions or reviews yet.
Related
MCP serversAn MCP server that indexes code with tree-sitter and returns individual functions and classes to the agent instead of whole files
A local code graph with version history: an MCP server that tells the agent who calls a function and what an edit breaks
An MCP server that indexes code with tree-sitter so an agent reads single symbols, not files, traces paths and weighs edits
An MCP server that builds a code graph of functions, classes, calls and routes and answers the agent's structural queries locally
An MCP server that builds a code knowledge graph: semantic search, call graph, HTTP route tracing and change impact analysis.
Local code structure graph: builds a repository map with tree-sitter and serves the assistant only the context a change actually touches over MCP
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Tree-sitter Analyzer (this card) | no | not required | 61 | |
| Serena | no | not required | 31,335 | symbol navigation through language servers; this uses a tree-sitter index with edit risk verdicts and architecture rules |
| CodeGraph | no | not required | 77,481 | a code graph as a knowledge base; this adds SAFE and UNSAFE verdicts before an edit plus constraint checks |
README in short
The `install.sh` installer registers the server in the configs of detected clients and backs them up. A CLI does the same work without an agent, for example `--affected FILE` finds the tests touched by a change.