Authoring With AI¶
A companion Claude Code skill writes a config from a plain-language request. Two commands then check what the config exposes and what it does for a model.
Generating a Config¶
generate-config is a Claude Code skill that writes a config.yml for an API you name. It finds the OpenAPI spec, picks the operations and auth, adds shaping where a raw operation makes a poor tool, and checks that the config boots. This repository is also its plugin marketplace. Install the plugin from inside Claude Code:
/plugin marketplace add mroops0111/openapi-mcp-gateway
/plugin install openapi-mcp-gateway@openapi-mcp-gateway
Then invoke the skill by its namespaced name, with your request:
Claude Code also invokes the skill without the command when you ask for an API to be connected as MCP.
Inspecting a Config¶
--dry-run validates a config and prints what it would expose, without serving:
✓ Valid 1 server(s), 1 tool(s), 102 resource(s)
transport streamable-http
pokeapi
mount /pokeapi
...
Read the tool names and the SHAPING column to confirm the generated config exposes what you asked for. Dry Run describes the full output and its JSON form.
Measuring a Config¶
The eval command measures what your config does for a model, on tasks you write for your API. It needs the eval extra, and no real API is called. Start with check, which calls no model:
uvx --from 'openapi-mcp-gateway[eval]' openapi-mcp-gateway eval check \
--task-file tasks.yaml --config config.yml
check proves each task's solution passes, and lists the tasks your config cannot reach. Then run runs the tasks with a model:
uvx --from 'openapi-mcp-gateway[eval]' openapi-mcp-gateway eval run \
--task-file tasks.yaml --config config.yml \
--model anthropic:claude-haiku-5-5
run runs check first, and calls no model if a solution fails. It then prints how many runs it will make, since each one is billed. It compares your config with one tool per operation, the baseline, and reports success, tokens, tool calls, extra writes and cost. Two flags widen the comparison.
- Several Configs: name each, as
--config shaped=shaped.yml --config plain=plain.yml. Every config must serve the same servers from the same specs. - Other Comparisons:
--against dynamicadds dynamic exposure,--against tool-searchadds Pydantic AI's tool search, and--against noneruns your configs alone. Repeat the flag for several.
The model needs its provider's API key in the usual variable, such as ANTHROPIC_API_KEY. A run keeps only what a model sees from each config, its exposure, policy, operations and instructions. The upstream credential and the MCP sign-in are left out, so operation scopes are not measured. Evaluation shows results on public APIs.
Tasks File¶
The tasks file holds the tasks and the settings every run over them shares.
# Optional, the benchmark's own prompt by default.
system_prompt: You keep the shop's product records.
# Optional, by server, operations that only read though they POST.
read_only_operations:
shop: ['POST /products/search']
tasks:
- id: discontinued
prompt: Product 7 was discontinued, take it off the list.
expected_calls:
- server: shop
method: DELETE
path: '/products/{productId}'
path_parameters: {productId: '7'}
solution:
- server: shop
operation: delete_product
arguments: {productId: 7}
upstream_responses:
- server: shop
method: GET
path: /products
body: [{id: 7, name: Canvas tote}]
idandprompt: the task's name in the report, and what the user asks.expected_calls: the writes a run must make. Each names itsserver,methodandpath, a template or a concrete path, and thepath_parameters,queryandbodyvalues it must carry, leaving the rest free.any_oflists alternatives of which any one counts, andall_ofa change split across requests. Reads are never graded.forbidden_calls: optional, requests that fail the task when made.upstream_responses: optional, what a read is answered with. A read none matches gets the spec's example or a sample of its schema, and the report lists the failed runs that read one, which shows where data is missing.solution: optional, calls known to pass, each an operation as the baseline names it with its arguments.checkandrunreplay them before any model runs.
Related¶
The skill writes fields the exposure and shaping guides explain, and the evaluation page reports how its configs perform.
- Guides: Exposure for the
policyandexposurefields the skill sets and Tool Shaping for thetoolblocks it adds - Concepts: Evaluation for how generated configs perform on public APIs
- Reference:
evalCommand for every flag ofeval checkandeval run