Caplets Catalog
official
spiritledsoftware/caplets

ast-grep

Search, scan, test, rewrite, and scaffold ast-grep rules through curated MCP tools.

Install
caplets install spiritledsoftware/caplets ast-grep

Inspect before installing

  • Local controlThis Caplet can operate against local project or machine state.
  • Project Binding requiredThis Caplet needs a Project Binding before it can run in the intended environment.
CAPLET.md

Frontmatter

FieldValue
nameast-grep
descriptionSearch, scan, test, rewrite, and scaffold ast-grep rules through curated MCP tools.
avoidWhenPrefer ordinary text search for lexical matches and LSP for symbol references or type information.
tagsmcp, code, search
catalog.iconhttps://ast-grep.github.io/logo.svg
projectBinding.requiredtrue
mcpServer.commandnpx
mcpServer.args-y, ast-grep-mcp@latest

AST Grep

Safe Operation

  • Project Binding is required because ast-grep reads and may rewrite files in the attached repository.
  • Begin with read-only structural searches or scans, and inspect several matches to verify that a pattern selects the intended syntax.
  • Test rewrite rules against narrow targets before applying them broadly.
  • Treat apply-all rewrites, snapshot updates, and scaffolding as destructive operations. Review the pattern and target scope first.
  • Scaffolding is intended for durable ast-grep rules that belong in the project.