
ast-grep MCP Server (Rust)
by godspeedai
Structural code search for AI assistants using ast-grep, implemented in Rust.
What it does
This server provides AI assistants with structural code search capabilities via ast-grep. Unlike regex-based search, it understands the syntax tree of the code, allowing for more precise searches and modifications across a wide variety of programming languages.
Tools
dump_syntax_tree: Inspect the syntax tree or pattern structure for debugging rules.test_match_code_rule: Test a YAML ast-grep rule against a provided code snippet.find_code: Search a project using a specific ast-grep pattern.find_code_by_rule: Search a project using a comprehensive YAML ast-grep rule.
Installation
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"ast-grep": {
"command": "ast-grep-mcp-server",
"args": [],
"env": {}
}
}
}
Supported hosts
- Cursor
- Claude Desktop
- VS Code
Quick install
cargo install ast-grep-mcpInformation
- Pricing
- free
- Published
- 4/18/2026
- stars






