Ast Grep MCP Server

An experimental [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides AI assistants with powerful structural code

Local serverstdioPython

What is the Ast Grep MCP MCP server?

If you want an AI assistant working directly with Ast Grep MCP, the ast grep mcp mcp server is the bridge. An experimental Model Context Protocol (MCP) server that provides AI assistants with powerful structural code search capabilities using ast-grep.

What Ast Grep MCP does

An experimental Model Context Protocol (MCP) server that provides AI assistants with powerful structural code search capabilities using ast-grep.

This MCP server enables AI assistants (like Cursor, Claude Desktop, etc.) to search and analyze codebases using Abstract Syntax Tree (AST) pattern matching rather than simple text-based search. By leveraging ast-grep's structural search capabilities, AI can:

Installing the ast grep mcp mcp server

Setup follows the standard MCP pattern: clone or install the server, then register it in your client's configuration file and restart the client. The configuration snippets on this page cover Claude Desktop, Claude Code and Cursor.

Requirements

  1. Install ast-grep: Follow ast-grep installation guide 2. Install uv: Python package manager 3. MCP-compatible client: Such as Cursor, Claude Desktop, or other MCP clients

Where it fits

Developer-tool servers are usually the first ones people connect, because they turn "help me with this code" into an assistant that can actually read the repo and act on it. Ast Grep MCP sits in that group. Worth comparing against the other developer tools servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.

Practical notes

  • This server runs locally, so it operates with whatever access your machine and its credentials already have. Scope that deliberately rather than by default.
  • Maintained by ast-grep, written in Python.
  • MCP clients ask for confirmation before each tool call by default. Keep that on while you learn what the ast grep mcp mcp server actually does with your data.
  • Every entry in this directory is reviewed by hand before it goes live, and details are checked against the project's own documentation.

Configuration

  1. Install ast-grep: Follow ast-grep installation guide 2. Install uv: Python package manager 3. MCP-compatible client: Such as Cursor, Claude Desktop, or other MCP clients

Frequently asked questions

It connects Ast Grep MCP to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Ast Grep MCP directly.