[{"data":1,"prerenderedAt":463},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fai\u002Fmcp":3},{"id":4,"title":5,"body":6,"description":446,"extension":447,"frontmatter":448,"heading":5,"meta":454,"navigation":456,"order":442,"path":457,"seo":458,"sitemap":459,"source":460,"stem":461,"__hash__":462},"docs\u002Fdocs\u002F5.x\u002Fai\u002Fmcp.md","Set up the MCP server",{"type":7,"value":8,"toc":434},"minimark",[9,36,48,53,65,70,76,99,115,119,138,232,236,251,323,327,346,360],[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","highlights",[20,84,86],{"class":85},"language-shell",[87,88,91,95],"span",{"class":89,"style":90},"line","display: inline",[87,92,94],{"style":93},"color:#6f42c1;--hls-dark:#b392f0","claude ",[87,96,98],{"style":97},"color:#24292e;--hls-dark:#e1e4e8","mcp add kubb -- npx kubb mcp",[10,100,101,102,105,106,109,110,114],{},"Add ",[20,103,104],{},"--scope project"," to write the entry to ",[20,107,108],{},".mcp.json"," and share it with your team. The ",[14,111,113],{"href":112},"\u002Fdocs\u002F5.x\u002Fai\u002Fclaude","Kubb Claude Code plugin"," registers the same server for you.",[66,116,118],{"id":117},"claude-desktop-and-cursor","Claude Desktop and Cursor",[10,120,121,122,125,126,129,130,133,134,137],{},"Add the entry to ",[20,123,124],{},"claude_desktop_config.json"," (on macOS under ",[20,127,128],{},"~\u002FLibrary\u002FApplication Support\u002FClaude\u002F",", on Windows under ",[20,131,132],{},"%APPDATA%\\Claude\\",") or to the server list under Cursor's ",[20,135,136],{},"Settings → MCP",".",[77,139,142],{"language":140,"filename":124,"code":141,"class":82},"json","{\n  \"mcpServers\": {\n    \"kubb\": {\n      \"command\": \"npx\",\n      \"args\": [\"kubb\", \"mcp\"]\n    }\n  }\n}",[20,143,145,151,152,151,166,151,178,151,195,151,217,151,222,151,227],{"class":144},"language-json",[87,146,147],{"class":89,"style":90},[87,148,150],{"style":149},"color:#005cc5;--hls-dark:#79b8ff","{","\n",[87,153,154,157,160,164],{"class":89,"style":90},[87,155,156],{"style":149},"  ",[87,158,159],{"style":149},"\"mcpServers\"",[87,161,163],{"style":162},"color:#d73a49;--hls-dark:#f97583",": ",[87,165,150],{"style":149},[87,167,168,171,174,176],{"class":89,"style":90},[87,169,170],{"style":149},"    ",[87,172,173],{"style":149},"\"kubb\"",[87,175,163],{"style":162},[87,177,150],{"style":149},[87,179,180,183,186,188,192],{"class":89,"style":90},[87,181,182],{"style":149},"      ",[87,184,185],{"style":149},"\"command\"",[87,187,163],{"style":162},[87,189,191],{"style":190},"color:#032f62;--hls-dark:#9ecbff","\"npx\"",[87,193,194],{"style":162},",",[87,196,197,199,202,204,207,209,211,214],{"class":89,"style":90},[87,198,182],{"style":162},[87,200,201],{"style":149},"\"args\"",[87,203,163],{"style":162},[87,205,206],{"style":149},"[",[87,208,173],{"style":190},[87,210,23],{"style":162},[87,212,213],{"style":190},"\"mcp\"",[87,215,216],{"style":149},"]",[87,218,219],{"class":89,"style":90},[87,220,221],{"style":149},"    }",[87,223,224],{"class":89,"style":90},[87,225,226],{"style":149},"  }",[87,228,229],{"class":89,"style":90},[87,230,231],{"style":149},"}",[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":140,"filename":245,"code":253,"class":82},"{\n  \"servers\": {\n    \"kubb\": {\n      \"command\": \"npx\",\n      \"args\": [\"kubb\", \"mcp\"]\n    }\n  }\n}",[20,255,256,151,260,151,271,151,281,151,293,151,311,151,315,151,319],{"class":144},[87,257,258],{"class":89,"style":90},[87,259,150],{"style":149},[87,261,262,264,267,269],{"class":89,"style":90},[87,263,156],{"style":149},[87,265,266],{"style":149},"\"servers\"",[87,268,163],{"style":162},[87,270,150],{"style":149},[87,272,273,275,277,279],{"class":89,"style":90},[87,274,170],{"style":149},[87,276,173],{"style":149},[87,278,163],{"style":162},[87,280,150],{"style":149},[87,282,283,285,287,289,291],{"class":89,"style":90},[87,284,182],{"style":149},[87,286,185],{"style":149},[87,288,163],{"style":162},[87,290,191],{"style":190},[87,292,194],{"style":162},[87,294,295,297,299,301,303,305,307,309],{"class":89,"style":90},[87,296,182],{"style":162},[87,298,201],{"style":149},[87,300,163],{"style":162},[87,302,206],{"style":149},[87,304,173],{"style":190},[87,306,23],{"style":162},[87,308,213],{"style":190},[87,310,216],{"style":149},[87,312,313],{"class":89,"style":90},[87,314,221],{"style":149},[87,316,317],{"class":89,"style":90},[87,318,226],{"style":149},[87,320,321],{"class":89,"style":90},[87,322,231],{"style":149},[49,324,326],{"id":325},"working-directory","Working directory",[10,328,329,330,333,334,337,338,341,342,345],{},"The server looks for ",[20,331,332],{},"kubb.config.*"," or ",[20,335,336],{},".kubbrc.*"," in the folder the client starts it in, then in its parent folders, and rejects a ",[20,339,340],{},"config"," path outside that folder. Claude Code starts it in the folder you run ",[20,343,344],{},"claude"," from.",[10,347,348,349,351,352,355,356,359],{},"If ",[20,350,22],{}," returns ",[20,353,354],{},"No config file found",", the client started the server in another folder. Clients such as Claude Code ignore a ",[20,357,358],{},"cwd"," key, so change into the project in the command instead (macOS and Linux):",[77,361,363],{"language":140,"filename":124,"code":362,"class":82},"{\n  \"mcpServers\": {\n    \"kubb\": {\n      \"command\": \"sh\",\n      \"args\": [\"-c\", \"cd '\u002Fpath\u002Fto\u002Fyour\u002Fproject' && npx kubb mcp\"]\n    }\n  }\n}",[20,364,365,151,369,151,379,151,389,151,402,151,422,151,426,151,430],{"class":144},[87,366,367],{"class":89,"style":90},[87,368,150],{"style":149},[87,370,371,373,375,377],{"class":89,"style":90},[87,372,156],{"style":149},[87,374,159],{"style":149},[87,376,163],{"style":162},[87,378,150],{"style":149},[87,380,381,383,385,387],{"class":89,"style":90},[87,382,170],{"style":149},[87,384,173],{"style":149},[87,386,163],{"style":162},[87,388,150],{"style":149},[87,390,391,393,395,397,400],{"class":89,"style":90},[87,392,182],{"style":149},[87,394,185],{"style":149},[87,396,163],{"style":162},[87,398,399],{"style":190},"\"sh\"",[87,401,194],{"style":162},[87,403,404,406,408,410,412,415,417,420],{"class":89,"style":90},[87,405,182],{"style":162},[87,407,201],{"style":149},[87,409,163],{"style":162},[87,411,206],{"style":149},[87,413,414],{"style":190},"\"-c\"",[87,416,23],{"style":162},[87,418,419],{"style":190},"\"cd '\u002Fpath\u002Fto\u002Fyour\u002Fproject' && npx kubb mcp\"",[87,421,216],{"style":149},[87,423,424],{"class":89,"style":90},[87,425,221],{"style":149},[87,427,428],{"class":89,"style":90},[87,429,226],{"style":149},[87,431,432],{"class":89,"style":90},[87,433,231],{"style":149},{"title":435,"searchDepth":436,"depth":436,"links":437},"",5,[438,445],{"id":51,"depth":439,"text":52,"children":440},2,[441,443,444],{"id":68,"depth":442,"text":69},3,{"id":117,"depth":442,"text":118},{"id":234,"depth":442,"text":235},{"id":325,"depth":439,"text":326},"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":449,"title":5,"description":446,"outline":450,"order":442,"navigation":451},"doc",[439,442],{"title":452,"icon":453},"MCP","i-simple-icons-modelcontextprotocol",{"layout":449,"outline":455},[439,442],{"title":452,"icon":453},"\u002Fdocs\u002F5.x\u002Fai\u002Fmcp",{"title":5,"description":446},{"loc":457},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fai\u002Fmcp.md","docs\u002F5.x\u002Fai\u002Fmcp","EeWk3R5S4GEtU7YSofpK_0W4Rf-NMrZFlQEQ30n2kIA",1792931639418]