AI assistants

Set up the MCP server

Connect AI editors and agents to Kubb's local MCP server. Configure Claude Desktop, Cursor, VS Code, and other MCP-capable clients to run Kubb tools directly.

Kubb ships a Model Context Protocol server that exposes code-generation tools to any MCP-capable client. Once connected, your editor or agent runs Kubb generation, validates schemas, and scaffolds configuration from the chat.

The built-in MCP server needs Kubb v5 or higher.
This page covers using Kubb tooling inside your editor over MCP. To generate an MCP server from your OpenAPI spec, see @kubb/plugin-mcp instead.

Starting the server

Run the server with one command. See kubb mcp for the stdio transport it uses.

Terminal
kubb mcp

Client configuration

Claude Desktop

Add this to your claude_desktop_config.json. On macOS it usually lives at ~/Library/Application Support/Claude/claude_desktop_config.json.

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

Cursor

Open Settings → MCP and add a new server entry.

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

VS Code (GitHub Copilot)

Add this to your .vscode/mcp.json for the workspace. For a global setup, run MCP: Open User Configuration in the Command Palette.

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

See also