Skip to content
AI assistants

Set up the Claude Code plugin

Install the Kubb Claude Code plugin to get /kubb slash commands, the kubb-expert agent, two skills, and the Kubb MCP server in Claude Code.

The Kubb plugin for Claude Code adds slash commands, an agent, two skills, and the Kubb MCP server. The commands run the kubb CLI, so a build from the chat matches one from the terminal.

Install the plugin

Add the Kubb repository as a plugin marketplace, then install the plugin:

Terminal
/plugin marketplace add kubb-labs/kubb
/plugin install kubb@kubb

Install Kubb

The commands run npx kubb, so install Kubb in the project or globally:

Terminal
npm install -D kubb

A SessionStart hook warns you when kubb is missing. It never installs anything.

Commands

CommandRuns
/kubb:init [input] [output] [plugins]kubb init with --yes, to write kubb.config.ts and install the plugins.
/kubb:generate [input]kubb generate, then reports what changed.
/kubb:validate <spec>kubb validate on an OpenAPI or Swagger spec.

A first run:

Claude Code
/kubb:validate ./petStore.yaml
/kubb:init ./petStore.yaml ./src/gen plugin-ts,plugin-axios,plugin-zod,plugin-react-query
/kubb:generate

Agent and skills

The kubb-expert agent handles "add Kubb to my project": it validates the spec, picks plugins, scaffolds the config, and runs Kubb. Two skills load on their own:

SkillLoads when you
configWrite a kubb.config.ts, pick @kubb/plugin-* packages, or debug generated output.
outputWrite app or test code that imports the generated types, clients, hooks, schemas, and mocks.

Generate from a conversation

The plugin registers the Kubb MCP server (npx kubb mcp). Describe what you want, and Claude calls the server's tools or runs the matching /kubb: command. Start Claude Code from your project root, so the server finds your kubb.config.ts.

When kubb.config.ts exports an array, the MCP kubb_generate tool runs only its first config. The /kubb:generate command runs them all.

Set up the MCP server covers other clients.