AST MCP Server
By transforming source code into a queryable Semantic Graph and a structured AST, this tool bridges the gap between 'reading text' and 'understanding structure.' For an AI assistant, it provides the 'spatial' awareness needed to navigate deep depende
What is AST MCP Server?
AST MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to by transforming source code into a queryable semantic graph and a structured ast, this tool bridges the gap between 'reading text' and 'understanding structure.' for an ai assistant, it provides the '...
By transforming source code into a queryable Semantic Graph and a structured AST, this tool bridges the gap between 'reading text' and 'understanding structure.' For an AI assistant, it provides the 'spatial' awareness needed to navigate deep depende
This server falls under the Developer Tools and Coding Agents categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- By transforming source code into a queryable Semantic Graph
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx astConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use AST MCP Server
The AST MCP Server (from angrysky56) transforms source code into queryable Semantic Graphs and structured Abstract Syntax Trees, giving AI assistants spatial awareness of code structure rather than just reading text. By exposing tools for AST parsing, ASG generation, incremental analysis, complexity measurement, AST diffing, and node-position lookup across Python, JavaScript, TypeScript, Go, Rust, C, C++, and Java, it enables Claude to navigate deep dependency chains, understand architectural relationships, and perform precise code transformations that would be impossible with text-based reading alone.
Prerequisites
- Python 3.10 or later installed
- uv package manager installed (recommended) or pip
- Git to clone the repository
- C/C++ build tools for compiling tree-sitter parsers (Xcode Command Line Tools on macOS, build-essential on Linux)
- An MCP client such as Claude Desktop
Clone the repository
Clone the ast-mcp-server repository from GitHub.
git clone https://github.com/angrysky56/ast-mcp-server.git
cd ast-mcp-serverInstall Python dependencies
Use uv to install all Python dependencies including tree-sitter and language grammar packages.
uv syncBuild the tree-sitter language parsers
Compile the native grammar libraries for all supported languages. This step is mandatory before the server can parse any code.
uv run build-parsersAdd the server to your MCP client config
Add the AstAnalyzer entry to your Claude Desktop claude_desktop_config.json with the absolute path to your cloned repository.
{
"mcpServers": {
"AstAnalyzer": {
"command": "uv",
"args": ["--directory", "/path/to/ast-mcp-server", "run", "server.py"]
}
}
}Restart Claude Desktop and verify
Restart Claude Desktop and ask it to parse a source file to confirm the AST server is responding correctly.
AST MCP Server Examples
Client configuration
Claude Desktop JSON config for the AST MCP Server — replace the directory path with your actual clone location.
{
"mcpServers": {
"AstAnalyzer": {
"command": "uv",
"args": ["--directory", "/Users/yourname/ast-mcp-server", "run", "server.py"]
}
}
}Prompts to try
Example prompts that leverage the semantic graph and AST analysis capabilities.
- "Parse main.py and show me the full Abstract Syntax Tree"
- "Generate a Semantic Graph for the auth module and identify all dependency edges"
- "What is the cyclomatic complexity of each function in utils.ts?"
- "Diff the AST of the old version of checkout.go versus the new version and show structural changes"
- "Find the AST node at line 85, column 12 in parser.rs"
- "Which languages are currently supported for AST analysis?"Troubleshooting AST MCP Server
build-parsers fails with 'cc: command not found' or linker errors
Install the required C build tools: on macOS run xcode-select --install, on Ubuntu/Debian run sudo apt install build-essential, on Windows install Visual Studio Build Tools with the C++ workload.
Server starts but returns 'unsupported language' for a file
The server currently supports Python, JavaScript, TypeScript, Go, Rust, C, C++, and Java. Files in other languages cannot be parsed. Ensure build-parsers completed successfully for the specific language grammar you need.
Claude Desktop shows the server as disconnected
Verify the --directory path in your MCP config is the absolute path to the cloned ast-mcp-server folder. Relative paths will fail. Also confirm uv is installed and accessible in the PATH Claude Desktop uses.
Frequently Asked Questions about AST MCP Server
What is AST MCP Server?
AST MCP Server is a Model Context Protocol (MCP) server that by transforming source code into a queryable semantic graph and a structured ast, this tool bridges the gap between 'reading text' and 'understanding structure.' for an ai assistant, it provides the 'spatial' awareness needed to navigate deep depende It connects AI assistants to external tools and data sources through a standardized interface.
How do I install AST MCP Server?
Follow the installation instructions on the AST MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with AST MCP Server?
AST MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is AST MCP Server free to use?
Yes, AST MCP Server is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
AST MCP Server Alternatives — Similar Developer Tools Servers
Looking for alternatives to AST MCP Server? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up AST MCP Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use AST MCP Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.