Tree-sitter MCP Server

السجل الرسمي أدوات المطورين

Parse code into Tree-sitter ASTs to see node kinds, field names, and positions

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package tree-sitter-mcp-server
Claude Code
claude mcp add tree-sitter-mcp-server -- npx -y tree-sitter-mcp-server@0.1.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "tree-sitter-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "tree-sitter-mcp-server@0.1.0"
            ]
        }
    }
}
CARGO package tree-sitter-mcp-server

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. Tree-sitter MCP Server
  2. Installation
  3. Supported Languages
  4. Tool

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)

الأسئلة الشائعة

ما هو Tree-sitter MCP Server؟

Parse code into Tree-sitter ASTs to see node kinds, field names, and positions

كيف أثبّت Tree-sitter MCP Server؟

يعمل على جهازك. في Claude Code: claude mcp add tree-sitter-mcp-server -- npx -y tree-sitter-mcp-server@0.1.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Tree-sitter MCP Server إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل Tree-sitter MCP Server مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Tree-sitter MCP Server؟

ينشره joowani. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.