Open Studio
AI

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.

Important

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

Note

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
shell
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
json
{
  "mcpServers": {
    "kubb": {
      "command": "npx",
      "args": ["kubb", "mcp"]
    }
  }
}

Cursor ​

Open Settings → MCP and add a new server entry.

Cursor
json
{
  "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
json
{
  "servers": {
    "kubb": {
      "command": "npx",
      "args": ["kubb", "mcp"]
    }
  }
}

See also ​