guidance-ai avatar

Guidance Lark Mcp

guidance-ai/guidance-lark-mcp

Validates and tests llguidance grammars in Lark format, giving you a tight feedback loop for building structured output constraints. Exposes four tools: validate_grammar checks completeness with llguidance's validator, run_batch_validation_tests runs JSON test suites against your grammar with pass/fail stats, get_llguidance_documentation fetches syntax docs, and generate_with_grammar (optional) calls OpenAI's grammar-constrained generation API. Works with OpenAI, Azure OpenAI, or custom endpoints. You write a grammar, build a test file with inputs and expected parse outcomes, batch test, fix failures, repeat. Includes a complete GraphQL example. Good for iteratively developing parsers with an AI assistant or validating that your structured output specs actually work before deploying them.

tools
4
transport
STDIO
last updated
Mar 6, 2026

Tools

4 tools

Public tool metadata for what this MCP can expose to an agent.

validate_grammarValidate grammar completeness and consistency using llguidance's built-in validator.

Validate grammar completeness and consistency using llguidance's built-in validator.

No parameter schema in public metadata yet.

run_batch_validation_testsRun batch validation tests from a JSON file against a grammar. Returns pass/fail statistics and detailed failure info.

Run batch validation tests from a JSON file against a grammar. Returns pass/fail statistics and detailed failure info.

No parameter schema in public metadata yet.

get_llguidance_documentationFetch the llguidance grammar syntax documentation from the official repo.

Fetch the llguidance grammar syntax documentation from the official repo.

No parameter schema in public metadata yet.

generate_with_grammarGenerate text using an OpenAI model constrained by a grammar. Uses the Responses API with custom tool grammar format, so output is guaranteed to conform to the grammar.

Generate text using an OpenAI model constrained by a grammar. Uses the Responses API with custom tool grammar format, so output is guaranteed to conform to the grammar.

No parameter schema in public metadata yet.

Sponsors

Readme

MCP Grammar Tools

MCP server for validating and testing llguidance grammars (Lark format). Provides grammar validation, batch test execution, and syntax documentation — ideal for iteratively building grammars with AI coding assistants.

Installation

With uvx (recommended)

uvx guidance-lark-mcp

With pip

pip install guidance-lark-mcp

From source

cd mcp-grammar-tools
pip install -e .

MCP Client Configuration

GitHub Copilot CLI

You can add the server using the interactive /mcp add command or by editing the config file directly. See the Copilot CLI MCP documentation for full details.

Option 1: Interactive setup

In the Copilot CLI, run /mcp add, select Local/STDIO, and enter uvx guidance-lark-mcp as the command.

Option 2: Edit config file

Add the following to ~/.copilot/mcp-config.json:


View the full README on GitHub

Details

Repository
github.com/guidance-ai/guidance-lark-mcp
Package
guidance-lark-mcp
Transport
STDIO
Registry
MCP registry, active