Kubb plugin
Claude Code plugin for Kubb: turns an OpenAPI spec into TypeScript types, clients, Query hooks, Zod schemas and mocks, with commands and an MCP server
- 1,825 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The commands and MCP server run `kubb.config.ts` as code, and `kubb init` installs `@kubb/plugin-*` packages from npm
- Generation writes files into the project and, with `output.clean: true`, wipes the output folder before every run
- A spec can be pulled from a URL, and the skill advises validating untrusted ones with `kubb validate`
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add plugins/kubbDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The commands and MCP server run `kubb.config.ts` as code, and `kubb init` installs `@kubb/plugin-*` packages from npm
- Generation writes files into the project and, with `output.clean: true`, wipes the output folder before every run
- A spec can be pulled from a URL, and the skill advises validating untrusted ones with `kubb validate`
This is third-party code. Review the repository files before installing.
What it does
Kubb reads an OpenAPI 2.0, 3.0 or 3.1 spec and generates TypeScript code from it: types, Axios or Fetch clients, TanStack Query, Vue Query and SWR hooks, Zod schemas, Faker mocks and MSW handlers. The `@kubb/plugin-*` packages decide which files are produced, and the rules live in `kubb.config.ts`. When the spec changes, the code is rebuilt. The repository ships a ready plugin for Claude Code. `/kubb:init` writes the config and installs the packages it needs, `/kubb:validate` checks the spec, and `/kubb:generate` runs generation and reports which files changed. The `config` skill teaches the agent to write `kubb.config.ts` and pick plugins, while the `output` skill explains how to import the generated clients and hooks. The `kubb-expert` subagent walks the whole path from spec to working code. The plugin also wires in an MCP server started with `npx kubb mcp`. It has three tools: `generate` builds code from the config, `validate` checks the spec and `init` creates the config. The same server connects to Cursor and Claude Desktop.
Who it is for. For frontend and backend TypeScript developers who have an OpenAPI or Swagger spec and want typed clients, hooks and mocks without writing them by hand.
Good fit when
- The backend publishes an OpenAPI spec as a file or URL, and you want frontend types and clients generated from it
- A React, Vue or Solid project needs TanStack Query or SWR hooks for every API method
- Tests need Faker mocks and MSW handlers that match the API schema
- Response data should be checked at runtime with Zod schemas generated from the same spec
- You want the agent to add Kubb to the project, pick the plugins and run generation
Not a fit when
- The project is not in TypeScript: Kubb only produces TypeScript code
- The API has no OpenAPI or Swagger spec, so Kubb has nothing to read
- You need to call an API from the agent without generating code: `openapi-to-cli-ocli` turns a spec into CLI commands on the fly
- You do not use Claude Code: the plugin and commands target it, and Cursor or Claude Desktop get only the MCP server
Example request
Add Kubb to the project, take the spec from ./openapi.yaml and generate TypeScript types and TanStack Query hooks into src/genLimitations
- The plugin needs Kubb version 5 or newer. It does not install Kubb itself: the commands run `npx kubb`, so the `kubb` package must be in the project or global, and the session-start hook only warns when it is missing.
- `kubb validate` works only with `@kubb/adapter-oas` installed, and `kubb init` installs the `@kubb/plugin-*` packages you pick.
- The MCP server looks for `kubb.config.*` in the folder where the client started it and rejects a config path outside it. Claude Code ignores the `cwd` key, so register the server from the project root. The `@kubb/mcp` package needs Node.js 22.12 or newer.
- Files carrying the Do not edit manually banner are rewritten on every run, so hand edits in them are lost.
- MIT license. The Kubb Studio visual panel is optional, and the tool works fully without it.
How to disable. Remove the plugin with `/plugin uninstall kubb@kubb` and the `/kubb:*` commands, skills and subagent disappear. For an MCP server you added by hand, run `claude mcp remove kubb`. Generated files and `kubb.config.ts` stay in the project, and your package manager removes the `kubb` package.
FAQ
Which OpenAPI versions does Kubb understand?
The `@kubb/adapter-oas` adapter reads OpenAPI 2.0, 3.0 and 3.1 specs. The source is a local file or a URL, and both go into the `input` field of the config.
What does Kubb generate?
It depends on the packages you add: `plugin-ts` gives types, `plugin-axios` and `plugin-fetch` clients, `plugin-react-query`, `plugin-vue-query` and `plugin-swr` hooks, `plugin-zod` schemas, `plugin-faker` and `plugin-msw` mocks and handlers. There are also `plugin-cypress`, `plugin-redoc` and `plugin-mcp`, which builds an MCP server from the same spec.
How do I connect the Kubb MCP server to Cursor or Claude Desktop?
Add the entry `{"mcpServers": {"kubb": {"command": "npx", "args": ["kubb", "mcp"]}}}` to the MCP settings. If `kubb` is not installed in the project, the standalone package works too: `npx @kubb/mcp`. Both start the same server over stdio.
How do I run generation as part of the app build?
The `unplugin-kubb` package runs generation inside the bundler: Vite, Nuxt, Astro, webpack and others are supported. The Claude Code plugin commands are not needed for that.
What does the kubb-expert subagent do?
It takes the task end to end: finds the spec and output folder, validates the spec, picks the `@kubb/plugin-*` packages, creates the config with `kubb init`, runs `kubb generate` and type-checks the generated code. It is told never to edit output files by hand.
Can I write my own generators?
Yes. The `kubb/kit` toolkit is meant for custom plugins, generators, adapters and renderers, and the JSX renderer builds output from components.
Discussion
No questions or reviews yet.
Related
PluginsA ready-made Claude Code setup: agents, slash commands, skills, safety hooks, rules and MCP connections in one install
A modular plugin set for Claude Code: skills, agents, commands and rules for Java, TypeScript, Python, PHP and AWS
Claude Code plugins with development recipes: agree on the outcome, design, implement with checks and run an independent review
A universal workflow plugin for Claude Code: 7 agents, 26 commands, 14 skills and 14 hooks for any project
A plugin with skills for building TypeScript MCP servers and MCP apps: the agent scaffolds, edits, debugs and verifies them
A large Claude Code and Cursor plugin: development skills, specialist agents and hooks with quality gates and git protection
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Repository stars | Main difference |
|---|---|---|---|
| Kubb (this entry) | yes | 1,825 | |
| OpenAPI to CLI (ocli) | no | 265 | generates no code: turns a spec into CLI commands on the fly and searches endpoints with BM25 |
| Orval skill for agents | yes | 6,556 | the official Orval skill |
README in short
The repository front page covers installing the `kubb` package, the `npx kubb init` wizard and the `npx kubb generate` command, then lists the features and packages. Individual package pages, `@kubb/mcp` among them, show setup for different clients. The `tools/claude` folder holds the Claude Code plugin with install and usage notes, a changelog and a check that `kubb` is present at session start. The repository includes the source of all packages with tests.