AST MCP Server

v1.0.0Developer Toolsstable

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

asgastclaudecodingmcp-server
Share:
35
Stars
0
Downloads
0
Weekly
0/5

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

Transform source code into queryable Semantic Graphs.
Navigate deep code dependencies with spatial awareness.
Understand code structure semantically for better AI comprehension.
angrysky56

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx ast

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Clone the repository

Clone the ast-mcp-server repository from GitHub.

git clone https://github.com/angrysky56/ast-mcp-server.git
cd ast-mcp-server
2

Install Python dependencies

Use uv to install all Python dependencies including tree-sitter and language grammar packages.

uv sync
3

Build 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-parsers
4

Add 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"]
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "ast": { "command": "npx", "args": ["-y", "ast"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides