Skip to main content
Glama
ast-grep

ast-grep MCP Server

by ast-grep

test_match_code_rule

Test code against ast-grep YAML rules to verify pattern matching before applying to projects. Validate rule accuracy by scanning code samples.

Instructions

Test a code against an ast-grep YAML rule. This is useful to test a rule before using it in a project.

Internally calls: ast-grep scan --inline-rules --json --stdin

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to test against the rule
yamlYesThe ast-grep YAML rule to search. It must have id, language, rule fields.

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/ast-grep/ast-grep-mcp'

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