MCP AST Explorer logo

MCP AST Explorer

Indexes Python code with LibCST and exposes deterministic symbol, reference, call-chain, and class-hierarchy lookups over MCP.

Install MCP AST Explorer

Run the project’s own setup commands, in order.

Setup steps from the project

MCP AST Explorer installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Start the server
    uv run mcp-ast-explorer
    

Overview

MCP AST Explorer MCP server indexes Python source files with LibCST and exposes deterministic symbol-exploration tools over MCP. It can locate definitions, report function signatures, find same-module references, identify direct callers, and inspect simple direct subclass relationships. Use it for codebase onboarding when agents need grounded information about Python symbols without LLM-based lookup. Cross-file resolution, TypeScript analysis, aliases, and dynamic or qualified references are outside its current scope.

Use cases

  • Locate Python definitions during codebase onboarding
  • Inspect function and method signatures
  • Find same-module references to a symbol
  • Trace direct callers of a function
  • List direct subclasses in simple class hierarchies

Key features

  • LibCST-based Python source indexing
  • Definition and signature lookup
  • Same-module reference search
  • Direct caller detection
  • Simple direct subclass detection
  • Structured missing-symbol and unsupported-language errors

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/16 checks healthy over the last 112d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit5mo agoMost recent push to the default branch.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP AST Explorer works

What MCP AST Explorer does

The MCP AST Explorer MCP server builds a parsed index of Python source files and makes focused code-navigation operations available to an MCP client. Its supported symbol types are modules, classes, functions, and methods. Results are based on the parsed source rather than generated explanations, so a missing symbol produces a structured not-found response instead of an invented answer.

The server is intended for codebase onboarding workflows. It can provide the location and kind of a definition, show a function or method signature, list same-module references, identify direct callers, and report direct subclasses for simple inheritance relationships. It is the semantic symbol layer in the documented wayfinder onboarding stack, alongside repository mapping and test-running servers.

How it works

Python files are parsed with LibCST. Queries accept a path, symbol or class name, and an optional language value that defaults to Python. The implementation analyzes local syntax and symbol containers rather than performing package-wide semantic resolution.

For reference searches, the MCP AST Explorer MCP server looks for same-module CST name references associated with an existing symbol. Call-chain queries use those local references to identify direct callers. Class-hierarchy queries detect direct subclasses written with simple base-class names, such as class Child(Base):. The health tool returns ok for smoke checks.

Setup and configuration

Local development uses uv. Install the project dependencies with:

bash
uv sync --extra dev

Run the server with:

bash
uv run mcp-ast-explorer

Verification commands are available for Ruff, mypy, and pytest:

bash
uv run ruff check .
uv run mypy
uv run pytest

Tools and capabilities

The MCP AST Explorer MCP server exposes these tools:

  • health() returns an ok status for smoke testing.
  • find_definition(path, symbol, language="python") locates a module, class, function, or method definition.
  • function_signature(path, symbol, language="python") returns a function or method signature.
  • 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") reports direct callers detected from local references.
  • class_hierarchy(path, class_name, language="python") reports direct subclasses found through simple base-class names.

Unsupported languages and missing symbols receive structured error responses. TypeScript has a registered unsupported backend placeholder, but its analysis is not implemented.

Limitations and notes

The server is Python-only in its current v1 scope. It does not resolve cross-file imports or package-wide relationships. Aliases, star imports, dynamic attribute access, and qualified references are not resolved. Call-chain results contain direct callers only; recursive multi-hop expansion is not implemented. Class-hierarchy results contain direct subclasses only and depend on simple base-class syntax.

Because lookup is syntax-based and deterministic, results should be treated as local source analysis rather than a complete language-server-style model of the project. The repository lists the project under the MIT license.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP AST Explorer

Install the project dependencies with `uv sync --extra dev`, then run `uv run mcp-ast-explorer`.

No. TypeScript is registered as an unsupported backend placeholder, but TypeScript analysis is not implemented.

No. Cross-file imports and package-wide resolution are outside the v1 scope.

No. It uses LibCST parsing and returns a structured not-found result when a requested symbol or class is absent.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP AST Explorer AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-ast-explorer?style=directory)](https://allmcps.com/mcp/mcp-ast-explorer)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-ast-explorer"><img src="https://allmcps.com/api/badge/mcp-ast-explorer?style=directory" alt="MCP AST Explorer on AllMCPs" /></a>