mcp
v5.29.3MCP server for Kubb. Exposes code generation as a tool over the Model Context Protocol so AI assistants like Claude, Cursor, and other MCP-compatible clients…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
kubb_generate Generate code with Kubb
Run the Kubb build from kubb.config.ts and write the generated files, such as TypeScript types, clients, hooks, schemas, and mocks, to the output directory. Use it after the OpenAPI spec, the config, or the installed extensions changed. It overwrites the generated files, and it empties the output directory first when the config sets `output.clean`, so call `kubb_diff` first to preview the changes without writing. A project needs a config before this works: create one with `kubb_init`. A config that exports an array runs only its first entry. Returns the summary `kubb generate` prints: the file…
| Parameter | Type | Description |
|---|---|---|
configPath | string | Path to the Kubb config file inside the working directory, such as ./kubb.config.ts (supports .ts, .mts, .cts, .js, .mjs, .cjs). Found automatically when omitted |
inputPath | string | Path inside the working directory, or http(s) URL on a public host, of the OpenAPI/Swagger spec. Overrides `input` in the config |
logLevel | string | Log level passed to a config that exports a function. It does not change what this tool returns |
outputPath | string | Directory inside the working directory for the generated files. Overrides `output.path` in the config |
kubb_diff Diff the generated files
Show how the generated files on disk differ from what `kubb_generate` would write now: the generated-file diff. It writes nothing, so use it to preview a generation, or to check that the generated code is in sync with the spec and the config. It does not compare two versions of an OpenAPI spec, and it is not a git diff. `full` runs `kubb generate --diff` and `summary` runs `kubb generate --check`, both with the JSON reporter. It returns the run log, the diffs, and the exit code: 0 means the files are up to date, 1 means they are out of date. `full` returns a unified diff for each out-of-date f…
| Parameter | Type | Description |
|---|---|---|
configPath | string | Path to the Kubb config file inside the working directory, such as ./kubb.config.ts (supports .ts, .mts, .cts, .js, .mjs, .cjs). Found automatically when omitted |
format | string | `full` returns the unified diff of every out-of-date file, cut at about 30,000 characters. `summary` returns one line per file with its added and removed line counts, for a large API |
lockfile | boolean | Read kubb-lock.json. Set to false to compare with the generated text alone |
kubb_validate Validate an OpenAPI spec
Validate an OpenAPI or Swagger specification from a file path or URL. Use it before `kubb_init` or `kubb_generate` to confirm that Kubb can read the spec, or to find out why a generation failed on its input. It only reads the spec: it writes no files and does not read kubb.config.ts, so it does not check the config or the plugins. The spec must be a file inside the working directory or a URL on a public host, and a `$ref` may read local files only inside the working directory. Returns a success line, or an error with each diagnostic as text and JSON: its code, location, cause, fix, and docs li…
| Parameter | Type | Description |
|---|---|---|
inputPath * | string | Path inside the working directory, or http(s) URL on a public host, of the OpenAPI/Swagger specification, such as ./openapi.yaml or https://petstore3.swagger.io/api/v3/openapi.json |
kubb_init Create a Kubb config
Create a kubb.config.ts with an empty plugins array in the working directory, without prompts. Use it once, to set up Kubb in a project that has no Kubb config yet. Do not use it to change an existing config: it returns an error when kubb.config.ts exists, and it never overwrites one. It installs no packages and adds no plugins, so call `kubb_add` for each plugin afterwards, then `kubb_generate`. Returns the name of the file it created and the next steps.
| Parameter | Type | Description |
|---|---|---|
inputPath | string | Path inside the working directory, or http(s) URL, of the OpenAPI spec, written to the config as `input` (default: ./openapi.yaml) |
outputPath | string | Directory inside the working directory for the generated files, written to the config as `output.path` (default: ./src/gen) |
kubb_add Add a Kubb extension
Install a plugin, adapter, or parser from the Kubb registry at the version the registry pins, and add it to kubb.config.ts with the plugins it needs. Use it to add a generator to a project, such as plugin-ts for types or plugin-zod for schemas, after `kubb_init` or when the user asks for a new kind of output. Do not use it to upgrade an extension that is already installed (use `kubb_update`), and it does not generate code: call `kubb_generate` afterwards. Runs `kubb add <id> --yes` and returns the CLI output and exit code. An adapter is not written to the config: the output holds a snippet to…
| Parameter | Type | Description |
|---|---|---|
extensionId * | string | Registry id of the extension: owner/slug, such as kubb-labs/plugin-zod, or a slug such as plugin-zod for an official extension |
configPath | string | Path to the Kubb config file inside the working directory, such as ./kubb.config.ts (supports .ts, .mts, .cts, .js, .mjs, .cjs). Found automatically when omitted |
dryRun | boolean | Preview the change without installing packages or writing files |
install | boolean | Install the package. Set to false to only edit the config |
kubb_update Update Kubb extensions
Update installed Kubb extensions to the versions the registry pins. Use it after `kubb_list` reports available updates, or when the user asks to upgrade Kubb plugins. Without `extensionIds` it updates every installed extension but skips major updates: a major update is installed only for an extension named in `extensionIds`. Do not use it to install an extension that is not in the project yet (use `kubb_add`). Runs `kubb update --yes` and returns the CLI output and exit code, with a summary of what was installed. It does not regenerate: call `kubb_generate` afterwards to update the generated f…
| Parameter | Type | Description |
|---|---|---|
dryRun | boolean | Preview the change without installing packages or writing files |
extensionIds | array | Registry ids to update. Updates every installed extension when omitted, but installs a major update only for an extension named here |
kubb_remove Remove a Kubb extension
Remove a plugin or parser from kubb.config.ts and uninstall its package. Use it when the user no longer wants the code that extension generates. It edits the config and package.json without asking, so call it with `dryRun` first when the user did not name the extension. It does not delete the files the extension generated: call `kubb_generate` afterwards, which removes them when the config sets `output.clean`. Do not use it to change the version of an extension (use `kubb_update`). Runs `kubb remove <id> --yes` and returns the CLI output and exit code.
| Parameter | Type | Description |
|---|---|---|
extensionId * | string | Registry id of the extension: owner/slug, such as kubb-labs/plugin-zod, or a slug such as plugin-zod for an official extension |
configPath | string | Path to the Kubb config file inside the working directory, such as ./kubb.config.ts (supports .ts, .mts, .cts, .js, .mjs, .cjs). Found automatically when omitted |
dryRun | boolean | Preview the change without installing packages or writing files |
uninstall | boolean | Uninstall the package. Set to false to only edit the config |
kubb_list List Kubb extensions
List the Kubb extensions installed in the project, with the installed version of each and the update the registry offers. Use it to find the registry id to pass to `kubb_update` or `kubb_remove`, or to check what a project generates before changing its config. It only reads: it installs nothing and changes no file. It lists installed extensions only, so it cannot search the registry for extensions to add. Runs `kubb list` and returns the CLI output and exit code.