Tree-sitter MCP Server
Parse code into Tree-sitter ASTs to see node kinds, field names, and positions
Install
Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).
tree-sitter-mcp-serverclaude mcp add tree-sitter-mcp-server -- npx -y tree-sitter-mcp-server@0.1.0
{
"mcpServers": {
"tree-sitter-mcp-server": {
"command": "npx",
"args": [
"-y",
"tree-sitter-mcp-server@0.1.0"
]
}
}
}
tree-sitter-mcp-serverDocumentation
From the project's README on GitHub, refreshed weekly. Links open on GitHub.
Tree-sitter MCP Server
An MCP server that shows coding agents the Tree-sitter syntax tree of a code snippet, so they can check node kinds, field names, and positions before writing Tree-sitter queries or code that walks a syntax tree.
Installation
Claude Code:
claude mcp add tree-sitter -- npx -y tree-sitter-mcp-server
Codex:
codex mcp add tree-sitter -- npx -y tree-sitter-mcp-server
Other clients:
{
"mcpServers": {
"tree-sitter": {
"command": "npx",
"args": ["-y", "tree-sitter-mcp-server"]
}
}
}
npx needs Node.js. Without it, install the binary with cargo install --locked tree-sitter-mcp-server or download
it from the releases, and use tree-sitter-mcp-server as
the command.
Clients that browse the MCP Registry, such as VS Code, can also install it from there.
mcp-name: io.github.joowani/tree-sitter-mcp-server
Supported Languages
c, cpp, csharp, go, graphql, hcl, java, javascript, json, jsx, kotlin, php, prisma,
protobuf, python, ruby, rust, sql, swift, terraform, thrift, toml, tsx, typescript, yaml
Names are case-insensitive, and common aliases such as c++, c#, py, and ts also work. javascript and jsx
use the TypeScript and TSX grammars, and terraform uses the HCL grammar. PHP code must start with <?php.
Tool
get_tree_sitter_ast returns the syntax tree of code in language, one named node per line, with field names and
zero-based (row-column) ranges. ERROR and MISSING nodes mark syntax errors.
{
"language": "python",
"code": "x = 1"
}
module (0-0) - (0-5)
expression_statement (0-0) - (0-5)
assignment (0-0) - (0-5)
left: identifier (0-0) - (0-1)
right: integer (0-4) - (0-5)
Frequently asked questions
What is Tree-sitter MCP Server?
Parse code into Tree-sitter ASTs to see node kinds, field names, and positions
How do I install Tree-sitter MCP Server?
It runs on your machine. In Claude Code: claude mcp add tree-sitter-mcp-server -- npx -y tree-sitter-mcp-server@0.1.0. For other clients, paste the JSON configuration from this page into their MCP settings.
Does Tree-sitter MCP Server need an API key?
Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.
Is Tree-sitter MCP Server open source?
Yes. Its code is on GitHub under the MIT license.
Who maintains Tree-sitter MCP Server?
It is published by joowani. AI.tn lists it but does not maintain or endorse it.
From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.