Kubb

v4.37.8Developer Toolsstable

🧡 The meta framework for code generation. Automate OpenAPI to type-safe TypeScript, Zod, and TanStack Query with a modular, plugin-based engine.

axiosclaudecodegenfakerkubb
Share:
1,722
Stars
0
Downloads
0
Weekly
0/5

What is Kubb?

Kubb is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 🧡 the meta framework for code generation. automate openapi to type-safe typescript, zod, and tanstack query with a modular, plugin-based engine.

🧡 The meta framework for code generation. Automate OpenAPI to type-safe TypeScript, Zod, and TanStack Query with a modular, plugin-based engine.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • 🧡 The meta framework for code generation. Automate OpenAPI t

Use Cases

Generate type-safe TypeScript from OpenAPI specifications.
Automate code generation with Zod and TanStack Query.
Use a modular, plugin-based engine for custom code generation.
kubb-labs

Maintainer

LicenseNOASSERTION
Languagetypescript
Versionv4.37.8
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @kubb/mcp

Manual Installation

npx -y @kubb/mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Kubb

Kubb is a meta-framework for code generation that transforms OpenAPI and Swagger specifications into type-safe TypeScript types, API clients, Zod validators, TanStack Query hooks, MSW mocks, and Faker fixtures through a modular plugin architecture. The @kubb/mcp package exposes Kubb's generation pipeline as an MCP tool, letting AI assistants like Claude trigger code generation from natural language by invoking the single `generate` tool with an OpenAPI spec path. Teams use it to eliminate manual API client boilerplate and keep generated code synchronized with their API definitions automatically.

Prerequisites

  • Node.js 18+ or Bun runtime installed
  • A kubb.config.ts configuration file in your project (run `npx kubb init` to create one interactively)
  • An OpenAPI 3.0/3.1 or Swagger 2.0 specification file
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Initialize Kubb in your project

Run the interactive kubb init wizard to create package.json entries, select plugins, and generate a kubb.config.ts in your project root.

npx kubb init
2

Install @kubb/mcp and @kubb/cli

Install the MCP server package and the CLI package (required by @kubb/mcp to invoke generation).

npm install -D @kubb/mcp @kubb/cli
# or with pnpm:
pnpm add -D @kubb/mcp @kubb/cli
# or with bun:
bun add -D @kubb/mcp @kubb/cli
3

Configure Claude Desktop

Add the @kubb/mcp server to your Claude Desktop configuration. The server reads kubb.config.ts from the specified working directory.

{
  "mcpServers": {
    "kubb": {
      "command": "npx",
      "args": ["-y", "@kubb/mcp"],
      "env": {
        "KUBB_CONFIG_PATH": "/absolute/path/to/your/project/kubb.config.ts"
      }
    }
  }
}
4

Review your kubb.config.ts

Ensure your config file specifies the input OpenAPI spec, output directory, and desired plugins (e.g., plugin-ts for types, plugin-client for API clients, plugin-zod for validators).

import { defineConfig } from '@kubb/core'
import { pluginOas } from '@kubb/plugin-oas'
import { pluginTs } from '@kubb/swagger-ts'
import { pluginClient } from '@kubb/swagger-client'

export default defineConfig({
  input: { path: './openapi.yaml' },
  output: { path: './src/generated' },
  plugins: [pluginOas(), pluginTs(), pluginClient()],
})
5

Trigger generation from Claude

Ask Claude to generate types from your OpenAPI spec. The MCP server will invoke the Kubb generate pipeline and stream progress back to the client.

Kubb Examples

Client configuration

Claude Desktop config running @kubb/mcp via npx with a config path override.

{
  "mcpServers": {
    "kubb": {
      "command": "npx",
      "args": ["-y", "@kubb/mcp"]
    }
  }
}

Prompts to try

Example prompts that trigger Kubb code generation via the MCP generate tool.

- "Generate TypeScript types from my OpenAPI spec at ./openapi.yaml"
- "Run Kubb to create TanStack Query hooks for all endpoints in the petstore spec"
- "Generate Zod validators from the API spec and output them to src/schemas/"
- "Create MSW mock handlers from my OpenAPI definition for testing"
- "Regenerate all API clients after I updated the spec file"

Troubleshooting Kubb

Error: Cannot find kubb.config.ts

Run `npx kubb init` in your project root to create the config file, or pass the explicit config path using the `config` parameter when invoking the generate tool.

Generation succeeds but output files are empty

Check that the plugins in kubb.config.ts match what you expect to generate (e.g., pluginTs for types). Also verify the `input.path` points to a valid and parseable OpenAPI/Swagger file.

'@kubb/cli' is required but not found

Install @kubb/cli in the same project as @kubb/mcp: `npm install -D @kubb/cli`. The MCP package depends on the CLI to run the generation pipeline.

Frequently Asked Questions about Kubb

What is Kubb?

Kubb is a Model Context Protocol (MCP) server that 🧡 the meta framework for code generation. automate openapi to type-safe typescript, zod, and tanstack query with a modular, plugin-based engine. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Kubb?

Install via npm with the command: npx -y @kubb/mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Kubb?

Kubb works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Kubb free to use?

Yes, Kubb is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "kubb": { "command": "npx", "args": ["-y", "@kubb/mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Kubb?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides