Skip to content

Using laqi with AI agents

laqi mcp runs a Model Context Protocol server over stdio. An agent building a screen can create the endpoint it needs, flip a response, or activate a scenario — the same actions the panel does, called directly, with no file open and no terminal command explained to it first.

A typed tool call is a stronger interface for an agent than prose docs: it arrives with a schema, gets validated before it runs, and never has to be found and interpreted the way a paragraph of documentation does. If your agent reads about laqi anywhere else, point it at laqi mcp first — it can write mock files by hand, or it can call create_endpoint and never get the shape wrong.

Point your agent at the project directory — the server operates on the mock files there, so it works whether or not laqi is currently running as a server.

{
"mcpServers": {
"laqi": {
"command": "npx",
"args": ["laqi", "mcp"],
"cwd": "<your-project>"
}
}
}

In Claude Code this goes in .mcp.json at your project root. Cursor uses the same shape.

ToolWhat it does
list_endpointsEvery endpoint, its responses, and which one is live right now with the layer that decided it. Call this before create_endpoint so you extend a route instead of duplicating it.
get_stateWhat is currently overridden and why — the active scenario, per-endpoint overrides, and which endpoints aren’t on their file default.
set_responseMake an endpoint serve a specific named response right now, no file edit. Pass null to clear the override.
set_scenarioActivate a named scenario, moving every endpoint it covers at once. Pass null to deactivate. Only one scenario is active at a time.
reset_stateClear every override and deactivate the active scenario — back to file defaults, in one call.
create_endpointAdd a new mock endpoint and write it to the project’s mock files. Pair with generate_data for a realistic body instead of hand-written values.
update_endpointReplace an existing endpoint’s whole definition — add a response, edit a body, change the default.
delete_endpointRemove an endpoint and drop any override pointing at it.
scaffold_responsesAdd the responses an endpoint probably needs and does not have — the happy path plus the standard failures for its method and path shape. Only ever adds; existing bodies are untouched.
import_openapiTurn an OpenAPI 3.x document into mock endpoints in one call, generating example bodies from its schemas, instead of create_endpoint per route.
get_typesDerive a data model from a live response body, in any supported language — see Realistic data and types.
generate_dataGenerate a realistic body from a pasted TypeScript model, or regenerate from an existing response’s shape. Same seed, same output.
regenerate_responseGenerate a fresh body from the JSON Schema a response already carries. Returns a preview and the revision it was generated against, and writes nothing — pass both to apply_generated_body to keep it.
apply_generated_bodyWrite a previewed body to a response, together with the evidence that reproduces it. Refused if the response changed since the preview, or if the body being replaced is one laqi did not generate.
refresh_schemaRe-read the file a response’s schema was imported from and store the new version. The body is left alone — regenerating it is a separate, visible step.

The table above is a human-facing summary. The authoritative descriptions are the ones the running server hands your agent at tools/list time: they carry the exact argument shapes and edge cases — set_response’s beats-a-scenario precedence, import_openapi’s overwrite behavior, update_endpoint being a full replacement rather than a patch. Read those from your agent’s tool list rather than from here.

If you are an LLM and this page is the only laqi documentation you have seen, the two facts that matter most: mock files are plain JSON (see Mock files), and every write you would otherwise do by hand — creating a route, flipping a response, activating a scenario — has a corresponding MCP tool above. Prefer the tool call.

A plain-text summary of this whole site, meant for pasting into a context window, is at /llms.txt — linked from the footer of the homepage.