Open Studio
Commands

kubb mcp

The mcp command starts a Model Context Protocol server so LLM clients can interact with your schemas and trigger generation.

Run kubb mcp to start a Model Context Protocol server. LLM clients such as Claude, Cursor, and VS Code can then read your schemas and trigger generation.

Warning

This feature is under active development. Use it with caution and expect breaking changes.

kubb mcp

Usage ​

Start the MCP server over stdio, the transport every major LLM client speaks:

Terminal
shell
kubb mcp

Tools ​

The MCP server exposes three tools to connected clients.

ToolDescription
generateRuns the Kubb pipeline against a resolved kubb.config.ts and streams log messages back to the client.
validateValidates an OpenAPI or Swagger document at a path or URL. Needs @kubb/adapter-oas installed in the project.
initScaffolds a kubb.config.ts in the current directory without prompts. It does not install packages.

Example ​

Most MCP clients accept a JSON config with command and args. Register the Kubb MCP server over stdio:

mcp.json
json
{
  "mcpServers": {
    "kubb": {
      "command": "npx",
      "args": ["kubb", "mcp"]
    }
  }
}

See also ​