Skip to content
AI assistants

Set up the MCP server

Connect Claude Code, Claude Desktop, Cursor, VS Code, and other MCP clients to the Kubb MCP server, and start it in your project folder.

kubb mcp, the Kubb Model Context Protocol server, lets your editor or agent validate a spec, scaffold a kubb.config.ts, and run Kubb from the chat. Tools lists each tool.

This server runs Kubb inside your editor. To generate an MCP server from your own OpenAPI spec, use @kubb/plugin-mcp instead.

Add the server to your client

Each client starts the server with npx kubb mcp over stdio.

Run this from your project root, next to your kubb.config.ts:

Terminal
claude mcp add kubb -- npx kubb mcp

Add --scope project to write the entry to .mcp.json for your team. The Kubb Claude Code plugin registers the same server.

Start it in your project

The server looks for your config in the folder the client starts it in, then in each parent folder. Claude Code starts it in the folder you run claude from.

No config file found

The client started the server outside your project. Clients such as Claude Code ignore a cwd key, so change into the project in the command (macOS and Linux):

claude_desktop_config.json
{
  "mcpServers": {
    "kubb": {
      "command": "sh",
      "args": ["-c", "cd '/path/to/your/project' && npx kubb mcp"]
    }
  }
}

Working directory lists what the server reads and writes.