AstGrep

structural code search as an MCP tool — find patterns not strings

npx -y github:Isco0819/ast-grep-mcp

Ever run into this?

Like ast-grep (sg) which has 7k+ GitHub stars and real traction, but no MCP integration exists. AI agents doing code review rely on text grep and miss structural patterns — async without try-catch, hooks with missing deps, API routes without auth checks. Text search is blind to code semantics.

The fix

MCP server wrapping the ast-grep CLI. Agents call ast_search(lang, pattern, dir) and get structured matches with file, line, and snippet. Zero latency, no AI API needed — pure local structural analysis.

What it does

npx -y github:Isco0819/ast-grep-mcp