Skip to content

MCP

Kubb ships a Model Context Protocol server that exposes code-generation tools to any MCP-capable client. Once connected, your editor or agent can trigger Kubb generation, validate schemas, and inspect configuration without leaving the chat.

IMPORTANT

The built-in MCP server requires Kubb v5 or higher.

NOTE

This page covers consuming Kubb tooling inside your editor via MCP. If you want to generate an MCP server from your OpenAPI spec, see @kubb/plugin-mcp instead.

Starting the server

Run the MCP server over stdio with a single command:

shell
kubb mcp

The server communicates over stdio, the transport all major LLM clients use.

Client configuration

Claude Desktop

Add the following to your claude_desktop_config.json (usually at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

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

Cursor

Open Settings → MCP and add a new server entry:

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

VS Code (GitHub Copilot)

Add the following to your .vscode/mcp.json (workspace) or run MCP: Open User Configuration in the Command Palette for a global setup:

.vscode/mcp.json
json
{
  "servers": {
    "kubb": {
      "command": "npx",
      "args": ["kubb", "mcp"]
    }
  }
}

See also