[{"data":1,"prerenderedAt":1089,"buildId":1090},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp":3},{"id":4,"title":5,"body":6,"description":1072,"extension":1073,"frontmatter":1074,"heading":15,"meta":1080,"navigation":1082,"order":1077,"path":1083,"seo":1084,"sitemap":1085,"source":1086,"stem":1087,"__hash__":1088},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp.md","kubb mcp - Start the Kubb MCP server",{"type":7,"value":8,"toc":1053},"minimark",[9,44,49,55,58,63,70,225,265,270,278,480,495,499,504,540,554,559,562,634,639,664,714,719,729,741,746,767,790,795,804,838,843,857,869,874,888,915,920,929,933,936,1046],[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,323],{},[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,503],{},[13,502,102],{}," and every tool that runs the CLI return 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:",[505,506,510],"pre",{"language":507,"code":508,"class":509},"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,511,513,522,523,522,525,522,530,522,535],{"class":512},"language-text",[514,515,518],"span",{"class":516,"style":517},"line","display: inline",[514,519,521],{"style":520},"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",[514,524],{"class":516,"style":517},[514,526,527],{"class":516,"style":517},[514,528,529],{"style":520},"2 generated files are out of date:",[514,531,532],{"class":516,"style":517},[514,533,534],{"style":520},"src\u002Fgen\u002Ftypes\u002FPet.ts (+4120 -3980)",[514,536,537],{"class":516,"style":517},[514,538,539],{"style":520},"src\u002Fgen\u002Ftypes\u002FOrder.ts (+12 -3)]",[10,541,542,543,545,546,549,550,553],{},"For ",[13,544,134],{},", the notice lists the out-of-date files with their line counts, up to 5,000 characters of list. Set ",[13,547,548],{},"format"," to ",[13,551,552],{},"summary"," to get the whole list without the diffs.",[266,555,557],{"id":556},"kubb-generate",[13,558,102],{},[10,560,561],{},"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.",[563,564,565,600,619,626],"field-group",{},[566,567,570,571,229,574,229,577,229,580,229,583,586,587,590,591,595,596,599],"field",{"name":568,"type":569},"configPath","string","Path to a ",[13,572,573],{},".ts",[13,575,576],{},".mts",[13,578,579],{},".cts",[13,581,582],{},".js",[13,584,585],{},".mjs",", or ",[13,588,589],{},".cjs"," config file inside the ",[18,592,594],{"href":593},"#working-directory","working directory",". Without it, the server searches the way ",[13,597,598],{},"kubb generate"," does.",[566,601,603,604,606,607,610,611,614,615,618],{"name":602,"type":569},"inputPath","Spec path inside the ",[18,605,594],{"href":593},", or an ",[13,608,609],{},"http:"," or ",[13,612,613],{},"https:"," URL on a public host. Overrides the config's ",[13,616,617],{},"input",".",[566,620,622,623,618],{"name":621,"type":569},"outputPath","Output folder. Overrides the config's ",[13,624,625],{},"output.path",[566,627,630,631,618],{"name":628,"type":629},"logLevel","'silent' | 'info' | 'verbose'","Passed to a config that exports a function. Default: ",[13,632,633],{},"info",[266,635,637],{"id":636},"kubb-diff",[13,638,134],{},[10,640,641,642,648,649,652,653,655,656,659,660,663],{},"Runs ",[18,643,645],{"href":644},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate",[13,646,647],{},"kubb generate --diff"," with the ",[13,650,651],{},"json"," reporter and returns the run log and the generated-file diff: a unified diff for each generated file that differs from what ",[13,654,102],{}," would write. It writes nothing, and it does not compare two versions of a spec. Exit code ",[13,657,658],{},"0"," means the files are up to date, and ",[13,661,662],{},"1"," means they are out of date. A failed run returns an error.",[563,665,666,676,700],{},[566,667,668,669,671,672,599],{"name":568,"type":569},"Path to a config file inside the ",[18,670,594],{"href":593},". Without it, the CLI finds the config the way ",[18,673,674],{"href":644},[13,675,598],{},[566,677,679,682,683,260,687,689,690,693,694,697,698,618],{"name":548,"type":678},"'full' | 'summary'",[13,680,681],{},"full"," returns the unified diffs, cut at the ",[18,684,686],{"href":685},"#output-size","output limit",[13,688,552],{}," runs ",[13,691,692],{},"kubb generate --check"," and returns one line per out-of-date file with its added and removed line counts, such as ",[13,695,696],{},"src\u002Fgen\u002Fpet.ts (+12 -3)",", under the run log and its warnings. Default: ",[13,699,681],{},[566,701,704,705,707,708,711,712,618],{"name":702,"type":703},"lockfile","boolean","Set to ",[13,706,318],{}," to compare with the generated text alone, as ",[13,709,710],{},"--no-lockfile"," does. Default: ",[13,713,323],{},[266,715,717],{"id":716},"kubb-validate",[13,718,118],{},[10,720,721,722,724,725,728],{},"Validates an OpenAPI or Swagger document with the bundled OpenAPI adapter. It does not read the config, and it writes nothing. The spec must be a file inside the ",[18,723,594],{"href":593}," or a URL on a public host. A ",[13,726,727],{},"$ref"," may read local files only inside the working directory, and fetch URLs only on public hosts.",[563,730,731],{},[566,732,733,734,586,736,610,738,740],{"name":602,"type":569,":required":323},"Path inside the ",[18,735,594],{"href":593},[13,737,609],{},[13,739,613],{}," URL on a public host, of the spec.",[266,742,744],{"id":743},"kubb-init",[13,745,152],{},[10,747,155,748,750,751,754,755,757,758,760,761,763,764,766],{},[13,749,37],{}," with an empty ",[13,752,753],{},"plugins"," array to the working directory, and fails when one exists. It installs nothing. When the spec already exists, it reads the spec first with the limits of ",[13,756,118],{},", and writes nothing if a ",[13,759,727],{}," leaves the working directory or the spec or a ",[13,762,727],{}," is on a host that is not public. Its reply tells the agent to call ",[13,765,171],{}," for each plugin.",[563,768,769,781],{},[566,770,603,771,586,773,610,775,777,778,618],{"name":602,"type":569},[18,772,594],{"href":593},[13,774,609],{},[13,776,613],{}," URL, written to the config. Default: ",[13,779,780],{},".\u002Fopenapi.yaml",[566,782,783,784,786,787,618],{"name":621,"type":569},"Output folder inside the ",[18,785,594],{"href":593},", written to the config. Default: ",[13,788,789],{},".\u002Fsrc\u002Fgen",[266,791,793],{"id":792},"kubb-add",[13,794,171],{},[10,796,641,797,803],{},[18,798,800],{"href":799},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd",[13,801,802],{},"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.",[563,805,806,818,822,833],{},[566,807,809,810,813,814,817],{"name":808,"type":569,":required":323},"extensionId","Registry id: ",[13,811,812],{},"owner\u002Fslug",", or a slug such as ",[13,815,816],{},"plugin-zod"," for an official extension.",[566,819,668,820,618],{"name":568,"type":569},[18,821,594],{"href":593},[566,823,704,825,827,828,711,831,618],{"name":824,"type":703},"install",[13,826,318],{}," to only edit the config, as ",[13,829,830],{},"--no-install",[13,832,323],{},[566,834,835,836,618],{"name":259,"type":703},"Preview the change without installing or writing. Default: ",[13,837,318],{},[266,839,841],{"id":840},"kubb-update",[13,842,187],{},[10,844,641,845,851,852,856],{},[18,846,848],{"href":847},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fupdate",[13,849,850],{},"kubb update --yes",". It updates extensions to the versions the registry pins and summarizes the install. It does not regenerate, so call ",[18,853,854],{"href":99},[13,855,102],{}," afterwards to update the generated files.",[563,858,859,864],{},[566,860,863],{"name":861,"type":862},"extensionIds","string[]","Registry ids to update. Default: every installed extension. A major update is installed only for an extension you name here.",[566,865,866,867,618],{"name":259,"type":703},"Preview the updates without installing or writing. Default: ",[13,868,318],{},[266,870,872],{"id":871},"kubb-remove",[13,873,203],{},[10,875,641,876,882,883,887],{},[18,877,879],{"href":878},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fremove",[13,880,881],{},"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,884,885],{"href":99},[13,886,102],{}," afterwards.",[563,889,890,896,900,910],{},[566,891,809,892,813,894,817],{"name":808,"type":569,":required":323},[13,893,812],{},[13,895,816],{},[566,897,668,898,618],{"name":568,"type":569},[18,899,594],{"href":593},[566,901,704,903,827,905,711,908,618],{"name":902,"type":703},"uninstall",[13,904,318],{},[13,906,907],{},"--no-uninstall",[13,909,323],{},[566,911,912,913,618],{"name":259,"type":703},"Preview the change without uninstalling or writing. Default: ",[13,914,318],{},[266,916,918],{"id":917},"kubb-list",[13,919,219],{},[10,921,641,922,928],{},[18,923,925],{"href":924},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Flist",[13,926,927],{},"kubb list"," and returns the installed extensions, their versions, and the available updates. It takes no parameters and changes nothing.",[59,930,932],{"id":931},"working-directory","Working directory",[10,934,935],{},"The server runs in the folder the client starts it in:",[937,938,939,945,972,988,1009,1020,1032,1035],"ul",{},[940,941,942,944],"li",{},[13,943,102],{}," looks for the config there, then in each parent folder.",[940,946,947,229,949,236,951,953,954,956,957,959,960,610,962,964,965,967,968,971],{},[13,948,102],{},[13,950,118],{},[13,952,152],{}," reject a git ",[13,955,602],{},", and a local ",[13,958,602],{}," outside that folder. An ",[13,961,609],{},[13,963,613],{}," ",[13,966,602],{}," is fetched from public hosts only, so ",[13,969,970],{},"localhost",", a private network address, or a cloud metadata address fails.",[940,973,974,30,976,978,979,981,982,984,985,987],{},[13,975,102],{},[13,977,118],{}," read every spec with the same limits, including the ",[13,980,617],{}," a config names: the spec and its ",[13,983,727],{}," URLs come from public hosts only, and a ",[13,986,727],{}," reads local files only inside that folder.",[940,989,990,992,993,610,995,997,998,1000,1001,30,1003,1005,1006,618],{},[13,991,102],{}," rejects a ",[13,994,568],{},[13,996,621],{}," outside that folder, and a config whose own ",[13,999,617],{}," is a git input or a path outside it. The checks follow symlinks, and resolve ",[13,1002,621],{},[13,1004,602],{}," from the config's ",[13,1007,1008],{},"root",[940,1010,1011,1013,1014,1016,1017,1019],{},[13,1012,102],{}," also rejects a config whose own ",[13,1015,625],{}," is outside that folder, since ",[13,1018,487],{}," empties it.",[940,1021,1022,229,1024,236,1026,1028,1029,1031],{},[13,1023,134],{},[13,1025,171],{},[13,1027,203],{}," reject a ",[13,1030,568],{}," outside that folder too.",[940,1033,1034],{},"Every tool that runs the CLI runs it there.",[940,1036,1037,1039,1040,1042,1043,1045],{},[13,1038,152],{}," writes ",[13,1041,37],{}," there, and rejects an ",[13,1044,621],{}," outside that folder.",[10,1047,1048,1049,618],{},"When the server cannot find your config, see ",[18,1050,1052],{"href":1051},"\u002Fdocs\u002F5.x\u002Fai\u002Fmcp#working-directory","Start it in your project",{"title":1054,"searchDepth":1055,"depth":1055,"links":1056},"",5,[1057,1071],{"id":61,"depth":1058,"text":62,"children":1059},2,[1060,1062,1063,1064,1065,1066,1067,1068,1069,1070],{"id":268,"depth":1061,"text":269},3,{"id":497,"depth":1061,"text":498},{"id":556,"depth":1061,"text":102},{"id":636,"depth":1061,"text":134},{"id":716,"depth":1061,"text":118},{"id":743,"depth":1061,"text":152},{"id":792,"depth":1061,"text":171},{"id":840,"depth":1061,"text":187},{"id":871,"depth":1061,"text":203},{"id":917,"depth":1061,"text":219},{"id":931,"depth":1058,"text":932},"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":1075,"title":5,"description":1072,"outline":1076,"order":1077,"navigation":1078},"doc",[1058,1061],9,{"title":15,"icon":1079},"i-simple-icons-modelcontextprotocol",{"layout":1075,"outline":1081},[1058,1061],{"title":15,"icon":1079},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp",{"title":5,"description":1072},{"loc":1083},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fmcp","orTx8ki5HxOZunfwJTDWgbaw2sovRvxmHXUJP-G7eGw",1795989036696,"2e8b4c62-5b8c-4587-97c0-530d08a9bd53"]