Plugin
plugins: [pluginMcp()]Officialv5.1.1kubb >=5.8.0node >=22
MCP
@kubb/plugin-mcp
Generates a Model Context Protocol server from your OpenAPI spec, so AI assistants can call each operation as a typed tool.
kubb add plugin-mcp
mcpmodel-context-protocolaiclaudellmcodegenopenapi
- Downloads40.1K/ monthnpm, last 30 days
- GitHub stars8kubb-labs/plugins
- Unpacked size247.9kBv5.1.1 on npm
- Latest release1h agov5.1.1 · Oct 13, 2026
Generates a Model Context Protocol (MCP) server from your OpenAPI spec. Each operation becomes a typed tool that AI assistants can call.
The tool handlers call a function generated by a client plugin, and Zod schemas from @kubb/plugin-zod validate the tool input. The plugin writes server.ts and .mcp.json next to the handlers.
Installation
bun add -d @kubb/plugin-mcppnpm add -D @kubb/plugin-mcpnpm install --save-dev @kubb/plugin-mcpyarn add -D @kubb/plugin-mcpOr run kubb add plugin-mcp to install the version the Kubb registry pins and add pluginMcp() to kubb.config.ts.
Setup
- Add
@kubb/plugin-ts,@kubb/plugin-zod, and a client plugin:@kubb/plugin-fetchor@kubb/plugin-axios. - Install
@modelcontextprotocol/serverv2 or higher andzod4.2 or higher in the app that runs the server.
Options worth knowing
clientpicksfetchoraxioswhen both client plugins are registered. A single client is detected automatically.- Keep
output.patha folder name, such as the defaultmcp. Single-file output has no place forserver.tsand.mcp.json.
Dependencies
No extension dependencies.