# ast-grep

> Use this tool when you need to find code patterns in projects using abstract syntax tree matching, solving problems such as code analysis, pattern matching, and refactoring tasks. It accepts a pattern, project folder, and optional language parameter as input, and returns the results as structured JSON. This tool is ideal for developers who want to leverage AI assistants for code analysis without leaving their development environment.

Canonical page: https://skillsregistry.net/skills/ast-grep  
JSON: https://api.skillsregistry.net/v1/skills/ast-grep

## Description

ast-grep MCP provides a bridge to the ast-grep code search tool, enabling AI assistants to find code patterns in projects using abstract syntax tree matching. The implementation exposes a single tool that accepts a pattern, project folder, and optional language parameter, then executes the ast-grep CLI command and returns the results as structured JSON. This server is particularly valuable for developers who want to leverage AI assistants for code analysis, pattern matching, and refactoring tasks without leaving their development environment.

## Trust

- **Trust score (0–1):** 0.50
- **Verification tier:** unverified

## Facts

- **Version:** 1.0.0
- **Skill type:** atomic
- **Execution layer:** mcp-remote
- **Runtime environment:** api
- **Category:** productivity
- **Updated:** 2026-05-27

## Source

- **Source listing:** [PulseMCP](https://www.pulsemcp.com/servers/ast-grep)
- **Repository:** <https://github.com/ast-grep/ast-grep-mcp>

## Use it

Resolve this record through the SkillsRegistry MCP server (no auth, read-only):

```
claude mcp add --transport http --scope user skillsregistry https://api.skillsregistry.net/mcp
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_skill",
    "arguments": {
      "slug": "ast-grep"
    }
  }
}
```

REST: `GET https://api.skillsregistry.net/v1/skills/ast-grep` · pull for local use: `GET https://api.skillsregistry.net/v1/skills/ast-grep/pull`

---
SkillsRegistry indexes agent skills from public registries and GitHub. Skills we have analysed are scanned with Circle-IR and scored on six dimensions; each listing states its scan coverage. More: https://skillsregistry.net/llms.txt
