Claude Code plugin
Kubb ships a Claude Code plugin. It adds slash commands, a config
skill, and an agent that generate code from an OpenAPI spec. The commands run the kubb CLI. A
build you start in the chat matches the one you run in a terminal.
IMPORTANT
The plugin needs Kubb v5 or higher. It targets the v5 CLI and the built-in MCP server.
NOTE
This page covers the Claude Code plugin. To generate an MCP server from your spec and drive it from Claude Desktop, see the Claude MCP guide instead.
Install
The Kubb repository is also a plugin marketplace. Add it, then install the plugin:
/plugin marketplace add kubb-labs/kubb
/plugin install kubb@kubbThe commands run npx kubb, so install Kubb yourself. Install it in the project or globally:
npm install -D kubb@betaA SessionStart hook checks for kubb when a session starts. It warns you when kubb is
missing so you can install it first. It never installs anything for you.
kubb init installs the @kubb/plugin-* packages you select. Add @kubb/adapter-oas when you
want kubb validate.
Commands
The commands mirror the Kubb CLI. They are namespaced under kubb:.
| Command | What it does |
|---|---|
/kubb:init [input] [output] [plugins] | Scaffold kubb.config.ts and install plugins with kubb init. |
/kubb:generate [input] | Run kubb generate and report what changed. |
/kubb:validate <spec> | Validate an OpenAPI or Swagger spec with kubb validate. |
A typical first run:
/kubb:validate ./petStore.yaml
/kubb:init ./petStore.yaml ./src/gen plugin-ts,plugin-zod,plugin-react-query
/kubb:generateSkill and agent
The plugin ships a config skill. It teaches Claude how to author a kubb.config.ts and pick
the right @kubb/plugin-* packages. See Skills for what it covers.
The kubb-expert agent handles "add Kubb to my project" from start to finish. It validates the
spec, picks plugins, scaffolds the config, and runs generation.
Conversational generation
The plugin also wires in the Kubb MCP server (kubb mcp). Describe what you want instead of
typing a command, and Claude calls the server directly. See MCP for setup.
See also
- Skills: the Kubb AI coding skills
- MCP: connect AI editors directly to Kubb's MCP server
- Claude MCP guide: generate an MCP server from your spec