ast-mcp
v0.7.2Structural code retrieval over MCP — tree-sitter symbols instead of whole files
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
file_outline
Outline one file: definitions, key paths or headings, bodies elided. Use this instead of reading a file to find out what is in it. mode: "full" (default) or "names" — names, lines and counts only, for enumerating what a file defines. On a data file this answers record count and field types without returning any value from inside a collection: each collection carries `children_count` and `uniformity` ("uniform" — every element has element 0's keys; "mixed" — they differ; "unverified" — too many to check).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
include_docstrings | boolean | |
max_depth | ||
max_tokens | integer | |
mode | string |
get_symbol
Fetch definitions by name, key path, or heading slug. mode: "source" (default) returns the body, "signature" and "doc" omit it. A name matching several different symbols returns candidates rather than guessing. A name matching several definitions of the same thing — many Lua listeners on one event — returns all of them in "symbols". line: pick one definition by the start_line a candidate reported.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
line | ||
max_tokens | integer | |
mode | string | |
path |
search_symbols
Find definitions, key paths and headings by name across the repository. group is one of core, web, scripting, data, devops, docs.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
group | ||
kind | ||
lang | ||
limit | integer | |
max_tokens | integer | |
path_glob |
get_docstrings
Documentation without bodies. Pass exactly one of path or symbols.
| Parameter | Type | Description |
|---|---|---|
max_tokens | integer | |
path | ||
symbols |
list_imports
Dependency edges out of one file, plus exports where the language has them.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
max_tokens | integer |
ast_query
Run a raw tree-sitter S-expression query against one file. The escape hatch for anything the five typed tools flatten away.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
query * | string | |
captures | ||
max_tokens | integer |