Python symbol exploration for codebase onboarding agents.
MCP server for deterministic Python codebase symbol exploration.
mcp-ast-explorer indexes Python source files with LibCST and exposes focused MCP tools for codebase onboarding: definition lookup, function signatures, local references, direct call chains, and simple class hierarchy queries.
mcp-ast-explorer is the semantic symbol layer in a three-server MCP tool stack for Project 6 wayfinder, a codebase onboarding agent.
mcp-repo-mapper maps repository structure, languages, entry points, framework evidence, and Python dependency edges.mcp-ast-explorer provides symbol-grounded Python definition, signature, reference, call-chain, and class-hierarchy lookups.mcp-test-runner runs local pytest/Jest checks and coverage summaries so agent claims can be verified against execution.In wayfinder, this server feeds entry-point and symbol explanation while refusing to invent missing symbols.
This is a Python-only v1. TypeScript is registered as an unsupported backend placeholder so the server has an explicit extension point, but TypeScript analysis is not implemented yet.
The server does not use an LLM for symbol lookup. If a requested symbol or class is not present in the parsed index, tools return a structured not-found result instead of inventing an answer.
| Tool | Purpose |
|---|---|
health() | Returns ok for smoke checks. |
find_definition(path, symbol, language="python") | Finds a module, class, function, or method definition. |
function_signature(path, symbol, language="python") | Returns the signature for a function or method symbol. |
find_references(path, symbol, language="python") | Returns same-module CST name references for an existing symbol. |
call_chain(path, from_symbol, depth=2, language="python") | Returns direct callers detected from local references. |
class_hierarchy(path, class_name, language="python") | Returns direct subclasses detected from simple base-class names. |
class Child(Base): inheritance.call_chain currently returns direct callers only; recursive multi-hop expansion is not implemented.class_hierarchy currently returns direct subclasses only and handles simple base names.Install dependencies:
uv sync --extra dev
Run the MCP server:
uv run mcp-ast-explorer
Run verification:
uv run ruff check .
uv run mypy
uv run pytest
MIT
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
uvx mcp-ast-explorerMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-lovranran-mcp-ast-explorer": {
"command": "uvx",
"args": [
"mcp-ast-explorer"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencemcp-ast-explorerpypiMCP AST Explorer works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.