MCP Tree-sitter Server
Adds a Git view to the studio UI alongside the AST explorer and analysis tools, letting users inspect the Git state and history of a registered code project.
Exposes server metrics in Prometheus format at /api/metrics (protected by the same Bearer authentication) so they can be scraped for monitoring.
Backs the server's data store with SQLite and exposes an SQL console in the UI for running queries against that database, with optional write access controlled by configuration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Tree-sitter Servershow the AST and symbols for src/index.ts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Tree-sitter Server / Studio
Servidor Model Context Protocol para análise de código com Tree-sitter (WASM), com uma UI web (editor Monaco, explorador de AST, consultas, complexidade, similaridade, Git e console SQLite).
Backend: Node.js (>= 22.5) + Express,
web-tree-sitter+tree-sitter-wasms, SQLite (node:sqlite).Frontend: React 18 + Vite + Tailwind.
MCP: JSON-RPC 2.0 em
POST /api/mcp; stream SSE emGET /mcp/sse.
Instalação e execução
npm ci
cp .env.example .env # ajuste os valores
npm run dev # modo desenvolvimento (auth opcional, Vite embutido) em http://127.0.0.1:3000Produção:
npm run build
MCP_API_KEYS=troque-esta-chave npm startCom Docker (auth ligada, usuário não-root, sistema de arquivos somente leitura, volume para o SQLite):
MCP_API_KEYS=troque-esta-chave docker compose up --buildMétricas Prometheus em GET /api/metrics (exige o mesmo Bearer). Logs JSON em stderr; X-Request-Id em todas as respostas.
Fora do modo dev (--dev / NODE_ENV=development) a autenticação é obrigatória e o servidor não sobe sem MCP_API_KEYS ou MCP_JWT_SECRET.
Related MCP server: XRAY MCP
Segurança
Controle | Variável | Padrão |
Autenticação Bearer (API key / JWT HS256) em |
| ligada fora do modo dev |
Origens CORS permitidas |
|
|
Raízes permitidas para |
|
|
Console SQL com escrita |
|
|
Interface de rede |
|
|
/api/health é público. A UI pede o token quando o servidor responde 401 e o guarda apenas em sessionStorage. Detalhes dos contratos em docs/04-governance/api-specification.md.
Usando com um cliente MCP
Aponte o cliente para http://127.0.0.1:3000/api/mcp enviando Authorization: Bearer <chave>. Ferramentas principais: register_project_tool, list_files, get_ast, get_symbols, run_query, find_references, analyze_complexity, find_similar_code, search_text, find_dependencies, audit_project_isolation. A lista completa vem de tools/list.
Desenvolvimento
npm run lint # tsc --noEmit
npm test # vitest
npm run buildVeja AGENTS.md (arquitetura e regras) e CONTRIBUTING.md. A documentação da implementação Python original está em docs/legacy-python/ apenas como histórico.
Licença
Veja LICENSE e NOTICE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides code context and analysis for AI assistants by extracting directory structures and code symbols using WebAssembly Tree-sitter parsers with zero native dependencies.131 npm20MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to understand and navigate codebases through structural analysis. Provides code mapping, symbol search, and impact analysis using ast-grep for accurate parsing of Python, JavaScript, TypeScript, and Go projects.453MIT
- AlicenseCqualityDmaintenanceEnables code analysis of JavaScript, TypeScript, TSX, Python, and Rust files using Tree-sitter, providing symbol listing, definition/reference lookup, AST queries, LSP-style features, and SQLite indexing for efficient cross-file searches.218 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides a semantic understanding of your codebase by parsing with tree-sitter and building a graph of symbols and dependencies. Enables AI assistants to navigate code, analyze changes, and discover architecture using 18 tools with minimal context overhead.14 npm1MIT