ast-grep

ast-grep

ast-grep is a fast and polyglot tool for code structural search, lint, rewriting at large scale.

930

1 Tool

Packaged by
Requires Configuration
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

About

ast-grep MCP Server

ast-grep is a fast and polyglot tool for code structural search, lint, rewriting at large scale.

What is an MCP Server?

Characteristics

AttributeDetails
Docker Imagemcp/ast-grep
Authordgageot
Repositoryhttps://github.com/dgageot/mcp-ast-grep
Dockerfilehttps://github.com/dgageot/mcp-ast-grep/blob/main/Dockerfile
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/ast-grep --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceApache License 2.0

Available Tools (1)

Tools provided by this ServerShort Description
ast-grepSearch codebases using ast-grep patterns

Tools Details

Tool: ast-grep

Search codebases using ast-grep patterns for straightforward structural matches. (returns json)

ParametersTypeDescription
patternstringThe ast-grep pattern to search for. Note, the pattern must have valid AST structure.
dirstringoptionalThe directory to search in. If not specified, will use the current working directory.
langstringoptionalThe language of the code. If not specified, will be auto-detected based on file extensions.

This tool is read-only. It does not modify its environment.

This tool may perform destructive updates.

This tool interacts with external entities.


Use this MCP Server

{
  "mcpServers": {
    "ast-grep": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/local-directory:/local-directory",
        "mcp/ast-grep"
      ]
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Manual installation

You can install the MCP server using:

Installation for