[{"data":1,"prerenderedAt":435},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fai\u002Fmcp":3},{"id":4,"title":5,"body":6,"description":417,"extension":418,"frontmatter":419,"heading":5,"meta":425,"navigation":427,"order":413,"path":428,"seo":429,"sitemap":430,"source":431,"stem":432,"__hash__":433,"hasPopups":434},"docs\u002Fdocs\u002F5.x\u002Fai\u002Fmcp.md","Set up the MCP server",{"type":7,"value":8,"toc":405},"minimark",[9,36,48,53,65,70,76,116,132,136,155,232,236,251,309,313,331,345],[10,11,12,13,18,19,23,24,27,28,31,32,35],"p",{},"Kubb ships a ",[14,15,17],"a",{"href":16},"https:\u002F\u002Fmodelcontextprotocol.io\u002F","Model Context Protocol"," server with three tools:\n",[20,21,22],"code",{},"generate",", ",[20,25,26],{},"validate",", and ",[20,29,30],{},"init",". Connect it to your editor or agent to validate a spec, scaffold\na ",[20,33,34],{},"kubb.config.ts",", and run generation from the chat.",[37,38,40,41,47],"blockquote",{"as":39},"note","This page covers using Kubb tooling inside your editor over MCP. To generate an MCP server from\nyour OpenAPI spec, see ",[14,42,44],{"href":43},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-mcp",[20,45,46],{},"@kubb\u002Fplugin-mcp"," instead.",[49,50,52],"h2",{"id":51},"client-configuration","Client configuration",[10,54,55,56,59,60,64],{},"Each client below starts the server with ",[20,57,58],{},"npx kubb mcp"," over stdio. The ",[14,61,63],{"href":62},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp#tools","command reference"," lists each tool's parameters.",[66,67,69],"h3",{"id":68},"claude-code","Claude Code",[10,71,72,73,75],{},"Run this from your project root, so the server starts next to your ",[20,74,34],{},":",[77,78,83],"pre",{"language":79,"filename":80,"code":81,"class":82},"shell","Terminal","claude mcp add kubb -- npx kubb mcp","shiki shiki-themes github-light github-dark dark:github-dark",[20,84,86],{"class":85},"language-shell",[87,88,91,95,99,102,105,109,112,114],"span",{"class":89,"style":90},"line","display: inline",[87,92,94],{"style":93},"color:#6F42C1;--shiki-dark:#B392F0","claude",[87,96,98],{"style":97},"color:#032F62;--shiki-dark:#9ECBFF"," mcp",[87,100,101],{"style":97}," add",[87,103,104],{"style":97}," kubb",[87,106,108],{"style":107},"color:#005CC5;--shiki-dark:#79B8FF"," --",[87,110,111],{"style":97}," npx",[87,113,104],{"style":97},[87,115,98],{"style":97},[10,117,118,119,122,123,126,127,131],{},"Add ",[20,120,121],{},"--scope project"," to write the entry to ",[20,124,125],{},".mcp.json"," and share it with your team. The ",[14,128,130],{"href":129},"\u002Fdocs\u002F5.x\u002Fai\u002Fclaude","Kubb Claude Code plugin"," registers the same server for you.",[66,133,135],{"id":134},"claude-desktop-and-cursor","Claude Desktop and Cursor",[10,137,138,139,142,143,146,147,150,151,154],{},"Add the entry to ",[20,140,141],{},"claude_desktop_config.json"," (on macOS under ",[20,144,145],{},"~\u002FLibrary\u002FApplication Support\u002FClaude\u002F",", on Windows under ",[20,148,149],{},"%APPDATA%\\Claude\\",") or to the server list under Cursor's ",[20,152,153],{},"Settings → MCP",".",[77,156,159],{"language":157,"filename":141,"code":158,"class":82},"json","{\n  \"mcpServers\": {\n    \"kubb\": {\n      \"command\": \"npx\",\n      \"args\": [\"kubb\", \"mcp\"]\n    }\n  }\n}",[20,160,162,168,169,168,177,168,184,168,198,168,217,168,222,168,227],{"class":161},"language-json",[87,163,164],{"class":89,"style":90},[87,165,167],{"style":166},"color:#24292E;--shiki-dark:#E1E4E8","{","\n",[87,170,171,174],{"class":89,"style":90},[87,172,173],{"style":107},"  \"mcpServers\"",[87,175,176],{"style":166},": {",[87,178,179,182],{"class":89,"style":90},[87,180,181],{"style":107},"    \"kubb\"",[87,183,176],{"style":166},[87,185,186,189,192,195],{"class":89,"style":90},[87,187,188],{"style":107},"      \"command\"",[87,190,191],{"style":166},": ",[87,193,194],{"style":97},"\"npx\"",[87,196,197],{"style":166},",",[87,199,200,203,206,209,211,214],{"class":89,"style":90},[87,201,202],{"style":107},"      \"args\"",[87,204,205],{"style":166},": [",[87,207,208],{"style":97},"\"kubb\"",[87,210,23],{"style":166},[87,212,213],{"style":97},"\"mcp\"",[87,215,216],{"style":166},"]",[87,218,219],{"class":89,"style":90},[87,220,221],{"style":166},"    }",[87,223,224],{"class":89,"style":90},[87,225,226],{"style":166},"  }",[87,228,229],{"class":89,"style":90},[87,230,231],{"style":166},"}",[66,233,235],{"id":234},"vs-code-github-copilot","VS Code (GitHub Copilot)",[10,237,238,239,242,243,246,247,250],{},"VS Code uses a ",[20,240,241],{},"servers"," key instead. Add this to ",[20,244,245],{},".vscode\u002Fmcp.json"," for the workspace, or run ",[20,248,249],{},"MCP: Open User Configuration"," in the Command Palette for a global setup.",[77,252,254],{"language":157,"filename":245,"code":253,"class":82},"{\n  \"servers\": {\n    \"kubb\": {\n      \"command\": \"npx\",\n      \"args\": [\"kubb\", \"mcp\"]\n    }\n  }\n}",[20,255,256,168,260,168,267,168,273,168,283,168,297,168,301,168,305],{"class":161},[87,257,258],{"class":89,"style":90},[87,259,167],{"style":166},[87,261,262,265],{"class":89,"style":90},[87,263,264],{"style":107},"  \"servers\"",[87,266,176],{"style":166},[87,268,269,271],{"class":89,"style":90},[87,270,181],{"style":107},[87,272,176],{"style":166},[87,274,275,277,279,281],{"class":89,"style":90},[87,276,188],{"style":107},[87,278,191],{"style":166},[87,280,194],{"style":97},[87,282,197],{"style":166},[87,284,285,287,289,291,293,295],{"class":89,"style":90},[87,286,202],{"style":107},[87,288,205],{"style":166},[87,290,208],{"style":97},[87,292,23],{"style":166},[87,294,213],{"style":97},[87,296,216],{"style":166},[87,298,299],{"class":89,"style":90},[87,300,221],{"style":166},[87,302,303],{"class":89,"style":90},[87,304,226],{"style":166},[87,306,307],{"class":89,"style":90},[87,308,231],{"style":166},[49,310,312],{"id":311},"working-directory","Working directory",[10,314,315,316,319,320,323,324,327,328,330],{},"The server looks for ",[20,317,318],{},"kubb.config.*"," or ",[20,321,322],{},".kubbrc.*"," in the folder the client starts it in, then in its parent folders, and rejects a ",[20,325,326],{},"config"," path outside that folder. Claude Code starts it in the folder you run ",[20,329,94],{}," from.",[10,332,333,334,336,337,340,341,344],{},"If ",[20,335,22],{}," returns ",[20,338,339],{},"No config file found",", the client started the server in another folder. Clients such as Claude Code ignore a ",[20,342,343],{},"cwd"," key, so change into the project in the command instead (macOS and Linux):",[77,346,348],{"language":157,"filename":141,"code":347,"class":82},"{\n  \"mcpServers\": {\n    \"kubb\": {\n      \"command\": \"sh\",\n      \"args\": [\"-c\", \"cd '\u002Fpath\u002Fto\u002Fyour\u002Fproject' && npx kubb mcp\"]\n    }\n  }\n}",[20,349,350,168,354,168,360,168,366,168,377,168,393,168,397,168,401],{"class":161},[87,351,352],{"class":89,"style":90},[87,353,167],{"style":166},[87,355,356,358],{"class":89,"style":90},[87,357,173],{"style":107},[87,359,176],{"style":166},[87,361,362,364],{"class":89,"style":90},[87,363,181],{"style":107},[87,365,176],{"style":166},[87,367,368,370,372,375],{"class":89,"style":90},[87,369,188],{"style":107},[87,371,191],{"style":166},[87,373,374],{"style":97},"\"sh\"",[87,376,197],{"style":166},[87,378,379,381,383,386,388,391],{"class":89,"style":90},[87,380,202],{"style":107},[87,382,205],{"style":166},[87,384,385],{"style":97},"\"-c\"",[87,387,23],{"style":166},[87,389,390],{"style":97},"\"cd '\u002Fpath\u002Fto\u002Fyour\u002Fproject' && npx kubb mcp\"",[87,392,216],{"style":166},[87,394,395],{"class":89,"style":90},[87,396,221],{"style":166},[87,398,399],{"class":89,"style":90},[87,400,226],{"style":166},[87,402,403],{"class":89,"style":90},[87,404,231],{"style":166},{"title":406,"searchDepth":407,"depth":407,"links":408},"",5,[409,416],{"id":51,"depth":410,"text":52,"children":411},2,[412,414,415],{"id":68,"depth":413,"text":69},3,{"id":134,"depth":413,"text":135},{"id":234,"depth":413,"text":235},{"id":311,"depth":410,"text":312},"Connect AI editors and agents to Kubb's local MCP server. Configure Claude Code, Claude Desktop, Cursor, VS Code, and other MCP-capable clients to run Kubb tools directly.","md",{"layout":420,"title":5,"description":417,"outline":421,"order":413,"navigation":422},"doc",[410,413],{"title":423,"icon":424},"MCP","i-simple-icons-modelcontextprotocol",{"layout":420,"outline":426},[410,413],{"title":423,"icon":424},"\u002Fdocs\u002F5.x\u002Fai\u002Fmcp",{"title":5,"description":417},{"loc":428},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fai\u002Fmcp.md","docs\u002F5.x\u002Fai\u002Fmcp","4cZ9M7Tt2s1iXPvW8VzziwdrkkVISRaxN8aWBh0aptg",false,1792782244342]