Skip to main content
Glama
thrawn01

ast-grep MCP Server

by thrawn01

Server Quality Checklist

75%
Profile completionA complete profile improves this server's visibility in search results.
  • Latest release: v1.0.0

  • Disambiguation5/5

    With only one tool, there is no risk of confusion or overlapping purposes. The tool's description is clear and distinct by default.

    Naming Consistency5/5

    A single tool name provides no opportunity for inconsistency. The naming is trivially consistent.

    Tool Count3/5

    One tool is borderline for a server that claims to handle both search and refactoring across many languages. While the tool may be comprehensive, a single tool feels thin compared to typical servers with 3-15 tools.

    Completeness3/5

    The tool covers search and transformations, which are the core operations. However, there may be missing capabilities like pattern management or language-specific configurations, leading to notable gaps.

  • Average 3.3/5 across 1 of 1 tools scored.

    See the Tool Scores section below for per-tool breakdowns.

    • No community issues in the last 6 months
    • 0 commits in the last 12 weeks
    • No stable releases found
    • No critical vulnerability alerts
    • No high-severity vulnerability alerts
    • No code scanning findings
    • CI status not available
  • This repository is licensed under MIT License.

  • This repository includes a README.md file.

  • Tools from this server were used 1 time in the last 30 days.

  • Add a glama.json file to provide metadata about your server.

  • If you are the author, simply .

    If the server belongs to an organization, first add glama.json to the root of your repository:

    {
      "$schema": "https://glama.ai/mcp/schemas/server.json",
      "maintainers": [
        "your-github-username"
      ]
    }

    Then . Browse examples.

  • Add related servers to improve discoverability.

How to sync the server with GitHub?

Servers are automatically synced at least once per day, but you can also sync manually at any time to instantly update the server profile.

To manually sync the server, click the "Sync Server" button in the MCP server admin interface.

How is the quality score calculated?

The overall quality score combines two components: Tool Definition Quality (70%) and Server Coherence (30%).

Tool Definition Quality measures how well each tool describes itself to AI agents. Every tool is scored 1–5 across six dimensions: Purpose Clarity (25%), Usage Guidelines (20%), Behavioral Transparency (20%), Parameter Semantics (15%), Conciseness & Structure (10%), and Contextual Completeness (10%). The server-level definition quality score is calculated as 60% mean TDQS + 40% minimum TDQS, so a single poorly described tool pulls the score down.

Server Coherence evaluates how well the tools work together as a set, scoring four dimensions equally: Disambiguation (can agents tell tools apart?), Naming Consistency, Tool Count Appropriateness, and Completeness (are there gaps in the tool surface?).

Tiers are derived from the overall score: A (≥3.5), B (≥3.0), C (≥2.0), D (≥1.0), F (<1.0). B and above is considered passing.

Tool Scores

  • Behavior3/5

    Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

    With no annotations provided, the description carries full burden for behavioral disclosure. It explains the core behavior (syntax-aware, cross-language), but fails to mention important traits: whether it modifies files outside dry_run, error handling when pattern doesn't match anything, or performance implications on large codebases. It does highlight AST-based operation and 20+ language support, which adds some valuable behavioral context beyond the schema.

    Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

    Conciseness4/5

    Is the description appropriately sized, front-loaded, and free of redundancy?

    The description is two dense sentences (44 words) with no fluff. Every phrase adds value: 'AST-based,' '20+ programming languages,' 'syntax-aware,' 'pattern matching and transformations.' It's front-loaded with the most critical differentiator ('AST-based'). Minor deduction for not including a brief usage scenario or caveat, but overall very concise.

    Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

    Completeness3/5

    Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

    Given 9 parameters, 3 operation modes (mode enum), and no output schema, the description is moderately complete. It covers the what and general how (AST pattern matching, cross-language) but misses when-not-to-use, output format expectations (e.g., returns matches with line numbers?), and side effects like file modification in replace mode. For a complex code transformation tool, an agent would benefit from knowing that ast-grep uses Tree-sitter grammars for parsing, which is not mentioned.

    Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

    Parameters4/5

    Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

    Schema description coverage is 100% (all 9 parameters have descriptions), but the tool description adds contextual meaning beyond those individual definitions. It explains the overarching purpose (AST-based, structural matching) which helps an agent understand that parameters like 'pattern' use ast-grep's special syntax (e.g., '$MSG', '$$$BODY') – a concept not fully explained in the pattern parameter's own description. This cross-parameter justification earns a high score.

    Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

    Purpose4/5

    Does the description clearly state what the tool does and how it differs from similar tools?

    The description clearly states it's an 'AST-based code search and refactoring tool' that 'understands code structure across 20+ programming languages' and performs 'syntax-aware pattern matching and transformations.' This is specific, uses a verb+resource structure, and distinguishes it from simple grep-like tools. However, it doesn't differentiate it from sibling tools because none are listed.

    Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

    Usage Guidelines2/5

    Does the description explain when to use this tool, when not to, or what alternatives exist?

    The description provides no guidance on when or when not to use this tool, nor does it mention any alternatives. It gives a general functional overview but lacks explicit context signals like prerequisites (e.g., project root setup) or situations where regex might be preferred over AST matching. Some usage context is implied through the parameter enum 'mode' (search/replace/count), but the description itself says nothing about usage boundaries.

    Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

GitHub Badge

Glama performs regular codebase and documentation scans to:

  • Confirm that the MCP server is working as expected.
  • Confirm that there are no obvious security issues.
  • Evaluate tool definition quality.

Our badge communicates server capabilities, safety, and installation instructions.

Card Badge

mcp-ast-grep MCP server

Copy to your README.md:

Score Badge

mcp-ast-grep MCP server

Copy to your README.md:

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thrawn01/mcp-ast-grep'

If you have feedback or need assistance with the MCP directory API, please join our Discord server