AST MCPast-mcp
Tools

Code intelligence

Choose the smallest AST-aware tool that answers the question.

ast-mcp exposes ast-bro tools directly. There is no generic proxy and no need to retrieve entire source files just to understand structure.

Learn the shape

ToolUse it for
digestA compact map of an unfamiliar directory
mapSignatures, fields, headings, and parse health for exact files
showThe body of one or more known symbols
surfaceThe public API after re-export resolution
contextOne symbol plus nearby callers and callees within a token budget

Find behavior

ToolQuestion
searchWhere is this concept or symbol implemented?
find_relatedWhat code is structurally or semantically similar to this location?
callersWho calls this symbol?
calleesWhat does this symbol call?
traceHow does one symbol reach another?
implementsWhich types implement or extend this type?

Understand dependencies

  • deps follows imports forward.
  • reverse_deps finds importers.
  • graph returns the file dependency graph.
  • cycles identifies strongly connected components.
  • impact combines call edges, imports, and affected tests for a proposed change.

Search and rewrite syntax

run uses structural syntax patterns. $NODE matches one node and a metavariable beginning with three dollar signs matches zero or more nodes.

Search omits rewrite. A dry-run includes rewrite and leaves write false. Direct write: true is an exceptional lower-level escape hatch; normal edits belong in guarded file_patch batches.

The pinned ast-bro version rewrites the first match per file, so every rule must be narrowed to one reviewed match.

On this page