MCP Servers / development / ast-grep MCP

ast-grep MCP

JSON →
none413development

An experimental MCP server that uses the ast-grep CLI for code structural search, linting, and rewriting.

Install
How to run this server
[ { "cmd": "uvx --from", "imports": [] } ]
server path: ast-grep-mcp
Tools
What this server exposes
dump_syntax_tree
Visualize the Abstract Syntax Tree structure of code snippets. Essential for understanding how to write effective search patterns.
test_match_code_rule
Test ast-grep YAML rules against code snippets before applying them to larger codebases.
find_code
Search codebases using simple ast-grep patterns for straightforward structural matches.
find_code_by_rule
Advanced codebase search using complex YAML rules that can express sophisticated matching criteria.
Configuration
Environment & auth
authnone
Resources