ast-grep Structural Search MCP

Syntax-aware AST pattern matching across TypeScript, Python, Go, and Rust

Finds exact code patterns using Tree-sitter abstract syntax trees instead of brittle regexes, preventing false positives in comments and strings.

Install & Client JSON Configurations

All client configuration manifests are exposed directly below without hidden tabs for zero-click copying.

CLI Install Command
uvx --from git+https://github.com/ast-grep/ast-grep-mcp ast-grep-server
Claude Desktop · claude_desktop_config.json
{
  "mcpServers": {
    "ast-grep": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/ast-grep/ast-grep-mcp",
        "ast-grep-server"
      ]
    }
  }
}
Cursor · .cursor/mcp.json
{
  "mcpServers": {
    "ast-grep": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/ast-grep/ast-grep-mcp",
        "ast-grep-server"
      ]
    }
  }
}
VS Code · .vscode/mcp.json
{
  "servers": {
    "ast-grep": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/ast-grep/ast-grep-mcp",
        "ast-grep-server"
      ]
    }
  }
}

Precision Code Intelligence

Textual grep breaks down when refactoring multi-line function calls or verifying deprecated hook usage across hundreds of components. ast-grep Structural Search MCP lets coding agents match real syntax nodes in TypeScript, Python, Go, and Rust.

Key Technical Benefits

  • Matches structural patterns regardless of formatting, line wraps, or variable whitespace.
  • Dramatically reduces noisy search results before large-scale codemods or migrations.
  • Runs purely locally over stdio in under 60 milliseconds per scan.

Alternative Servers in This Category

Developer Tools
Core Ecosystem

Git Local History MCP

Inspect branch diffs, blame history, and commit regressions locally offline

stdiononeopen-source
Tool Surface6 tools
Reliability Score95 / 100
1040 tok · 13,800 starsInspect config
Developer Tools
Rising Stack

Repomix Codebase Packager MCP

Token-counted repository bundler and grep-free structural context engine

stdiononeopen-source
Tool Surface6 tools
Reliability Score94 / 100
1180 tok · 16,400 starsInspect config
Developer Tools
Long-Tail Niche

Biome Lint & Format MCP

Sub-second Rust linting and import hygiene checks for TS/JS projects

stdiononeopen-source
Tool Surface3 tools
Reliability Score90 / 100
650 tok · 590 starsInspect config