py-ast-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| analyze_fileA | High-level summary of every symbol in a Python file. Lists classes (with dataclass/enum/Protocol/TypedDict classification), functions, async functions, methods and module-level assignments with line numbers. Start here when exploring an unfamiliar module. Args: path: Path to a .py file. |
| list_functionsA | List all functions and methods with full signatures and line ranges. Includes parameter annotations and defaults, return annotation, decorators, async flag, and nested function relationships. Args: path: Path to a .py file. |
| get_function_bodyA | Extract the full source of a function or method, with line numbers. Args:
path: Path to a .py file.
name: Function name, |
| list_methodsA | List every method of a class: declared, inherited, properties, class and static methods, plus class-level attributes. Inherited members are only resolved for base classes defined in the same file; bases from other modules are reported as unresolved. Args: path: Path to a .py file. type: Class name. |
| get_type_definitionA | Extract a class, TypeAlias, Enum, Protocol, TypedDict or NamedTuple definition with its members and source. Args: path: Path to a .py file. name: Type name. |
| list_declarationsA | List module-level assignments with annotated or inferred types. Args: path: Path to a .py file. |
| list_exportsA | List the public symbols of a module. Respects Args: path: Path to a .py file. |
| list_importsB | List all imports: bound name, module path, relative level and aliases, grouped into stdlib / third-party / relative. Args: path: Path to a .py file. |
| find_usagesA | Find every occurrence of an identifier with surrounding source lines. Covers reads, assignments, parameters, attribute access, imports and
global/nonlocal declarations. Always reports a project-wide references
section: either the cross-file hits, or that there are none, or that Args: path: Path to a .py file. identifier: Name to search for. context: Lines of context to show around each hit (default 1). |
| call_graphA | Emit a Mermaid flowchart of the call relationships in a file or package. Args: path: Path to a .py file. function: Optional root; only calls reachable from it are drawn. direction: Mermaid layout direction: TD, TB, LR, RL or BT. include_external: Include calls to names not defined in scope. scope: "file" (default) or "package" to walk every .py file in the containing directory. |
| get_callersA | Reverse call graph: who calls this function, directly and transitively. Args:
path: Path to a .py file.
function: Function name or |
| code_complexityA | Cyclomatic complexity per function, with rank and decision-point breakdown. Counts if/elif, for, while, except, comprehension fors and ifs, boolean
operators, ternaries, and match cases other than the irrefutable one.
Scores match
Args: path: Path to a .py file. function: Optional single function to analyse in detail. |
| code_smellsA | Detect long functions, deep nesting, god classes, too many parameters,
mutable default arguments, mutable Args: path: Path to a .py file. function: Optional single function to analyse. |
| find_errorsA | Find Python-specific hazards: bare/broad except, Args: path: Path to a .py file. function: Optional single function to analyse. |
| dead_codeA | Find unreferenced private and module-level symbols across a directory. If Args: path: A .py file or a directory. include_tests: Also scan test files (default False). |
| find_implementationsA | Find classes implementing a Protocol or ABC, both explicitly (as a base class, including indirect subclasses) and structurally (method-set match). Args:
path: A .py file or directory; the containing directory is scanned.
interface: Name of the Protocol/ABC/base class. Named |
| get_docA | Extract a docstring and parse it into summary/params/returns/raises when it follows Google or NumPy style. Args:
path: Path to a .py file.
name: Symbol name, |
| analyze_packageA | Directory-level summary of every .py file: sizes, class/function counts, docstrings and per-file symbol lists. Args: path: Directory to analyse. include_tests: Include test files (default False). |
| diff_astA | Structural diff between two Python files: added, removed and modified
functions, classes, methods, module variables, imports and Args: old_path: Path to the original file. new_path: Path to the updated file. |
| find_node_at_positionA | Identify the AST node at a cursor position with its enclosing scope chain. Args: path: Path to a .py file. line: 1-based line number. column: 0-based column offset. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gclluch/py-ast-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server