🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@kubb/mcp

Package Overview
Dependencies
Maintainers
1
Versions
618
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubb/mcp

MCP 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 can generate TypeScript types, clients, and more.

Source
npmnpm
Version
5.0.0-beta.71
Version published
Weekly downloads
6K
43.76%
Maintainers
1
Weekly downloads
 
Created
Source
Kubb banner

npm version npm downloads Stars License Node

Documentation · Report Bug · Request Feature


@kubb/mcp

Model Context Protocol server for Kubb

MCP 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 can generate TypeScript types, API clients, and more using natural language.

The server exposes a generate tool that runs a full Kubb build from a kubb.config.ts. It streams build events back to the client as real-time progress notifications. The server communicates over stdio and works with any MCP-compatible client.

Installation

Install as a dev dependency:

bun add -D @kubb/mcp
# or
pnpm add -D @kubb/mcp
# or
npm install -D @kubb/mcp

[!IMPORTANT] You also need to install @kubb/cli to use the kubb mcp command.

Usage

Start the MCP Server

Start the server using the Kubb CLI:

npx kubb mcp

Or run it directly as a standalone package:

npx @kubb/mcp

This starts an MCP server that communicates via stdio (standard input/output), making it compatible with MCP clients.

Configure MCP Client

Add to your MCP client configuration (e.g., Claude Desktop's claude_desktop_config.json):

Using kubb mcp:

{
  "mcpServers": {
    "kubb": {
      "command": "npx",
      "args": ["kubb", "mcp"]
    }
  }
}

Using the standalone package:

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

For project-specific configurations, you can specify the working directory:

{
  "mcpServers": {
    "kubb-petstore": {
      "command": "npx",
      "args": ["@kubb/mcp"],
      "cwd": "/path/to/your/project"
    }
  }
}

Available Tools

generate

Generate code from OpenAPI/Swagger specifications using Kubb configuration.

Parameters:

  • config (string, optional): Path to kubb.config.ts file. If not provided, looks for kubb.config.ts in current directory
  • input (string, optional): Path to OpenAPI/Swagger spec file (overrides config file setting)
  • output (string, optional): Output directory path (overrides config file setting)
  • logLevel (enum, optional): Control logging verbosity, one of 'silent', 'info', 'verbose' (default: 'info')

Examples:

Using default config file:

{
  "config": "./kubb.config.ts"
}

Overriding input and output:

{
  "config": "./kubb.config.ts",
  "input": "./specs/petstore.yaml",
  "output": "./src/generated"
}

With verbose logging:

{
  "config": "./kubb.config.ts",
  "logLevel": "verbose"
}

Configuration

The build tool looks for kubb.config.ts in the current directory by default. You can also provide an inline configuration or path to a config file.

Example kubb.config.ts:

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

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

Supporting Kubb

Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:

My sponsors

License

MIT

Keywords

ai

FAQs

Package last updated on 20 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts