py-ast-mcp

gclluch/py-ast-mcp
★ 0 stars Python API Integration Updated today
MCP server for deep structural analysis of Python via the stdlib ast module - 20 tools for call graphs, radon-compatible complexity, dead code, and protocol conformance
View on GitHub → 🔍 Audit Wallet Slippage →

Quick Install

Copy the config for your editor. Some servers may need additional setup — check the README.

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "py-ast-mcp": {
      "command": "uvx",
      "args": [
        "py-ast-mcp"
      ]
    }
  }
}

Or install with pip: pip install py-ast-mcp

README Excerpt

An MCP (Model Context Protocol) server for deep structural analysis of **Python** source code. It is the Python counterpart to [ts-ast-mcp](https://github.com/gclluch/ts-ast-mcp) and mirrors its 20-tool surface as closely as Python semantics allow. Everything is built on the standard library `ast` module — no compilation, no type checker, no project configuration required. `jedi` is an optional extra used only for cross-file semantic resolution, and every tool degrades gracefully when it is not

Tools (20)

PATHanalyze_fileanalyze_packageargparsecall_graphcode_complexitycode_smellsdead_codediff_astfind_errorsfind_implementationsfind_node_at_positionfind_usagesget_callersget_docget_function_bodyget_type_definitionlist_declarationslist_exportslist_functions

Topics

astcall-graphcode-analysismcpmodel-context-protocolpythonstatic-analysis