[{"data":1,"prerenderedAt":1022,"buildId":1023},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp":3},{"id":4,"title":5,"body":6,"description":1005,"extension":1006,"frontmatter":1007,"heading":15,"meta":1013,"navigation":1015,"order":1010,"path":1016,"seo":1017,"sitemap":1018,"source":1019,"stem":1020,"__hash__":1021},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp.md","kubb mcp - Start the Kubb MCP server",{"type":7,"value":8,"toc":986},"minimark",[9,44,49,55,58,63,70,225,265,270,278,480,495,499,502,538,552,557,560,621,626,651,701,706,716,721,726,738,755,760,769,803,808,822,834,839,853,880,885,894,898,901,979],[10,11,12,16,17,22,23,26,27,30,31,34,35,38,39,43],"p",{},[13,14,15],"code",{},"kubb mcp"," starts a ",[18,19,21],"a",{"href":20},"https:\u002F\u002Fmodelcontextprotocol.io\u002F","Model Context Protocol"," server, so your AI client can run every ",[13,24,25],{},"kubb"," command except ",[13,28,29],{},"studio"," and ",[13,32,33],{},"mcp",": validate a spec, write a ",[13,36,37],{},"kubb.config.ts",", manage extensions, and generate code. It takes no options. ",[18,40,42],{"href":41},"\u002Fdocs\u002F5.x\u002Fai\u002Fmcp","Set up the MCP server"," shows how to add it to Claude Code, Cursor, VS Code, and other clients.",[45,46,48],"blockquote",{"as":47},"warning","This feature is under active development. Use it with caution and expect breaking changes.",[50,51],"terminal",{"command":15,":output":52},[53,54],"⏳ Starting MCP server...","This feature is still under development, use with caution",[10,56,57],{},"The server uses the stdio transport, so the client starts it as a local process. Its own messages go to stderr, since stdout carries the protocol.",[59,60,62],"h2",{"id":61},"tools","Tools",[10,64,65,66,69],{},"Each tool is named after its CLI command with a ",[13,67,68],{},"kubb_"," prefix and underscores, so the names stay unique next to the tools of other servers.",[71,72,73,89],"table",{},[74,75,76],"thead",{},[77,78,79,83,86],"tr",{},[80,81,82],"th",{},"Tool",[80,84,85],{},"What it does",[80,87,88],{},"Writes",[90,91,92,109,125,143,162,178,194,210],"tbody",{},[77,93,94,103,106],{},[95,96,97],"td",{},[18,98,100],{"href":99},"#kubb-generate",[13,101,102],{},"kubb_generate",[95,104,105],{},"Runs the Kubb pipeline from the project's config.",[95,107,108],{},"Yes, overwrites generated files",[77,110,111,119,122],{},[95,112,113],{},[18,114,116],{"href":115},"#kubb-validate",[13,117,118],{},"kubb_validate",[95,120,121],{},"Validates an OpenAPI or Swagger document.",[95,123,124],{},"No",[77,126,127,135,141],{},[95,128,129],{},[18,130,132],{"href":131},"#kubb-diff",[13,133,134],{},"kubb_diff",[95,136,137,138,140],{},"Shows what ",[13,139,102],{}," would change, without writing files.",[95,142,124],{},[77,144,145,153,159],{},[95,146,147],{},[18,148,150],{"href":149},"#kubb-init",[13,151,152],{},"kubb_init",[95,154,155,156,158],{},"Writes a ",[13,157,37],{}," without prompts.",[95,160,161],{},"Yes, a new file only",[77,163,164,172,175],{},[95,165,166],{},[18,167,169],{"href":168},"#kubb-add",[13,170,171],{},"kubb_add",[95,173,174],{},"Installs an extension from the registry and adds it to the config.",[95,176,177],{},"Yes",[77,179,180,188,191],{},[95,181,182],{},[18,183,185],{"href":184},"#kubb-update",[13,186,187],{},"kubb_update",[95,189,190],{},"Updates installed extensions.",[95,192,193],{},"Yes, replaces installed versions",[77,195,196,204,207],{},[95,197,198],{},[18,199,201],{"href":200},"#kubb-remove",[13,202,203],{},"kubb_remove",[95,205,206],{},"Removes an extension from the config and uninstalls it.",[95,208,209],{},"Yes, removes",[77,211,212,220,223],{},[95,213,214],{},[18,215,217],{"href":216},"#kubb-list",[13,218,219],{},"kubb_list",[95,221,222],{},"Lists installed extensions and available updates.",[95,224,124],{},[10,226,227,229,230,229,232,229,234,236,237,239,240,242,243,245,246,229,248,236,250,252,253,256,257,260,261,264],{},[13,228,134],{},", ",[13,231,171],{},[13,233,187],{},[13,235,203],{},", and ",[13,238,219],{}," run the ",[13,241,25],{}," CLI and return its output and exit code. They use the project's own ",[13,244,25],{},", or the one that started the server when the project has none. ",[13,247,171],{},[13,249,187],{},[13,251,203],{}," pass ",[13,254,255],{},"--yes"," and accept ",[13,258,259],{},"dryRun",". ",[13,262,263],{},"kubb studio"," has no tool, since its login needs a browser.",[266,267,269],"h3",{"id":268},"annotations","Annotations",[10,271,272,273,277],{},"Every tool sets the MCP ",[18,274,276],{"href":275},"https:\u002F\u002Fmodelcontextprotocol.io\u002Fspecification\u002F2025-11-25\u002Fserver\u002Ftools","tool annotations",", so a client can run a read-only tool without asking and confirm a destructive one.",[71,279,280,306],{},[74,281,282],{},[77,283,284,286,291,296,301],{},[80,285,82],{},[80,287,288],{},[13,289,290],{},"readOnlyHint",[80,292,293],{},[13,294,295],{},"destructiveHint",[80,297,298],{},[13,299,300],{},"idempotentHint",[80,302,303],{},[13,304,305],{},"openWorldHint",[90,307,308,332,352,372,394,416,438,460],{},[77,309,310,314,319,324,328],{},[95,311,312],{},[13,313,102],{},[95,315,316],{},[13,317,318],{},"false",[95,320,321],{},[13,322,323],{},"true",[95,325,326],{},[13,327,323],{},[95,329,330],{},[13,331,323],{},[77,333,334,338,342,344,348],{},[95,335,336],{},[13,337,118],{},[95,339,340],{},[13,341,323],{},[95,343],{},[95,345,346],{},[13,347,323],{},[95,349,350],{},[13,351,323],{},[77,353,354,358,362,364,368],{},[95,355,356],{},[13,357,134],{},[95,359,360],{},[13,361,323],{},[95,363],{},[95,365,366],{},[13,367,323],{},[95,369,370],{},[13,371,323],{},[77,373,374,378,382,386,390],{},[95,375,376],{},[13,377,152],{},[95,379,380],{},[13,381,318],{},[95,383,384],{},[13,385,318],{},[95,387,388],{},[13,389,323],{},[95,391,392],{},[13,393,318],{},[77,395,396,400,404,408,412],{},[95,397,398],{},[13,399,171],{},[95,401,402],{},[13,403,318],{},[95,405,406],{},[13,407,318],{},[95,409,410],{},[13,411,323],{},[95,413,414],{},[13,415,323],{},[77,417,418,422,426,430,434],{},[95,419,420],{},[13,421,187],{},[95,423,424],{},[13,425,318],{},[95,427,428],{},[13,429,323],{},[95,431,432],{},[13,433,323],{},[95,435,436],{},[13,437,323],{},[77,439,440,444,448,452,456],{},[95,441,442],{},[13,443,203],{},[95,445,446],{},[13,447,318],{},[95,449,450],{},[13,451,323],{},[95,453,454],{},[13,455,323],{},[95,457,458],{},[13,459,323],{},[77,461,462,466,470,472,476],{},[95,463,464],{},[13,465,219],{},[95,467,468],{},[13,469,323],{},[95,471],{},[95,473,474],{},[13,475,323],{},[95,477,478],{},[13,479,323],{},[10,481,482,484,485,488,489,491,492,494],{},[13,483,102],{}," is destructive because it overwrites generated files and, with ",[13,486,487],{},"output.clean",", empties the output folder first. ",[13,490,305],{}," is ",[13,493,323],{}," for a tool that can fetch a spec URL or reach the registry.",[266,496,498],{"id":497},"output-size","Output size",[10,500,501],{},"A tool that runs the CLI returns 30,000 characters of text at most, which stays under the 10,000 tokens at which Claude Code warns about a tool response. Longer output is cut at a line break and ends with a notice, which counts toward the limit:",[503,504,508],"pre",{"language":505,"code":506,"class":507},"text","[Output cut: showing the first 29712 of 412090 characters. The diffs of the later files are missing. The out-of-date files are listed below.\n\n2 generated files are out of date:\nsrc\u002Fgen\u002Ftypes\u002FPet.ts (+4120 -3980)\nsrc\u002Fgen\u002Ftypes\u002FOrder.ts (+12 -3)]","highlights",[13,509,511,520,521,520,523,520,528,520,533],{"class":510},"language-text",[512,513,516],"span",{"class":514,"style":515},"line","display: inline",[512,517,519],{"style":518},"color:#24292e;--hls-dark:#e1e4e8","[Output cut: showing the first 29712 of 412090 characters. The diffs of the later files are missing. The out-of-date files are listed below.","\n",[512,522],{"class":514,"style":515},[512,524,525],{"class":514,"style":515},[512,526,527],{"style":518},"2 generated files are out of date:",[512,529,530],{"class":514,"style":515},[512,531,532],{"style":518},"src\u002Fgen\u002Ftypes\u002FPet.ts (+4120 -3980)",[512,534,535],{"class":514,"style":515},[512,536,537],{"style":518},"src\u002Fgen\u002Ftypes\u002FOrder.ts (+12 -3)]",[10,539,540,541,543,544,547,548,551],{},"For ",[13,542,134],{},", the notice lists the out-of-date files with their line counts, up to 5,000 characters of list. Set ",[13,545,546],{},"format"," to ",[13,549,550],{},"summary"," to get the whole list without the diffs.",[266,553,555],{"id":554},"kubb-generate",[13,556,102],{},[10,558,559],{},"Runs the Kubb pipeline and returns the file count, warnings, and diagnostics. On failure, each diagnostic comes with its code, fix, and docs link. A config that exports an array runs its first entry.",[561,562,563,598,606,613],"field-group",{},[564,565,568,569,229,572,229,575,229,578,229,581,584,585,588,589,593,594,597],"field",{"name":566,"type":567},"configPath","string","Path to a ",[13,570,571],{},".ts",[13,573,574],{},".mts",[13,576,577],{},".cts",[13,579,580],{},".js",[13,582,583],{},".mjs",", or ",[13,586,587],{},".cjs"," config file inside the ",[18,590,592],{"href":591},"#working-directory","working directory",". Without it, the server searches the way ",[13,595,596],{},"kubb generate"," does.",[564,599,601,602,605],{"name":600,"type":567},"inputPath","Spec path or URL. Overrides the config's ",[13,603,604],{},"input",".",[564,607,609,610,605],{"name":608,"type":567},"outputPath","Output folder. Overrides the config's ",[13,611,612],{},"output.path",[564,614,617,618,605],{"name":615,"type":616},"logLevel","'silent' | 'info' | 'verbose'","Passed to a config that exports a function. Default: ",[13,619,620],{},"info",[266,622,624],{"id":623},"kubb-diff",[13,625,134],{},[10,627,628,629,635,636,639,640,642,643,646,647,650],{},"Runs ",[18,630,632],{"href":631},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate",[13,633,634],{},"kubb generate --diff"," with the ",[13,637,638],{},"json"," reporter and returns the run log and the generated-file diff: a unified diff for each generated file that differs from what ",[13,641,102],{}," would write. It writes nothing, and it does not compare two versions of a spec. Exit code ",[13,644,645],{},"0"," means the files are up to date, and ",[13,648,649],{},"1"," means they are out of date. A failed run returns an error.",[561,652,653,663,687],{},[564,654,655,656,658,659,597],{"name":566,"type":567},"Path to a config file inside the ",[18,657,592],{"href":591},". Without it, the CLI finds the config the way ",[18,660,661],{"href":631},[13,662,596],{},[564,664,666,669,670,260,674,676,677,680,681,684,685,605],{"name":546,"type":665},"'full' | 'summary'",[13,667,668],{},"full"," returns the unified diffs, cut at the ",[18,671,673],{"href":672},"#output-size","output limit",[13,675,550],{}," runs ",[13,678,679],{},"kubb generate --check"," and returns one line per out-of-date file with its added and removed line counts, such as ",[13,682,683],{},"src\u002Fgen\u002Fpet.ts (+12 -3)",", under the run log and its warnings. Default: ",[13,686,668],{},[564,688,691,692,694,695,698,699,605],{"name":689,"type":690},"lockfile","boolean","Set to ",[13,693,318],{}," to compare with the generated text alone, as ",[13,696,697],{},"--no-lockfile"," does. Default: ",[13,700,323],{},[266,702,704],{"id":703},"kubb-validate",[13,705,118],{},[10,707,708,709,712,713,715],{},"Validates an OpenAPI or Swagger document with the bundled OpenAPI adapter. It does not read the config, and it writes nothing. A ",[13,710,711],{},"$ref"," may read local files only inside the ",[18,714,592],{"href":591},", and fetch URLs only on public hosts.",[561,717,718],{},[564,719,720],{"name":600,"type":567,":required":323},"Path or URL of the spec.",[266,722,724],{"id":723},"kubb-init",[13,725,152],{},[10,727,155,728,730,731,734,735,737],{},[13,729,37],{}," with an empty ",[13,732,733],{},"plugins"," array to the working directory, and fails when one exists. It installs nothing. Its reply tells the agent to call ",[13,736,171],{}," for each plugin.",[561,739,740,746],{},[564,741,742,743,605],{"name":600,"type":567},"Spec path written to the config. Default: ",[13,744,745],{},".\u002Fopenapi.yaml",[564,747,748,749,751,752,605],{"name":608,"type":567},"Output folder inside the ",[18,750,592],{"href":591},", written to the config. Default: ",[13,753,754],{},".\u002Fsrc\u002Fgen",[266,756,758],{"id":757},"kubb-add",[13,759,171],{},[10,761,628,762,768],{},[18,763,765],{"href":764},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd",[13,766,767],{},"kubb add \u003Cid> --yes",". It installs a plugin, adapter, or parser at the version the registry pins. A plugin or parser is added to the config with the plugins it needs, and an adapter comes back as a snippet to add by hand.",[561,770,771,783,787,798],{},[564,772,774,775,778,779,782],{"name":773,"type":567,":required":323},"extensionId","Registry id: ",[13,776,777],{},"owner\u002Fslug",", or a slug such as ",[13,780,781],{},"plugin-zod"," for an official extension.",[564,784,655,785,605],{"name":566,"type":567},[18,786,592],{"href":591},[564,788,691,790,792,793,698,796,605],{"name":789,"type":690},"install",[13,791,318],{}," to only edit the config, as ",[13,794,795],{},"--no-install",[13,797,323],{},[564,799,800,801,605],{"name":259,"type":690},"Preview the change without installing or writing. Default: ",[13,802,318],{},[266,804,806],{"id":805},"kubb-update",[13,807,187],{},[10,809,628,810,816,817,821],{},[18,811,813],{"href":812},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fupdate",[13,814,815],{},"kubb update --yes",". It updates extensions to the versions the registry pins and summarizes the install. It does not regenerate, so call ",[18,818,819],{"href":99},[13,820,102],{}," afterwards to update the generated files.",[561,823,824,829],{},[564,825,828],{"name":826,"type":827},"extensionIds","string[]","Registry ids to update. Default: every installed extension. A major update is installed only for an extension you name here.",[564,830,831,832,605],{"name":259,"type":690},"Preview the updates without installing or writing. Default: ",[13,833,318],{},[266,835,837],{"id":836},"kubb-remove",[13,838,203],{},[10,840,628,841,847,848,852],{},[18,842,844],{"href":843},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fremove",[13,845,846],{},"kubb remove \u003Cid> --yes",". It removes a plugin or parser from the config and uninstalls its package. It leaves the files the extension generated, so call ",[18,849,850],{"href":99},[13,851,102],{}," afterwards.",[561,854,855,861,865,875],{},[564,856,774,857,778,859,782],{"name":773,"type":567,":required":323},[13,858,777],{},[13,860,781],{},[564,862,655,863,605],{"name":566,"type":567},[18,864,592],{"href":591},[564,866,691,868,792,870,698,873,605],{"name":867,"type":690},"uninstall",[13,869,318],{},[13,871,872],{},"--no-uninstall",[13,874,323],{},[564,876,877,878,605],{"name":259,"type":690},"Preview the change without uninstalling or writing. Default: ",[13,879,318],{},[266,881,883],{"id":882},"kubb-list",[13,884,219],{},[10,886,628,887,893],{},[18,888,890],{"href":889},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Flist",[13,891,892],{},"kubb list"," and returns the installed extensions, their versions, and the available updates. It takes no parameters and changes nothing.",[59,895,897],{"id":896},"working-directory","Working directory",[10,899,900],{},"The server runs in the folder the client starts it in:",[902,903,904,910,942,953,965,968],"ul",{},[905,906,907,909],"li",{},[13,908,102],{}," looks for the config there, then in each parent folder.",[905,911,912,914,915,917,918,920,921,923,924,926,927,917,930,933,934,30,936,938,939,605],{},[13,913,102],{}," rejects a ",[13,916,566],{}," or ",[13,919,608],{}," outside that folder, and an ",[13,922,600],{}," outside it unless ",[13,925,600],{}," is an ",[13,928,929],{},"http:",[13,931,932],{},"https:"," URL. The check follows symlinks, and resolves ",[13,935,608],{},[13,937,600],{}," from the config's ",[13,940,941],{},"root",[905,943,944,946,947,949,950,952],{},[13,945,102],{}," also rejects a config whose own ",[13,948,612],{}," is outside that folder, since ",[13,951,487],{}," empties it.",[905,954,955,229,957,236,959,961,962,964],{},[13,956,134],{},[13,958,171],{},[13,960,203],{}," reject a ",[13,963,566],{}," outside that folder too.",[905,966,967],{},"Every tool that runs the CLI runs it there.",[905,969,970,972,973,975,976,978],{},[13,971,152],{}," writes ",[13,974,37],{}," there, and rejects an ",[13,977,608],{}," outside that folder.",[10,980,981,982,605],{},"When the server cannot find your config, see ",[18,983,985],{"href":984},"\u002Fdocs\u002F5.x\u002Fai\u002Fmcp#working-directory","Start it in your project",{"title":987,"searchDepth":988,"depth":988,"links":989},"",5,[990,1004],{"id":61,"depth":991,"text":62,"children":992},2,[993,995,996,997,998,999,1000,1001,1002,1003],{"id":268,"depth":994,"text":269},3,{"id":497,"depth":994,"text":498},{"id":554,"depth":994,"text":102},{"id":623,"depth":994,"text":134},{"id":703,"depth":994,"text":118},{"id":723,"depth":994,"text":152},{"id":757,"depth":994,"text":171},{"id":805,"depth":994,"text":187},{"id":836,"depth":994,"text":203},{"id":882,"depth":994,"text":219},{"id":896,"depth":991,"text":897},"The mcp command starts a stdio Model Context Protocol server with a tool for every Kubb command except studio and mcp, such as kubb_generate, kubb_diff, kubb_add, and kubb_update, with each tool's parameters.","md",{"layout":1008,"title":5,"description":1005,"outline":1009,"order":1010,"navigation":1011},"doc",[991,994],9,{"title":15,"icon":1012},"i-simple-icons-modelcontextprotocol",{"layout":1008,"outline":1014},[991,994],{"title":15,"icon":1012},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp",{"title":5,"description":1005},{"loc":1016},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp","DZIbNW7Xu7HdUnpUMLo5sb3zI_RFrzL0pAFzMf2T9Ho",1795727677061,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]