astexplore-mcp
astexplorer.net as an MCP server: give it source code, pick a parser, get back the AST as JSON. No web scraping — it calls the parser npm packages directly.
Potencialize seu agente
O comando do próprio publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
npx -y [email protected]O Claude Code não tem link de instalação para um comando local. Copie o comando abaixo e execute-o em um terminal.
claude mcp add astexplore-mcp -- npx -y astexplore-mcp@0.1.0Execute em um terminal.
{ "mcpServers": { "astexplore-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirDo publicador
astexplorer.net as an MCP server: give it source code, pick a parser, get back the AST as JSON. No web scraping — it calls the parser npm packages directly.
MCP server that parses JS/TS source into an AST using a selectable parser (babel, acorn, typescript, espree, @typescript-eslint/parser) — astexplorer.net as an MCP tool.
parse_astParse JS/TS/JSX source into an AST.
Output is optimized for token cost by default. Positional metadata is the bulk of an AST's
size and is dropped unless you set locations: true; empty keys are dropped unless
hideEmpty: false; output is compact unless pretty: true. For console.log(1), defaults
produce ~380 chars vs ~3400 for the full pretty tree.
These map to the "Hide …" toggles in astexplorer's tree view: locations ↔ Hide location data,
hideEmpty ↔ Hide empty keys, hideType ↔ Hide type keys. (Hide methods is always in
effect — functions can't be serialized to JSON — and Autofocus is editor-only, so neither
needs a parameter.)
list_parsersReturns the available parsers and an options hint for each. Call this first if unsure.
Once connected, just ask Claude in natural language — it picks the tool and arguments:
"Parse
const x = 1 + 2with acorn and show me the AST" "Use the typescript parser on this file and tell me the SyntaxKind of the top node" "Which parsers does astexplore support?"
parse_ast — babel with the TypeScript plugin:
{
"name": "parse_ast",
"arguments": {
"code": "const x: number = 1;",
"parser": "babel",
"options": { "plugins": ["typescript"] }
}
}
parse_ast — acorn, defaults only:
{ "name": "parse_ast", "arguments": { "code": "const x = 1 + 2;", "parser": "acorn" } }
Response — the AST is returned as JSON in a text content block. By default it is compact and location-free (positions stripped) to save tokens:
{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"x"},"init":{"type":"BinaryExpression","left":{"type":"Literal","value":1},"operator":"+","right":{"type":"Literal","value":2}}}],"kind":"const"}],"sourceType":"module"}
Add "pretty": true to indent it and "locations": true to bring back loc/start/end:
{ "name": "parse_ast", "arguments": { "code": "const x = 1 + 2;", "parser": "acorn", "pretty": true, "locations": true } }
{
"type": "Program",
"start": 0,
"end": 15,
"loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 15 } },
"body": [ { "type": "VariableDeclaration", "...": "..." } ],
"sourceType": "module"
}
list_parsers — no arguments:
{ "name": "list_parsers", "arguments": {} }
{ "plugins": ["typescript", "jsx"] }. JSX is on by default.{ "ecmaVersion": "latest", "sourceType": "module", "loc": true }.{ "scriptKind": "TSX" } — one of JS, JSX, TS, TSX (default TSX).{ "ecmaFeatures": { "jsx": true }, "range": true, "loc": true }.Invalid syntax comes back as a tool error with the parser's own message (not a crash).
Exception: babel defaults to errorRecovery: true, so recoverable mistakes return an AST
plus a populated errors array (message / code / reasonCode / line / column);
pass options: { "errorRecovery": false } to make babel hard-fail instead.
npm install
npm run build
claude mcp add astexplore -- node /absolute/path/to/astexplore-mcp/dist/index.js
Add to claude_desktop_config.json:
{
"mcpServers": {
"astexplore": {
"command": "node",
"args": ["/absolute/path/to/astexplore-mcp/dist/index.js"]
}
}
}
Regression suite — drives the built server over the real MCP stdio protocol (default parser, location stripping, size budget, circular-ref handling, depth truncation, per-parser output, error handling):
npm run build
npm test
test/smoke.mjs is a no-assertion demo that prints one AST per parser; npm test
also executes it. Run it alone with node test/smoke.mjs.
src/
index.ts MCP server: parse_ast + list_parsers tools, output shaping
parsers.ts parser registry + serializers + shapeAst (token trimming)
espree.d.ts ambient types for untyped espree
test/
parse.test.mjs regression assertions (node --test)
smoke.mjs per-parser demo / smoke test
MCP server that parses JS/TS source into an AST using a selectable parser (babel, acorn, typescript, espree, @typescript-eslint/parser) — astexplorer.net as an MCP tool.
{ "mcpServers": { "astexplore-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Astexplore roda localmente via stdio.
Última verificação: 2026-11-15. MCP server that parses JS/TS source into an AST using a selectable parser (babel, acorn, typescript, espree, @typescript-eslint/parser) — astexplorer.net as an MCP tool.