Kubb
🧡 The meta framework for code generation. Automate OpenAPI to type-safe TypeScript, Zod, and TanStack Query with a modular, plugin-based engine.
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
Maintainer
Works with
Installation
NPM
npx -y @kubb/mcpManual Installation
npx -y @kubb/mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 initInstall @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/cliConfigure 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"
}
}
}
}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()],
})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.
Kubb Alternatives — Similar Developer Tools Servers
Looking for alternatives to Kubb? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Kubb in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.