[{"data":1,"prerenderedAt":3036},["ShallowReactive",2],{"navigation_docs":3,"-advanced-code-mode":139,"-advanced-code-mode-surround":3031},[4,40,65,110],{"title":5,"path":6,"stem":7,"children":8,"page":39},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29,34],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-book-open",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F3.configuration","i-lucide-settings",{"title":25,"path":26,"stem":27,"icon":28},"MCP Inspector","\u002Fgetting-started\u002Finspector","1.getting-started\u002F4.inspector","i-lucide-circuit-board",{"title":30,"path":31,"stem":32,"icon":33},"Connection","\u002Fgetting-started\u002Fconnection","1.getting-started\u002F5.connection","i-lucide-plug",{"title":35,"path":36,"stem":37,"icon":38},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F6.agent-skills","i-lucide-sparkles",false,{"title":41,"path":42,"stem":43,"children":44,"page":39},"Core Concepts","\u002Fcore-concepts","2.core-concepts",[45,50,55,60],{"title":46,"path":47,"stem":48,"icon":49},"Tools","\u002Fcore-concepts\u002Ftools","2.core-concepts\u002F2.tools","i-lucide-wrench",{"title":51,"path":52,"stem":53,"icon":54},"Resources","\u002Fcore-concepts\u002Fresources","2.core-concepts\u002F3.resources","i-lucide-package",{"title":56,"path":57,"stem":58,"icon":59},"Prompts","\u002Fcore-concepts\u002Fprompts","2.core-concepts\u002F4.prompts","i-lucide-message-square",{"title":61,"path":62,"stem":63,"icon":64},"Handlers","\u002Fcore-concepts\u002Fhandlers","2.core-concepts\u002F5.handlers","i-lucide-server",{"title":66,"path":67,"stem":68,"children":69,"page":39},"Advanced Topics","\u002Fadvanced","3.advanced",[70,75,80,85,90,95,100,105],{"title":71,"path":72,"stem":73,"icon":74},"Custom Paths","\u002Fadvanced\u002Fcustom-paths","3.advanced\u002F1.custom-paths","i-lucide-folder",{"title":76,"path":77,"stem":78,"icon":79},"Middleware","\u002Fadvanced\u002Fmiddleware","3.advanced\u002F2.middleware","i-lucide-shield",{"title":81,"path":82,"stem":83,"icon":84},"TypeScript","\u002Fadvanced\u002Ftypescript","3.advanced\u002F3.typescript","i-lucide-type",{"title":86,"path":87,"stem":88,"icon":89},"Hooks","\u002Fadvanced\u002Fhooks","3.advanced\u002F4.hooks","i-lucide-webhook",{"title":91,"path":92,"stem":93,"icon":94},"MCP Evals","\u002Fadvanced\u002Fevals","3.advanced\u002F5.evals","i-lucide-flask-conical",{"title":96,"path":97,"stem":98,"icon":99},"Sessions","\u002Fadvanced\u002Fsessions","3.advanced\u002F6.sessions","i-lucide-database",{"title":101,"path":102,"stem":103,"icon":104},"Dynamic Definitions","\u002Fadvanced\u002Fdynamic-definitions","3.advanced\u002F7.dynamic-definitions","i-lucide-toggle-right",{"title":106,"path":107,"stem":108,"icon":109},"Code Mode","\u002Fadvanced\u002Fcode-mode","3.advanced\u002F8.code-mode","i-lucide-code",{"title":111,"path":112,"stem":113,"children":114,"page":39},"Examples","\u002Fexamples","4.examples",[115,120,125,130,135],{"title":116,"path":117,"stem":118,"icon":119},"Authentication","\u002Fexamples\u002Fauthentication","4.examples\u002F1.authentication","i-lucide-shield-check",{"title":121,"path":122,"stem":123,"icon":124},"API Integration","\u002Fexamples\u002Fapi-integration","4.examples\u002F2.api-integration","i-lucide-globe",{"title":126,"path":127,"stem":128,"icon":129},"Common Patterns","\u002Fexamples\u002Fcommon-patterns","4.examples\u002F3.common-patterns","i-lucide-lightbulb",{"title":131,"path":132,"stem":133,"icon":134},"File Operations","\u002Fexamples\u002Ffile-operations","4.examples\u002F4.file-operations","i-lucide-file",{"title":136,"path":137,"stem":138,"icon":59},"Prompt Examples","\u002Fexamples\u002Fprompt-examples","4.examples\u002F5.prompt-examples",{"id":140,"title":106,"body":141,"description":3023,"extension":3024,"links":3025,"meta":3026,"navigation":3027,"path":107,"seo":3028,"stem":108,"__hash__":3030},"docs\u002F3.advanced\u002F8.code-mode.md",{"type":142,"value":143,"toc":2993},"minimark",[144,149,157,244,318,327,331,338,343,353,446,453,466,470,473,514,518,522,533,599,615,619,626,767,773,777,780,802,806,821,1431,1435,1442,1585,1730,1733,1739,1756,1801,1804,1856,1859,1863,1869,1939,1948,1957,1961,1968,1972,1984,2026,2030,2033,2070,2074,2077,2105,2108,2112,2268,2272,2275,2305,2309,2316,2320,2327,2331,2334,2811,2830,2834,2840,2898,2907,2911,2917,2962,2966,2989],[145,146,148],"h2",{"id":147},"what-is-code-mode","What is Code Mode?",[150,151,152,153,156],"p",{},"Code Mode replaces the traditional multi-turn tool calling pattern with a single ",[154,155,154],"code",{}," tool. Instead of the LLM calling tools one at a time — each requiring a round-trip — it writes JavaScript code that orchestrates multiple tools in one execution.",[158,159,160],"code-collapse",{},[161,162,168],"pre",{"className":163,"code":164,"filename":165,"language":166,"meta":167,"style":167},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Enable Code Mode in my Nuxt MCP server (@nuxtjs\u002Fmcp-toolkit).\n\n- Install secure-exec: pnpm add secure-exec\n- Set experimental_codeMode: true on the handler in server\u002Fmcp\u002Findex.ts (via defineMcpHandler)\n- Code Mode replaces all registered tools with a single 'code' tool\n- The LLM writes JavaScript that calls tools via a codemode object (e.g. await codemode.listUsers())\n- This reduces round-trips and token usage — especially with many tools (10+ tools saves 50%+ tokens)\n- Code runs in a secure V8 sandbox (workerd) — no access to filesystem, network, or Node APIs\n- If there are many tools (10+), consider progressive mode (experimental_codeMode: { progressive: true }) to keep both individual tools and the code tool — for fewer tools, standard mode is sufficient\n- Code Mode is experimental — the API may evolve\n\nDocs: https:\u002F\u002Fmcp-toolkit.nuxt.dev\u002Fadvanced\u002Fcode-mode\n","Prompt","txt","",[154,169,170,178,185,191,197,203,209,215,221,227,233,238],{"__ignoreMap":167},[171,172,175],"span",{"class":173,"line":174},"line",1,[171,176,177],{},"Enable Code Mode in my Nuxt MCP server (@nuxtjs\u002Fmcp-toolkit).\n",[171,179,181],{"class":173,"line":180},2,[171,182,184],{"emptyLinePlaceholder":183},true,"\n",[171,186,188],{"class":173,"line":187},3,[171,189,190],{},"- Install secure-exec: pnpm add secure-exec\n",[171,192,194],{"class":173,"line":193},4,[171,195,196],{},"- Set experimental_codeMode: true on the handler in server\u002Fmcp\u002Findex.ts (via defineMcpHandler)\n",[171,198,200],{"class":173,"line":199},5,[171,201,202],{},"- Code Mode replaces all registered tools with a single 'code' tool\n",[171,204,206],{"class":173,"line":205},6,[171,207,208],{},"- The LLM writes JavaScript that calls tools via a codemode object (e.g. await codemode.listUsers())\n",[171,210,212],{"class":173,"line":211},7,[171,213,214],{},"- This reduces round-trips and token usage — especially with many tools (10+ tools saves 50%+ tokens)\n",[171,216,218],{"class":173,"line":217},8,[171,219,220],{},"- Code runs in a secure V8 sandbox (workerd) — no access to filesystem, network, or Node APIs\n",[171,222,224],{"class":173,"line":223},9,[171,225,226],{},"- If there are many tools (10+), consider progressive mode (experimental_codeMode: { progressive: true }) to keep both individual tools and the code tool — for fewer tools, standard mode is sufficient\n",[171,228,230],{"class":173,"line":229},10,[171,231,232],{},"- Code Mode is experimental — the API may evolve\n",[171,234,236],{"class":173,"line":235},11,[171,237,184],{"emptyLinePlaceholder":183},[171,239,241],{"class":173,"line":240},12,[171,242,243],{},"Docs: https:\u002F\u002Fmcp-toolkit.nuxt.dev\u002Fadvanced\u002Fcode-mode\n",[245,246,247,261],"table",{},[248,249,250],"thead",{},[251,252,253,256,259],"tr",{},[254,255],"th",{},[254,257,258],{},"Traditional MCP",[254,260,106],{},[262,263,264,279,292,305],"tbody",{},[251,265,266,273,276],{},[267,268,269],"td",{},[270,271,272],"strong",{},"Pattern",[267,274,275],{},"LLM calls tools one by one",[267,277,278],{},"LLM writes JS that calls tools",[251,280,281,286,289],{},[267,282,283],{},[270,284,285],{},"Round-trips",[267,287,288],{},"One per tool call",[267,290,291],{},"One for all operations",[251,293,294,299,302],{},[267,295,296],{},[270,297,298],{},"Complex logic",[267,300,301],{},"Multiple turns for conditionals\u002Floops",[267,303,304],{},"Native JS control flow",[251,306,307,312,315],{},[267,308,309],{},[270,310,311],{},"Token usage",[267,313,314],{},"Higher (repeated context)",[267,316,317],{},"Lower (single invocation)",[319,320,322,323,326],"callout",{"color":321,"icon":94},"warning","Code Mode is ",[270,324,325],{},"experimental for now",". The API may evolve as we stabilize this feature based on feedback.",[145,328,330],{"id":329},"why-code-mode","Why Code Mode?",[150,332,333,334,337],{},"Every LLM round-trip resends ",[270,335,336],{},"all tool descriptions"," as context. With traditional MCP, a task that requires 5 steps with 50 tools sends the full tool catalog 5 times — that's 15,500 tokens just for tool descriptions. Code Mode sends compact TypeScript signatures in a single tool, cutting that to ~3,000 tokens.",[339,340,342],"h3",{"id":341},"the-scaling-problem","The scaling problem",[150,344,345,346,349,350,352],{},"In traditional MCP, tool description overhead scales as ",[270,347,348],{},"tools × round-trips",". Code Mode replaces all tools with one ",[154,351,154],{}," tool containing compact type signatures — and usually needs fewer round-trips.",[245,354,355,369],{},[248,356,357],{},[251,358,359,362,364,366],{},[254,360,361],{},"Server size",[254,363,258],{},[254,365,106],{},[254,367,368],{},"Savings",[262,370,371,390,409,428],{},[251,372,373,379,382,385],{},[267,374,375,378],{},[270,376,377],{},"10 tools",", 3-step task",[267,380,381],{},"~1,860 tokens in tool descriptions",[267,383,384],{},"~920 tokens",[267,386,387],{},[270,388,389],{},"-51%",[251,391,392,398,401,404],{},[267,393,394,397],{},[270,395,396],{},"25 tools",", 4-step task",[267,399,400],{},"~6,200 tokens",[267,402,403],{},"~1,700 tokens",[267,405,406],{},[270,407,408],{},"-73%",[251,410,411,417,420,423],{},[267,412,413,416],{},[270,414,415],{},"50 tools",", 5-step task",[267,418,419],{},"~15,500 tokens",[267,421,422],{},"~3,000 tokens",[267,424,425],{},[270,426,427],{},"-81%",[251,429,430,435,438,441],{},[267,431,432,416],{},[270,433,434],{},"100 tools",[267,436,437],{},"~31,000 tokens",[267,439,440],{},"~5,600 tokens",[267,442,443],{},[270,444,445],{},"-82%",[150,447,448,449,452],{},"These numbers represent tool description overhead only. Total savings depend on the task, but the trend is clear: ",[270,450,451],{},"the more tools you have, the bigger the savings",".",[319,454,457,458,461,462,465],{"color":455,"icon":456},"primary","i-lucide-zap","On a real benchmark with Claude Sonnet (9 tools, 7 tasks), Code Mode saved ",[270,459,460],{},"15% of total tokens overall"," and up to ",[270,463,464],{},"33% on complex batch operations"," — collapsing 8 tool calls into a single JavaScript block.",[339,467,469],{"id":468},"beyond-token-savings","Beyond token savings",[150,471,472],{},"Code Mode also unlocks patterns that traditional MCP cannot do efficiently:",[474,475,476,487,496,505],"ul",{},[477,478,479,482,483,486],"li",{},[270,480,481],{},"Parallel execution"," — ",[154,484,485],{},"Promise.all()"," for independent calls instead of sequential round-trips",[477,488,489,482,492,495],{},[270,490,491],{},"Conditional logic",[154,493,494],{},"if\u002Felse"," branching without an extra LLM step",[477,497,498,482,501,504],{},[270,499,500],{},"Loops",[154,502,503],{},"for"," over data instead of repeating tool calls one by one",[477,506,507,482,510,513],{},[270,508,509],{},"Error handling",[154,511,512],{},"try\u002Fcatch"," to handle failures mid-workflow",[145,515,517],{"id":516},"setup","Setup",[339,519,521],{"id":520},"_1-install-secure-exec","1. Install secure-exec",[150,523,524,525,532],{},"Code Mode uses ",[526,527,531],"a",{"href":528,"rel":529},"https:\u002F\u002Fgithub.com\u002Fnicolo-ribaudo\u002Fsecure-exec",[530],"nofollow","secure-exec"," to run LLM-generated code in a secure V8 isolate:",[534,535,536,556,571,585],"code-group",{},[161,537,542],{"className":538,"code":539,"filename":540,"language":541,"meta":167,"style":167},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add secure-exec\n","pnpm","bash",[154,543,544],{"__ignoreMap":167},[171,545,546,549,553],{"class":173,"line":174},[171,547,540],{"class":548},"sBMFI",[171,550,552],{"class":551},"sfazB"," add",[171,554,555],{"class":551}," secure-exec\n",[161,557,560],{"className":538,"code":558,"filename":559,"language":541,"meta":167,"style":167},"npm install secure-exec\n","npm",[154,561,562],{"__ignoreMap":167},[171,563,564,566,569],{"class":173,"line":174},[171,565,559],{"class":548},[171,567,568],{"class":551}," install",[171,570,555],{"class":551},[161,572,575],{"className":538,"code":573,"filename":574,"language":541,"meta":167,"style":167},"yarn add secure-exec\n","yarn",[154,576,577],{"__ignoreMap":167},[171,578,579,581,583],{"class":173,"line":174},[171,580,574],{"class":548},[171,582,552],{"class":551},[171,584,555],{"class":551},[161,586,589],{"className":538,"code":587,"filename":588,"language":541,"meta":167,"style":167},"bun add secure-exec\n","bun",[154,590,591],{"__ignoreMap":167},[171,592,593,595,597],{"class":173,"line":174},[171,594,588],{"class":548},[171,596,552],{"class":551},[171,598,555],{"class":551},[319,600,603,604,606,607,610,611,614],{"color":601,"icon":602},"info","i-lucide-info","Code Mode requires ",[154,605,531],{}," and Node.js ",[154,608,609],{},">=18.16.0",". The rest of the module still supports Node.js 18.x, but code mode depends on ",[154,612,613],{},"AsyncLocalStorage.snapshot()"," to preserve request context.",[339,616,618],{"id":617},"_2-enable-on-a-handler","2. Enable on a handler",[150,620,621,622,625],{},"Add ",[154,623,624],{},"experimental_codeMode"," to any handler:",[534,627,628,687],{},[161,629,634],{"className":630,"code":631,"filename":632,"language":633,"meta":167,"style":167},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F server\u002Fmcp\u002Findex.ts\nexport default defineMcpHandler({\n  experimental_codeMode: true,\n})\n","Default handler","typescript",[154,635,636,642,663,679],{"__ignoreMap":167},[171,637,638],{"class":173,"line":174},[171,639,641],{"class":640},"sHwdD","\u002F\u002F server\u002Fmcp\u002Findex.ts\n",[171,643,644,648,651,655,659],{"class":173,"line":180},[171,645,647],{"class":646},"s7zQu","export",[171,649,650],{"class":646}," default",[171,652,654],{"class":653},"s2Zo4"," defineMcpHandler",[171,656,658],{"class":657},"sTEyZ","(",[171,660,662],{"class":661},"sMK4o","{\n",[171,664,665,669,672,676],{"class":173,"line":187},[171,666,668],{"class":667},"swJcz","  experimental_codeMode",[171,670,671],{"class":661},":",[171,673,675],{"class":674},"sfNiH"," true",[171,677,678],{"class":661},",\n",[171,680,681,684],{"class":173,"line":193},[171,682,683],{"class":661},"}",[171,685,686],{"class":657},")\n",[161,688,691],{"className":630,"code":689,"filename":690,"language":633,"meta":167,"style":167},"\u002F\u002F server\u002Fmcp\u002Fai-agent.ts\nexport default defineMcpHandler({\n  name: 'ai-agent',\n  experimental_codeMode: true,\n  tools: [getUserTool, listTodosTool, createTodoTool],\n})\n","Custom handler",[154,692,693,698,710,728,738,761],{"__ignoreMap":167},[171,694,695],{"class":173,"line":174},[171,696,697],{"class":640},"\u002F\u002F server\u002Fmcp\u002Fai-agent.ts\n",[171,699,700,702,704,706,708],{"class":173,"line":180},[171,701,647],{"class":646},[171,703,650],{"class":646},[171,705,654],{"class":653},[171,707,658],{"class":657},[171,709,662],{"class":661},[171,711,712,715,717,720,723,726],{"class":173,"line":187},[171,713,714],{"class":667},"  name",[171,716,671],{"class":661},[171,718,719],{"class":661}," '",[171,721,722],{"class":551},"ai-agent",[171,724,725],{"class":661},"'",[171,727,678],{"class":661},[171,729,730,732,734,736],{"class":173,"line":193},[171,731,668],{"class":667},[171,733,671],{"class":661},[171,735,675],{"class":674},[171,737,678],{"class":661},[171,739,740,743,745,748,751,754,756,759],{"class":173,"line":199},[171,741,742],{"class":667},"  tools",[171,744,671],{"class":661},[171,746,747],{"class":657}," [getUserTool",[171,749,750],{"class":661},",",[171,752,753],{"class":657}," listTodosTool",[171,755,750],{"class":661},[171,757,758],{"class":657}," createTodoTool]",[171,760,678],{"class":661},[171,762,763,765],{"class":173,"line":205},[171,764,683],{"class":661},[171,766,686],{"class":657},[150,768,769,770,772],{},"That's it. The module replaces all your tools with a single ",[154,771,154],{}," tool that the LLM uses to orchestrate them.",[145,774,776],{"id":775},"how-it-works","How It Works",[150,778,779],{},"When Code Mode is enabled:",[781,782,783,786,792,799],"ol",{},[477,784,785],{},"All registered tools are converted to TypeScript type definitions",[477,787,788,789,791],{},"A ",[154,790,154],{}," tool is created with those types embedded in its description",[477,793,794,795,798],{},"The LLM writes JavaScript using a ",[154,796,797],{},"codemode"," object to call tools",[477,800,801],{},"The code runs in a V8 isolate with only RPC access to your tools",[339,803,805],{"id":804},"example-what-the-llm-generates","Example: what the LLM generates",[150,807,808,809,812,813,816,817,820],{},"Given tools ",[154,810,811],{},"get-user",", ",[154,814,815],{},"list-todos",", and ",[154,818,819],{},"create-todo",", the LLM receives type definitions and writes code like:",[534,822,823,1035,1208],{},[161,824,829],{"className":825,"code":826,"filename":827,"language":828,"meta":167,"style":167},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const user = await codemode.get_user({ id: \"123\" });\nconst todos = await codemode.list_todos({ userId: user.id });\n\nif (todos.length === 0) {\n  await codemode.create_todo({\n    title: \"Welcome task\",\n    userId: user.id,\n  });\n}\n\nreturn { user, todos };\n","Sequential calls","javascript",[154,830,831,882,923,927,952,968,984,1000,1009,1014,1018],{"__ignoreMap":167},[171,832,833,837,840,843,846,849,851,854,856,859,862,864,867,870,873,876,879],{"class":173,"line":174},[171,834,836],{"class":835},"spNyl","const",[171,838,839],{"class":657}," user ",[171,841,842],{"class":661},"=",[171,844,845],{"class":646}," await",[171,847,848],{"class":657}," codemode",[171,850,452],{"class":661},[171,852,853],{"class":653},"get_user",[171,855,658],{"class":657},[171,857,858],{"class":661},"{",[171,860,861],{"class":667}," id",[171,863,671],{"class":661},[171,865,866],{"class":661}," \"",[171,868,869],{"class":551},"123",[171,871,872],{"class":661},"\"",[171,874,875],{"class":661}," }",[171,877,878],{"class":657},")",[171,880,881],{"class":661},";\n",[171,883,884,886,889,891,893,895,897,900,902,904,907,909,912,914,917,919,921],{"class":173,"line":180},[171,885,836],{"class":835},[171,887,888],{"class":657}," todos ",[171,890,842],{"class":661},[171,892,845],{"class":646},[171,894,848],{"class":657},[171,896,452],{"class":661},[171,898,899],{"class":653},"list_todos",[171,901,658],{"class":657},[171,903,858],{"class":661},[171,905,906],{"class":667}," userId",[171,908,671],{"class":661},[171,910,911],{"class":657}," user",[171,913,452],{"class":661},[171,915,916],{"class":657},"id ",[171,918,683],{"class":661},[171,920,878],{"class":657},[171,922,881],{"class":661},[171,924,925],{"class":173,"line":187},[171,926,184],{"emptyLinePlaceholder":183},[171,928,929,932,935,937,940,943,947,950],{"class":173,"line":193},[171,930,931],{"class":646},"if",[171,933,934],{"class":657}," (todos",[171,936,452],{"class":661},[171,938,939],{"class":657},"length ",[171,941,942],{"class":661},"===",[171,944,946],{"class":945},"sbssI"," 0",[171,948,949],{"class":657},") ",[171,951,662],{"class":661},[171,953,954,957,959,961,964,966],{"class":173,"line":199},[171,955,956],{"class":646},"  await",[171,958,848],{"class":657},[171,960,452],{"class":661},[171,962,963],{"class":653},"create_todo",[171,965,658],{"class":667},[171,967,662],{"class":661},[171,969,970,973,975,977,980,982],{"class":173,"line":205},[171,971,972],{"class":667},"    title",[171,974,671],{"class":661},[171,976,866],{"class":661},[171,978,979],{"class":551},"Welcome task",[171,981,872],{"class":661},[171,983,678],{"class":661},[171,985,986,989,991,993,995,998],{"class":173,"line":211},[171,987,988],{"class":667},"    userId",[171,990,671],{"class":661},[171,992,911],{"class":657},[171,994,452],{"class":661},[171,996,997],{"class":657},"id",[171,999,678],{"class":661},[171,1001,1002,1005,1007],{"class":173,"line":217},[171,1003,1004],{"class":661},"  }",[171,1006,878],{"class":667},[171,1008,881],{"class":661},[171,1010,1011],{"class":173,"line":223},[171,1012,1013],{"class":661},"}\n",[171,1015,1016],{"class":173,"line":229},[171,1017,184],{"emptyLinePlaceholder":183},[171,1019,1020,1023,1026,1028,1030,1032],{"class":173,"line":235},[171,1021,1022],{"class":646},"return",[171,1024,1025],{"class":661}," {",[171,1027,911],{"class":657},[171,1029,750],{"class":661},[171,1031,888],{"class":657},[171,1033,1034],{"class":661},"};\n",[161,1036,1039],{"className":825,"code":1037,"filename":1038,"language":828,"meta":167,"style":167},"const [users, products, orders] = await Promise.all([\n  codemode.list_users(),\n  codemode.list_products(),\n  codemode.list_orders({ status: \"pending\" }),\n]);\n\nreturn {\n  userCount: users.length,\n  productCount: products.length,\n  pendingOrders: orders.length,\n};\n","Parallel calls",[154,1040,1041,1080,1095,1108,1139,1146,1150,1157,1174,1189,1204],{"__ignoreMap":167},[171,1042,1043,1045,1048,1051,1053,1056,1058,1061,1064,1067,1069,1072,1074,1077],{"class":173,"line":174},[171,1044,836],{"class":835},[171,1046,1047],{"class":661}," [",[171,1049,1050],{"class":657},"users",[171,1052,750],{"class":661},[171,1054,1055],{"class":657}," products",[171,1057,750],{"class":661},[171,1059,1060],{"class":657}," orders",[171,1062,1063],{"class":661},"]",[171,1065,1066],{"class":661}," =",[171,1068,845],{"class":646},[171,1070,1071],{"class":548}," Promise",[171,1073,452],{"class":661},[171,1075,1076],{"class":653},"all",[171,1078,1079],{"class":657},"([\n",[171,1081,1082,1085,1087,1090,1093],{"class":173,"line":180},[171,1083,1084],{"class":657},"  codemode",[171,1086,452],{"class":661},[171,1088,1089],{"class":653},"list_users",[171,1091,1092],{"class":657},"()",[171,1094,678],{"class":661},[171,1096,1097,1099,1101,1104,1106],{"class":173,"line":187},[171,1098,1084],{"class":657},[171,1100,452],{"class":661},[171,1102,1103],{"class":653},"list_products",[171,1105,1092],{"class":657},[171,1107,678],{"class":661},[171,1109,1110,1112,1114,1117,1119,1121,1124,1126,1128,1131,1133,1135,1137],{"class":173,"line":193},[171,1111,1084],{"class":657},[171,1113,452],{"class":661},[171,1115,1116],{"class":653},"list_orders",[171,1118,658],{"class":657},[171,1120,858],{"class":661},[171,1122,1123],{"class":667}," status",[171,1125,671],{"class":661},[171,1127,866],{"class":661},[171,1129,1130],{"class":551},"pending",[171,1132,872],{"class":661},[171,1134,875],{"class":661},[171,1136,878],{"class":657},[171,1138,678],{"class":661},[171,1140,1141,1144],{"class":173,"line":199},[171,1142,1143],{"class":657},"])",[171,1145,881],{"class":661},[171,1147,1148],{"class":173,"line":205},[171,1149,184],{"emptyLinePlaceholder":183},[171,1151,1152,1154],{"class":173,"line":211},[171,1153,1022],{"class":646},[171,1155,1156],{"class":661}," {\n",[171,1158,1159,1162,1164,1167,1169,1172],{"class":173,"line":217},[171,1160,1161],{"class":667},"  userCount",[171,1163,671],{"class":661},[171,1165,1166],{"class":657}," users",[171,1168,452],{"class":661},[171,1170,1171],{"class":657},"length",[171,1173,678],{"class":661},[171,1175,1176,1179,1181,1183,1185,1187],{"class":173,"line":223},[171,1177,1178],{"class":667},"  productCount",[171,1180,671],{"class":661},[171,1182,1055],{"class":657},[171,1184,452],{"class":661},[171,1186,1171],{"class":657},[171,1188,678],{"class":661},[171,1190,1191,1194,1196,1198,1200,1202],{"class":173,"line":229},[171,1192,1193],{"class":667},"  pendingOrders",[171,1195,671],{"class":661},[171,1197,1060],{"class":657},[171,1199,452],{"class":661},[171,1201,1171],{"class":657},[171,1203,678],{"class":661},[171,1205,1206],{"class":173,"line":235},[171,1207,1034],{"class":661},[161,1209,1212],{"className":825,"code":1210,"filename":1211,"language":828,"meta":167,"style":167},"const users = await codemode.list_users();\nconst results = [];\n\nfor (const user of users) {\n  const todos = await codemode.list_todos({ userId: user.id });\n  if (todos.some(t => t.overdue)) {\n    await codemode.send_reminder({ userId: user.id });\n    results.push(user.name);\n  }\n}\n\nreturn { reminded: results };\n","Loop + conditional",[154,1213,1214,1235,1249,1253,1272,1310,1347,1379,1403,1408,1412,1416],{"__ignoreMap":167},[171,1215,1216,1218,1221,1223,1225,1227,1229,1231,1233],{"class":173,"line":174},[171,1217,836],{"class":835},[171,1219,1220],{"class":657}," users ",[171,1222,842],{"class":661},[171,1224,845],{"class":646},[171,1226,848],{"class":657},[171,1228,452],{"class":661},[171,1230,1089],{"class":653},[171,1232,1092],{"class":657},[171,1234,881],{"class":661},[171,1236,1237,1239,1242,1244,1247],{"class":173,"line":180},[171,1238,836],{"class":835},[171,1240,1241],{"class":657}," results ",[171,1243,842],{"class":661},[171,1245,1246],{"class":657}," []",[171,1248,881],{"class":661},[171,1250,1251],{"class":173,"line":187},[171,1252,184],{"emptyLinePlaceholder":183},[171,1254,1255,1257,1260,1262,1264,1267,1270],{"class":173,"line":193},[171,1256,503],{"class":646},[171,1258,1259],{"class":657}," (",[171,1261,836],{"class":835},[171,1263,839],{"class":657},[171,1265,1266],{"class":661},"of",[171,1268,1269],{"class":657}," users) ",[171,1271,662],{"class":661},[171,1273,1274,1277,1280,1282,1284,1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1306,1308],{"class":173,"line":199},[171,1275,1276],{"class":835},"  const",[171,1278,1279],{"class":657}," todos",[171,1281,1066],{"class":661},[171,1283,845],{"class":646},[171,1285,848],{"class":657},[171,1287,452],{"class":661},[171,1289,899],{"class":653},[171,1291,658],{"class":667},[171,1293,858],{"class":661},[171,1295,906],{"class":667},[171,1297,671],{"class":661},[171,1299,911],{"class":657},[171,1301,452],{"class":661},[171,1303,997],{"class":657},[171,1305,875],{"class":661},[171,1307,878],{"class":667},[171,1309,881],{"class":661},[171,1311,1312,1315,1317,1320,1322,1325,1327,1331,1334,1337,1339,1342,1345],{"class":173,"line":205},[171,1313,1314],{"class":646},"  if",[171,1316,1259],{"class":667},[171,1318,1319],{"class":657},"todos",[171,1321,452],{"class":661},[171,1323,1324],{"class":653},"some",[171,1326,658],{"class":667},[171,1328,1330],{"class":1329},"sHdIc","t",[171,1332,1333],{"class":835}," =>",[171,1335,1336],{"class":657}," t",[171,1338,452],{"class":661},[171,1340,1341],{"class":657},"overdue",[171,1343,1344],{"class":667},")) ",[171,1346,662],{"class":661},[171,1348,1349,1352,1354,1356,1359,1361,1363,1365,1367,1369,1371,1373,1375,1377],{"class":173,"line":211},[171,1350,1351],{"class":646},"    await",[171,1353,848],{"class":657},[171,1355,452],{"class":661},[171,1357,1358],{"class":653},"send_reminder",[171,1360,658],{"class":667},[171,1362,858],{"class":661},[171,1364,906],{"class":667},[171,1366,671],{"class":661},[171,1368,911],{"class":657},[171,1370,452],{"class":661},[171,1372,997],{"class":657},[171,1374,875],{"class":661},[171,1376,878],{"class":667},[171,1378,881],{"class":661},[171,1380,1381,1384,1386,1389,1391,1394,1396,1399,1401],{"class":173,"line":217},[171,1382,1383],{"class":657},"    results",[171,1385,452],{"class":661},[171,1387,1388],{"class":653},"push",[171,1390,658],{"class":667},[171,1392,1393],{"class":657},"user",[171,1395,452],{"class":661},[171,1397,1398],{"class":657},"name",[171,1400,878],{"class":667},[171,1402,881],{"class":661},[171,1404,1405],{"class":173,"line":223},[171,1406,1407],{"class":661},"  }\n",[171,1409,1410],{"class":173,"line":229},[171,1411,1013],{"class":661},[171,1413,1414],{"class":173,"line":235},[171,1415,184],{"emptyLinePlaceholder":183},[171,1417,1418,1420,1422,1425,1427,1429],{"class":173,"line":240},[171,1419,1022],{"class":646},[171,1421,1025],{"class":661},[171,1423,1424],{"class":667}," reminded",[171,1426,671],{"class":661},[171,1428,1241],{"class":657},[171,1430,1034],{"class":661},[145,1432,1434],{"id":1433},"configuration-options","Configuration Options",[150,1436,1437,1438,1441],{},"Pass an options object instead of ",[154,1439,1440],{},"true"," for fine-grained control:",[161,1443,1446],{"className":630,"code":1444,"filename":1445,"language":633,"meta":167,"style":167},"export default defineMcpHandler({\n  experimental_codeMode: {\n    memoryLimit: 64,\n    cpuTimeLimitMs: 10_000,\n    maxResultSize: 102_400,\n    maxRequestBodyBytes: 1_048_576,\n    maxToolResponseSize: 1_048_576,\n    wallTimeLimitMs: 60_000,\n    maxToolCalls: 200,\n    progressive: false,\n    description: undefined,\n  },\n})\n","server\u002Fmcp\u002Findex.ts",[154,1447,1448,1460,1468,1480,1492,1504,1516,1527,1539,1551,1563,1573,1578],{"__ignoreMap":167},[171,1449,1450,1452,1454,1456,1458],{"class":173,"line":174},[171,1451,647],{"class":646},[171,1453,650],{"class":646},[171,1455,654],{"class":653},[171,1457,658],{"class":657},[171,1459,662],{"class":661},[171,1461,1462,1464,1466],{"class":173,"line":180},[171,1463,668],{"class":667},[171,1465,671],{"class":661},[171,1467,1156],{"class":661},[171,1469,1470,1473,1475,1478],{"class":173,"line":187},[171,1471,1472],{"class":667},"    memoryLimit",[171,1474,671],{"class":661},[171,1476,1477],{"class":945}," 64",[171,1479,678],{"class":661},[171,1481,1482,1485,1487,1490],{"class":173,"line":193},[171,1483,1484],{"class":667},"    cpuTimeLimitMs",[171,1486,671],{"class":661},[171,1488,1489],{"class":945}," 10_000",[171,1491,678],{"class":661},[171,1493,1494,1497,1499,1502],{"class":173,"line":199},[171,1495,1496],{"class":667},"    maxResultSize",[171,1498,671],{"class":661},[171,1500,1501],{"class":945}," 102_400",[171,1503,678],{"class":661},[171,1505,1506,1509,1511,1514],{"class":173,"line":205},[171,1507,1508],{"class":667},"    maxRequestBodyBytes",[171,1510,671],{"class":661},[171,1512,1513],{"class":945}," 1_048_576",[171,1515,678],{"class":661},[171,1517,1518,1521,1523,1525],{"class":173,"line":211},[171,1519,1520],{"class":667},"    maxToolResponseSize",[171,1522,671],{"class":661},[171,1524,1513],{"class":945},[171,1526,678],{"class":661},[171,1528,1529,1532,1534,1537],{"class":173,"line":217},[171,1530,1531],{"class":667},"    wallTimeLimitMs",[171,1533,671],{"class":661},[171,1535,1536],{"class":945}," 60_000",[171,1538,678],{"class":661},[171,1540,1541,1544,1546,1549],{"class":173,"line":223},[171,1542,1543],{"class":667},"    maxToolCalls",[171,1545,671],{"class":661},[171,1547,1548],{"class":945}," 200",[171,1550,678],{"class":661},[171,1552,1553,1556,1558,1561],{"class":173,"line":229},[171,1554,1555],{"class":667},"    progressive",[171,1557,671],{"class":661},[171,1559,1560],{"class":674}," false",[171,1562,678],{"class":661},[171,1564,1565,1568,1570],{"class":173,"line":235},[171,1566,1567],{"class":667},"    description",[171,1569,671],{"class":661},[171,1571,1572],{"class":661}," undefined,\n",[171,1574,1575],{"class":173,"line":240},[171,1576,1577],{"class":661},"  },\n",[171,1579,1581,1583],{"class":173,"line":1580},13,[171,1582,683],{"class":661},[171,1584,686],{"class":657},[1586,1587,1588,1606,1617,1629,1651,1663,1681,1692,1709],"field-group",{},[1589,1590,1593,1599],"field",{"name":1591,"type":1592},"memoryLimit","number",[150,1594,1595,1596],{},"Default: ",[154,1597,1598],{},"64",[150,1600,1601,1602,1605],{},"V8 isolate memory limit in MB. Set once at first execution — call ",[154,1603,1604],{},"disposeCodeMode()"," to change.",[1589,1607,1609,1614],{"name":1608,"type":1592},"cpuTimeLimitMs",[150,1610,1595,1611],{},[154,1612,1613],{},"10000",[150,1615,1616],{},"CPU time limit per execution in milliseconds. The sandbox is killed after this duration.",[1589,1618,1620,1626],{"name":1619,"type":1592},"maxResultSize",[150,1621,1595,1622,1625],{},[154,1623,1624],{},"102400"," (100 KB)",[150,1627,1628],{},"Maximum result size in bytes before truncation. Large results are intelligently truncated — arrays by number of items, objects by number of keys.",[1589,1630,1632,1638],{"name":1631,"type":1592},"maxRequestBodyBytes",[150,1633,1595,1634,1637],{},[154,1635,1636],{},"1048576"," (1 MB)",[150,1639,1640,1641,1643,1644,1647,1648,1650],{},"Maximum bytes accepted in a single RPC request body from the sandbox. Returns HTTP 413 if exceeded. Prevents memory exhaustion from oversized payloads. Like ",[154,1642,1591],{},", this applies when the RPC server ",[270,1645,1646],{},"first"," starts; call ",[154,1649,1604],{}," before changing it.",[1589,1652,1654,1658],{"name":1653,"type":1592},"maxToolResponseSize",[150,1655,1595,1656,1637],{},[154,1657,1636],{},[150,1659,1660,1661,452],{},"Maximum bytes for individual tool RPC responses. Large results are truncated using the same strategy as ",[154,1662,1619],{},[1589,1664,1666,1672],{"name":1665,"type":1592},"wallTimeLimitMs",[150,1667,1595,1668,1671],{},[154,1669,1670],{},"60000"," (60 seconds)",[150,1673,1674,1675,1678,1679,452],{},"Per-execution deadline checked at the ",[270,1676,1677],{},"start of each"," sandbox→host RPC call (tool invocation or return value). After the deadline, the next RPC receives HTTP 408. This bounds host-side work (e.g. slow tools); pure CPU loops in the isolate are primarily limited by ",[154,1680,1608],{},[1589,1682,1684,1689],{"name":1683,"type":1592},"maxToolCalls",[150,1685,1595,1686],{},[154,1687,1688],{},"200",[150,1690,1691],{},"Maximum number of tool RPC calls per execution. Prevents runaway loops that repeatedly invoke expensive tools. Returns HTTP 429 when exceeded.",[1589,1693,1696,1701],{"name":1694,"type":1695},"progressive","boolean",[150,1697,1595,1698],{},[154,1699,1700],{},"false",[150,1702,1703,1704,1708],{},"Enable progressive disclosure mode. See ",[526,1705,1707],{"href":1706},"#progressive-mode","Progressive Mode"," below.",[1589,1710,1713,1716],{"name":1711,"type":1712},"description","string",[150,1714,1715],{},"Default: built-in template",[150,1717,1718,1719,1721,1722,1725,1726,1729],{},"Custom description for the ",[154,1720,154],{}," tool. Supports ",[154,1723,1724],{},"{{types}}"," and ",[154,1727,1728],{},"{{count}}"," placeholders.",[145,1731,1707],{"id":1732},"progressive-mode",[150,1734,1735,1736,1738],{},"When your server exposes many tools (50+), embedding all type definitions in the ",[154,1737,154],{}," tool description becomes expensive in tokens. Progressive mode solves this by splitting into two tools:",[781,1740,1741,1749],{},[477,1742,1743,1748],{},[270,1744,1745],{},[154,1746,1747],{},"search"," — discovers tools by keyword, returns their signatures",[477,1750,1751,1755],{},[270,1752,1753],{},[154,1754,154],{}," — executes code using discovered tools",[161,1757,1759],{"className":630,"code":1758,"filename":1445,"language":633,"meta":167,"style":167},"export default defineMcpHandler({\n  experimental_codeMode: {\n    progressive: true,\n  },\n})\n",[154,1760,1761,1773,1781,1791,1795],{"__ignoreMap":167},[171,1762,1763,1765,1767,1769,1771],{"class":173,"line":174},[171,1764,647],{"class":646},[171,1766,650],{"class":646},[171,1768,654],{"class":653},[171,1770,658],{"class":657},[171,1772,662],{"class":661},[171,1774,1775,1777,1779],{"class":173,"line":180},[171,1776,668],{"class":667},[171,1778,671],{"class":661},[171,1780,1156],{"class":661},[171,1782,1783,1785,1787,1789],{"class":173,"line":187},[171,1784,1555],{"class":667},[171,1786,671],{"class":661},[171,1788,675],{"class":674},[171,1790,678],{"class":661},[171,1792,1793],{"class":173,"line":193},[171,1794,1577],{"class":661},[171,1796,1797,1799],{"class":173,"line":199},[171,1798,683],{"class":661},[171,1800,686],{"class":657},[150,1802,1803],{},"The LLM workflow becomes:",[534,1805,1806,1836],{},[161,1807,1810],{"className":163,"code":1808,"filename":1809,"language":166,"meta":167,"style":167},"LLM calls: search({ query: \"user\" })\n\n→ Found 2\u002F12 tools matching \"user\":\n  codemode.get_user: (input: { id: string }) => Promise\u003Cunknown>; \u002F\u002F Get user by ID\n  codemode.list_users: () => Promise\u003Cunknown>; \u002F\u002F List all users\n","Step 1 — Search",[154,1811,1812,1817,1821,1826,1831],{"__ignoreMap":167},[171,1813,1814],{"class":173,"line":174},[171,1815,1816],{},"LLM calls: search({ query: \"user\" })\n",[171,1818,1819],{"class":173,"line":180},[171,1820,184],{"emptyLinePlaceholder":183},[171,1822,1823],{"class":173,"line":187},[171,1824,1825],{},"→ Found 2\u002F12 tools matching \"user\":\n",[171,1827,1828],{"class":173,"line":193},[171,1829,1830],{},"  codemode.get_user: (input: { id: string }) => Promise\u003Cunknown>; \u002F\u002F Get user by ID\n",[171,1832,1833],{"class":173,"line":199},[171,1834,1835],{},"  codemode.list_users: () => Promise\u003Cunknown>; \u002F\u002F List all users\n",[161,1837,1840],{"className":163,"code":1838,"filename":1839,"language":166,"meta":167,"style":167},"LLM calls: code({ code: \"...\" })\n\n→ Executes code using the discovered tools\n","Step 2 — Execute",[154,1841,1842,1847,1851],{"__ignoreMap":167},[171,1843,1844],{"class":173,"line":174},[171,1845,1846],{},"LLM calls: code({ code: \"...\" })\n",[171,1848,1849],{"class":173,"line":180},[171,1850,184],{"emptyLinePlaceholder":183},[171,1852,1853],{"class":173,"line":187},[171,1854,1855],{},"→ Executes code using the discovered tools\n",[319,1857,1858],{"color":601,"icon":602},"Progressive mode adds an extra tool call but significantly reduces the initial prompt size. Only use it when you have a large number of tools — for small toolsets, standard mode is more efficient.",[145,1860,1862],{"id":1861},"custom-description","Custom Description",[150,1864,1865,1866,1868],{},"Override the ",[154,1867,154],{}," tool description to customize LLM instructions:",[161,1870,1872],{"className":630,"code":1871,"filename":1445,"language":633,"meta":167,"style":167},"export default defineMcpHandler({\n  experimental_codeMode: {\n    description: `You have {{count}} tools available. Write JavaScript using the codemode object.\n\n{{types}}\n\nAlways combine related operations into a single code block.`,\n  },\n})\n",[154,1873,1874,1886,1894,1906,1910,1915,1919,1929,1933],{"__ignoreMap":167},[171,1875,1876,1878,1880,1882,1884],{"class":173,"line":174},[171,1877,647],{"class":646},[171,1879,650],{"class":646},[171,1881,654],{"class":653},[171,1883,658],{"class":657},[171,1885,662],{"class":661},[171,1887,1888,1890,1892],{"class":173,"line":180},[171,1889,668],{"class":667},[171,1891,671],{"class":661},[171,1893,1156],{"class":661},[171,1895,1896,1898,1900,1903],{"class":173,"line":187},[171,1897,1567],{"class":667},[171,1899,671],{"class":661},[171,1901,1902],{"class":661}," `",[171,1904,1905],{"class":551},"You have {{count}} tools available. Write JavaScript using the codemode object.\n",[171,1907,1908],{"class":173,"line":193},[171,1909,184],{"emptyLinePlaceholder":183},[171,1911,1912],{"class":173,"line":199},[171,1913,1914],{"class":551},"{{types}}\n",[171,1916,1917],{"class":173,"line":205},[171,1918,184],{"emptyLinePlaceholder":183},[171,1920,1921,1924,1927],{"class":173,"line":211},[171,1922,1923],{"class":551},"Always combine related operations into a single code block.",[171,1925,1926],{"class":661},"`",[171,1928,678],{"class":661},[171,1930,1931],{"class":173,"line":217},[171,1932,1577],{"class":661},[171,1934,1935,1937],{"class":173,"line":223},[171,1936,683],{"class":661},[171,1938,686],{"class":657},[150,1940,1941,1942,1944,1945,1947],{},"The ",[154,1943,1724],{}," placeholder is replaced with the generated TypeScript definitions. The ",[154,1946,1728],{}," placeholder is replaced with the number of available tools.",[150,1949,1950,1951,1953,1954,1956],{},"In progressive mode, ",[154,1952,1724],{}," is not available since types are discovered via the ",[154,1955,1747],{}," tool.",[145,1958,1960],{"id":1959},"security","Security",[150,1962,1963,1964,1967],{},"Running LLM-generated code requires serious security measures. Code Mode implements ",[270,1965,1966],{},"defense in depth"," across 7 layers to ensure the sandbox cannot escape, access unauthorized resources, or exhaust host resources.",[339,1969,1971],{"id":1970},"sandbox-isolation","Sandbox Isolation",[150,1973,1974,1975,1980,1981,1983],{},"LLM-generated code runs in a separate ",[526,1976,1979],{"href":1977,"rel":1978},"https:\u002F\u002Fv8.dev\u002Fdocs\u002Fembed",[530],"V8 isolate"," via ",[154,1982,531],{},". This is the same isolation technology used by Cloudflare Workers and similar platforms. The sandbox has:",[474,1985,1986,1992,2014,2020],{},[477,1987,1988,1991],{},[270,1989,1990],{},"No filesystem access"," — cannot read, write, or list files",[477,1993,1994,1997,1998,812,2001,812,2004,812,2007,812,2010,2013],{},[270,1995,1996],{},"No Node.js APIs"," — no ",[154,1999,2000],{},"require()",[154,2002,2003],{},"import()",[154,2005,2006],{},"process",[154,2008,2009],{},"fs",[154,2011,2012],{},"child_process",", etc.",[477,2015,2016,2019],{},[270,2017,2018],{},"No environment variables"," — cannot read secrets or configuration",[477,2021,2022,2025],{},[270,2023,2024],{},"No host process access"," — cannot modify the parent process in any way",[339,2027,2029],{"id":2028},"network-restrictions","Network Restrictions",[150,2031,2032],{},"The sandbox can only communicate with the internal RPC server. All other network access is blocked:",[474,2034,2035,2041,2054,2060],{},[477,2036,2037,2040],{},[270,2038,2039],{},"Port-locked"," — Only the randomly-assigned RPC port is accessible. Other localhost services (databases, admin panels, other apps) are blocked.",[477,2042,2043,2046,2047,1725,2050,2053],{},[270,2044,2045],{},"Host-locked"," — Only ",[154,2048,2049],{},"127.0.0.1",[154,2051,2052],{},"localhost"," are allowed. External hosts are rejected.",[477,2055,2056,2059],{},[270,2057,2058],{},"No DNS"," — DNS resolution is disabled entirely.",[477,2061,2062,2065,2066,2069],{},[270,2063,2064],{},"No redirects"," — HTTP redirects are rejected (",[154,2067,2068],{},"redirect: 'error'","), preventing SSRF via open redirects.",[339,2071,2073],{"id":2072},"rpc-authentication","RPC Authentication",[150,2075,2076],{},"Communication between the sandbox and the host uses a per-session cryptographic token:",[474,2078,2079,2089,2099],{},[477,2080,2081,2084,2085,2088],{},[270,2082,2083],{},"256-bit token"," — Generated with ",[154,2086,2087],{},"crypto.randomBytes(32)"," at RPC server startup.",[477,2090,2091,2094,2095,2098],{},[270,2092,2093],{},"Header-based auth"," — Every request must include the token via ",[154,2096,2097],{},"x-rpc-token"," header.",[477,2100,2101,2104],{},[270,2102,2103],{},"403 on mismatch"," — Requests without a valid token are rejected immediately.",[150,2106,2107],{},"This prevents other local processes from calling your MCP tools through the RPC port.",[339,2109,2111],{"id":2110},"resource-limits","Resource Limits",[245,2113,2114,2130],{},[248,2115,2116],{},[251,2117,2118,2121,2124,2127],{},[254,2119,2120],{},"Resource",[254,2122,2123],{},"Default",[254,2125,2126],{},"Configurable",[254,2128,2129],{},"Protection",[262,2131,2132,2149,2166,2183,2200,2217,2233,2249],{},[251,2133,2134,2139,2142,2146],{},[267,2135,2136],{},[270,2137,2138],{},"CPU time",[267,2140,2141],{},"10 seconds",[267,2143,2144],{},[154,2145,1608],{},[267,2147,2148],{},"Sandbox is killed on timeout — prevents infinite loops",[251,2150,2151,2156,2159,2163],{},[267,2152,2153],{},[270,2154,2155],{},"Wall-clock deadline",[267,2157,2158],{},"60 seconds",[267,2160,2161],{},[154,2162,1665],{},[267,2164,2165],{},"Enforced on each RPC from the sandbox — stops further tool\u002Freturn RPCs after the deadline",[251,2167,2168,2173,2176,2180],{},[267,2169,2170],{},[270,2171,2172],{},"Memory",[267,2174,2175],{},"64 MB",[267,2177,2178],{},[154,2179,1591],{},[267,2181,2182],{},"V8 isolate hard limit — prevents OOM crashes",[251,2184,2185,2190,2193,2197],{},[267,2186,2187],{},[270,2188,2189],{},"Result size",[267,2191,2192],{},"100 KB",[267,2194,2195],{},[154,2196,1619],{},[267,2198,2199],{},"Intelligent truncation (arrays by items, objects by keys)",[251,2201,2202,2207,2210,2214],{},[267,2203,2204],{},[270,2205,2206],{},"Tool response size",[267,2208,2209],{},"1 MB",[267,2211,2212],{},[154,2213,1653],{},[267,2215,2216],{},"Per-call truncation before response delivery",[251,2218,2219,2224,2226,2230],{},[267,2220,2221],{},[270,2222,2223],{},"Request body size",[267,2225,2209],{},[267,2227,2228],{},[154,2229,1631],{},[267,2231,2232],{},"HTTP 413 early rejection — prevents memory exhaustion",[251,2234,2235,2240,2242,2246],{},[267,2236,2237],{},[270,2238,2239],{},"Tool calls per execution",[267,2241,1688],{},[267,2243,2244],{},[154,2245,1683],{},[267,2247,2248],{},"HTTP 429 rate limit — prevents runaway loops",[251,2250,2251,2256,2258,2261],{},[267,2252,2253],{},[270,2254,2255],{},"Log entries",[267,2257,1688],{},[267,2259,2260],{},"No",[267,2262,2263,2264,2267],{},"Console output capped — prevents ",[154,2265,2266],{},"console.log"," flooding",[339,2269,2271],{"id":2270},"input-validation","Input Validation",[150,2273,2274],{},"Tool names are interpolated into the sandbox code template. To prevent code injection:",[474,2276,2277,2287,2299],{},[477,2278,2279,2282,2283,2286],{},[270,2280,2281],{},"Strict identifier regex"," — Every tool name is validated against ",[154,2284,2285],{},"\u002F^[\\w$]+$\u002F"," before being injected into the sandbox template.",[477,2288,2289,2292,2293,2295,2296,2298],{},[270,2290,2291],{},"Sanitization"," — Names are sanitized upstream (",[154,2294,811],{}," → ",[154,2297,853],{},"), but a second validation layer at the template level ensures defense in depth.",[477,2300,2301,2304],{},[270,2302,2303],{},"Rejection"," — If a name fails validation, the execution throws immediately — no partial injection.",[339,2306,2308],{"id":2307},"error-sanitization","Error Sanitization",[150,2310,2311,2312,2315],{},"Infrastructure errors (file paths, stack traces) are sanitized before being returned to the sandbox or the MCP client. Full error details are logged server-side with the ",[154,2313,2314],{},"[nuxt-mcp-toolkit]"," prefix for debugging.",[339,2317,2319],{"id":2318},"summary","Summary",[319,2321,2322,2323,2326],{"color":601,"icon":79},"The sandbox can ",[270,2324,2325],{},"only"," communicate with your registered MCP tools via the authenticated RPC bridge. It cannot access the filesystem, network, environment, or any other host resources.",[145,2328,2330],{"id":2329},"usage-with-other-features","Usage with Other Features",[150,2332,2333],{},"Code Mode is fully compatible with other module features. Your tools remain unchanged — only the way they are exposed to the LLM changes.",[534,2335,2336,2483,2644],{},[161,2337,2340],{"className":630,"code":2338,"filename":2339,"language":633,"meta":167,"style":167},"\u002F\u002F server\u002Fmcp\u002Findex.ts\nexport default defineMcpHandler({\n  experimental_codeMode: true,\n  middleware: async (event) => {\n    const user = await getUser(event)\n    if (!user) {\n      throw createError({ statusCode: 401 })\n    }\n    event.context.user = user\n  },\n})\n","With Middleware",[154,2341,2342,2346,2358,2368,2389,2409,2425,2449,2454,2473,2477],{"__ignoreMap":167},[171,2343,2344],{"class":173,"line":174},[171,2345,641],{"class":640},[171,2347,2348,2350,2352,2354,2356],{"class":173,"line":180},[171,2349,647],{"class":646},[171,2351,650],{"class":646},[171,2353,654],{"class":653},[171,2355,658],{"class":657},[171,2357,662],{"class":661},[171,2359,2360,2362,2364,2366],{"class":173,"line":187},[171,2361,668],{"class":667},[171,2363,671],{"class":661},[171,2365,675],{"class":674},[171,2367,678],{"class":661},[171,2369,2370,2373,2375,2378,2380,2383,2385,2387],{"class":173,"line":193},[171,2371,2372],{"class":653},"  middleware",[171,2374,671],{"class":661},[171,2376,2377],{"class":835}," async",[171,2379,1259],{"class":661},[171,2381,2382],{"class":1329},"event",[171,2384,878],{"class":661},[171,2386,1333],{"class":835},[171,2388,1156],{"class":661},[171,2390,2391,2394,2396,2398,2400,2403,2405,2407],{"class":173,"line":199},[171,2392,2393],{"class":835},"    const",[171,2395,911],{"class":657},[171,2397,1066],{"class":661},[171,2399,845],{"class":646},[171,2401,2402],{"class":653}," getUser",[171,2404,658],{"class":667},[171,2406,2382],{"class":657},[171,2408,686],{"class":667},[171,2410,2411,2414,2416,2419,2421,2423],{"class":173,"line":205},[171,2412,2413],{"class":646},"    if",[171,2415,1259],{"class":667},[171,2417,2418],{"class":661},"!",[171,2420,1393],{"class":657},[171,2422,949],{"class":667},[171,2424,662],{"class":661},[171,2426,2427,2430,2433,2435,2437,2440,2442,2445,2447],{"class":173,"line":211},[171,2428,2429],{"class":646},"      throw",[171,2431,2432],{"class":653}," createError",[171,2434,658],{"class":667},[171,2436,858],{"class":661},[171,2438,2439],{"class":667}," statusCode",[171,2441,671],{"class":661},[171,2443,2444],{"class":945}," 401",[171,2446,875],{"class":661},[171,2448,686],{"class":667},[171,2450,2451],{"class":173,"line":217},[171,2452,2453],{"class":661},"    }\n",[171,2455,2456,2459,2461,2464,2466,2468,2470],{"class":173,"line":223},[171,2457,2458],{"class":657},"    event",[171,2460,452],{"class":661},[171,2462,2463],{"class":657},"context",[171,2465,452],{"class":661},[171,2467,1393],{"class":657},[171,2469,1066],{"class":661},[171,2471,2472],{"class":657}," user\n",[171,2474,2475],{"class":173,"line":229},[171,2476,1577],{"class":661},[171,2478,2479,2481],{"class":173,"line":235},[171,2480,683],{"class":661},[171,2482,686],{"class":657},[161,2484,2487],{"className":630,"code":2485,"filename":2486,"language":633,"meta":167,"style":167},"\u002F\u002F server\u002Fmcp\u002Ftools\u002Fadmin-tool.ts\nexport default defineMcpTool({\n  name: 'admin-delete',\n  description: 'Delete a resource (admin only)',\n  enabled: event => event.context.user?.role === 'admin',\n  inputSchema: {\n    id: z.string(),\n  },\n  handler: async ({ id }) => {\n    \u002F\u002F Only visible in code mode when user is admin\n  },\n})\n","With Dynamic Definitions",[154,2488,2489,2494,2507,2522,2538,2577,2586,2604,2608,2629,2634,2638],{"__ignoreMap":167},[171,2490,2491],{"class":173,"line":174},[171,2492,2493],{"class":640},"\u002F\u002F server\u002Fmcp\u002Ftools\u002Fadmin-tool.ts\n",[171,2495,2496,2498,2500,2503,2505],{"class":173,"line":180},[171,2497,647],{"class":646},[171,2499,650],{"class":646},[171,2501,2502],{"class":653}," defineMcpTool",[171,2504,658],{"class":657},[171,2506,662],{"class":661},[171,2508,2509,2511,2513,2515,2518,2520],{"class":173,"line":187},[171,2510,714],{"class":667},[171,2512,671],{"class":661},[171,2514,719],{"class":661},[171,2516,2517],{"class":551},"admin-delete",[171,2519,725],{"class":661},[171,2521,678],{"class":661},[171,2523,2524,2527,2529,2531,2534,2536],{"class":173,"line":193},[171,2525,2526],{"class":667},"  description",[171,2528,671],{"class":661},[171,2530,719],{"class":661},[171,2532,2533],{"class":551},"Delete a resource (admin only)",[171,2535,725],{"class":661},[171,2537,678],{"class":661},[171,2539,2540,2543,2545,2548,2550,2552,2554,2556,2558,2560,2563,2566,2568,2570,2573,2575],{"class":173,"line":199},[171,2541,2542],{"class":653},"  enabled",[171,2544,671],{"class":661},[171,2546,2547],{"class":1329}," event",[171,2549,1333],{"class":835},[171,2551,2547],{"class":657},[171,2553,452],{"class":661},[171,2555,2463],{"class":657},[171,2557,452],{"class":661},[171,2559,1393],{"class":657},[171,2561,2562],{"class":661},"?.",[171,2564,2565],{"class":657},"role ",[171,2567,942],{"class":661},[171,2569,719],{"class":661},[171,2571,2572],{"class":551},"admin",[171,2574,725],{"class":661},[171,2576,678],{"class":661},[171,2578,2579,2582,2584],{"class":173,"line":205},[171,2580,2581],{"class":667},"  inputSchema",[171,2583,671],{"class":661},[171,2585,1156],{"class":661},[171,2587,2588,2591,2593,2596,2598,2600,2602],{"class":173,"line":211},[171,2589,2590],{"class":667},"    id",[171,2592,671],{"class":661},[171,2594,2595],{"class":657}," z",[171,2597,452],{"class":661},[171,2599,1712],{"class":653},[171,2601,1092],{"class":657},[171,2603,678],{"class":661},[171,2605,2606],{"class":173,"line":217},[171,2607,1577],{"class":661},[171,2609,2610,2613,2615,2617,2620,2622,2625,2627],{"class":173,"line":223},[171,2611,2612],{"class":653},"  handler",[171,2614,671],{"class":661},[171,2616,2377],{"class":835},[171,2618,2619],{"class":661}," ({",[171,2621,861],{"class":1329},[171,2623,2624],{"class":661}," })",[171,2626,1333],{"class":835},[171,2628,1156],{"class":661},[171,2630,2631],{"class":173,"line":229},[171,2632,2633],{"class":640},"    \u002F\u002F Only visible in code mode when user is admin\n",[171,2635,2636],{"class":173,"line":235},[171,2637,1577],{"class":661},[171,2639,2640,2642],{"class":173,"line":240},[171,2641,683],{"class":661},[171,2643,686],{"class":657},[161,2645,2648],{"className":630,"code":2646,"filename":2647,"language":633,"meta":167,"style":167},"\u002F\u002F server\u002Fmcp\u002Findex.ts\nexport default defineMcpHandler({\n  experimental_codeMode: {\n    progressive: true,\n    cpuTimeLimitMs: 15_000,\n  },\n  middleware: async (event) => {\n    const apiKey = getHeader(event, 'x-api-key')\n    if (!apiKey) throw createError({ statusCode: 401 })\n    event.context.user = await getUserByApiKey(apiKey)\n  },\n})\n","With Progressive + Auth",[154,2649,2650,2654,2666,2674,2684,2695,2699,2717,2744,2776,2801,2805],{"__ignoreMap":167},[171,2651,2652],{"class":173,"line":174},[171,2653,641],{"class":640},[171,2655,2656,2658,2660,2662,2664],{"class":173,"line":180},[171,2657,647],{"class":646},[171,2659,650],{"class":646},[171,2661,654],{"class":653},[171,2663,658],{"class":657},[171,2665,662],{"class":661},[171,2667,2668,2670,2672],{"class":173,"line":187},[171,2669,668],{"class":667},[171,2671,671],{"class":661},[171,2673,1156],{"class":661},[171,2675,2676,2678,2680,2682],{"class":173,"line":193},[171,2677,1555],{"class":667},[171,2679,671],{"class":661},[171,2681,675],{"class":674},[171,2683,678],{"class":661},[171,2685,2686,2688,2690,2693],{"class":173,"line":199},[171,2687,1484],{"class":667},[171,2689,671],{"class":661},[171,2691,2692],{"class":945}," 15_000",[171,2694,678],{"class":661},[171,2696,2697],{"class":173,"line":205},[171,2698,1577],{"class":661},[171,2700,2701,2703,2705,2707,2709,2711,2713,2715],{"class":173,"line":211},[171,2702,2372],{"class":653},[171,2704,671],{"class":661},[171,2706,2377],{"class":835},[171,2708,1259],{"class":661},[171,2710,2382],{"class":1329},[171,2712,878],{"class":661},[171,2714,1333],{"class":835},[171,2716,1156],{"class":661},[171,2718,2719,2721,2724,2726,2729,2731,2733,2735,2737,2740,2742],{"class":173,"line":217},[171,2720,2393],{"class":835},[171,2722,2723],{"class":657}," apiKey",[171,2725,1066],{"class":661},[171,2727,2728],{"class":653}," getHeader",[171,2730,658],{"class":667},[171,2732,2382],{"class":657},[171,2734,750],{"class":661},[171,2736,719],{"class":661},[171,2738,2739],{"class":551},"x-api-key",[171,2741,725],{"class":661},[171,2743,686],{"class":667},[171,2745,2746,2748,2750,2752,2755,2757,2760,2762,2764,2766,2768,2770,2772,2774],{"class":173,"line":223},[171,2747,2413],{"class":646},[171,2749,1259],{"class":667},[171,2751,2418],{"class":661},[171,2753,2754],{"class":657},"apiKey",[171,2756,949],{"class":667},[171,2758,2759],{"class":646},"throw",[171,2761,2432],{"class":653},[171,2763,658],{"class":667},[171,2765,858],{"class":661},[171,2767,2439],{"class":667},[171,2769,671],{"class":661},[171,2771,2444],{"class":945},[171,2773,875],{"class":661},[171,2775,686],{"class":667},[171,2777,2778,2780,2782,2784,2786,2788,2790,2792,2795,2797,2799],{"class":173,"line":229},[171,2779,2458],{"class":657},[171,2781,452],{"class":661},[171,2783,2463],{"class":657},[171,2785,452],{"class":661},[171,2787,1393],{"class":657},[171,2789,1066],{"class":661},[171,2791,845],{"class":646},[171,2793,2794],{"class":653}," getUserByApiKey",[171,2796,658],{"class":667},[171,2798,2754],{"class":657},[171,2800,686],{"class":667},[171,2802,2803],{"class":173,"line":235},[171,2804,1577],{"class":661},[171,2806,2807,2809],{"class":173,"line":240},[171,2808,683],{"class":661},[171,2810,686],{"class":657},[150,2812,2813,2815,2816,2819,2820,2826,2827,2829],{},[526,2814,76],{"href":77}," runs before tool execution — your tools access ",[154,2817,2818],{},"event.context"," as usual. Tools with ",[526,2821,2822,2825],{"href":102},[154,2823,2824],{},"enabled"," guards"," are excluded from the generated type definitions and the ",[154,2828,797],{}," object.",[145,2831,2833],{"id":2832},"tool-name-sanitization","Tool Name Sanitization",[150,2835,2836,2837,2839],{},"MCP tool names (kebab-case) are automatically converted to valid JavaScript identifiers for the ",[154,2838,797],{}," object:",[245,2841,2842,2852],{},[248,2843,2844],{},[251,2845,2846,2849],{},[254,2847,2848],{},"MCP Name",[254,2850,2851],{},"JavaScript Name",[262,2853,2854,2864,2874,2886],{},[251,2855,2856,2860],{},[267,2857,2858],{},[154,2859,811],{},[267,2861,2862],{},[154,2863,853],{},[251,2865,2866,2870],{},[267,2867,2868],{},[154,2869,815],{},[267,2871,2872],{},[154,2873,899],{},[251,2875,2876,2881],{},[267,2877,2878],{},[154,2879,2880],{},"123-tool",[267,2882,2883],{},[154,2884,2885],{},"_123_tool",[251,2887,2888,2893],{},[267,2889,2890],{},[154,2891,2892],{},"delete",[267,2894,2895],{},[154,2896,2897],{},"delete_",[150,2899,2900,2901,2904,2905,452],{},"Reserved JavaScript words are suffixed with ",[154,2902,2903],{},"_",". Names starting with a digit are prefixed with ",[154,2906,2903],{},[145,2908,2910],{"id":2909},"cleanup","Cleanup",[150,2912,2913,2914,2916],{},"Call ",[154,2915,1604],{}," during shutdown to release resources (V8 runtime, RPC server):",[161,2918,2920],{"className":630,"code":2919,"language":633,"meta":167,"style":167},"import { disposeCodeMode } from '#imports'\n\n\u002F\u002F In a shutdown hook or cleanup function\ndisposeCodeMode()\n",[154,2921,2922,2945,2949,2954],{"__ignoreMap":167},[171,2923,2924,2927,2929,2932,2934,2937,2939,2942],{"class":173,"line":174},[171,2925,2926],{"class":646},"import",[171,2928,1025],{"class":661},[171,2930,2931],{"class":657}," disposeCodeMode",[171,2933,875],{"class":661},[171,2935,2936],{"class":646}," from",[171,2938,719],{"class":661},[171,2940,2941],{"class":551},"#imports",[171,2943,2944],{"class":661},"'\n",[171,2946,2947],{"class":173,"line":180},[171,2948,184],{"emptyLinePlaceholder":183},[171,2950,2951],{"class":173,"line":187},[171,2952,2953],{"class":640},"\u002F\u002F In a shutdown hook or cleanup function\n",[171,2955,2956,2959],{"class":173,"line":193},[171,2957,2958],{"class":653},"disposeCodeMode",[171,2960,2961],{"class":657},"()\n",[145,2963,2965],{"id":2964},"next-steps","Next Steps",[474,2967,2968,2973,2978,2983],{},[477,2969,2970,2972],{},[526,2971,61],{"href":62}," - Create custom MCP endpoints",[477,2974,2975,2977],{},[526,2976,76],{"href":77}," - Add authentication",[477,2979,2980,2982],{},[526,2981,101],{"href":102}," - Conditionally register tools",[477,2984,2985,2988],{},[526,2986,2987],{"href":92},"Evals"," - Benchmark code mode vs standard MCP",[2990,2991,2992],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":167,"searchDepth":180,"depth":180,"links":2994},[2995,2996,3000,3004,3007,3008,3009,3010,3019,3020,3021,3022],{"id":147,"depth":180,"text":148},{"id":329,"depth":180,"text":330,"children":2997},[2998,2999],{"id":341,"depth":187,"text":342},{"id":468,"depth":187,"text":469},{"id":516,"depth":180,"text":517,"children":3001},[3002,3003],{"id":520,"depth":187,"text":521},{"id":617,"depth":187,"text":618},{"id":775,"depth":180,"text":776,"children":3005},[3006],{"id":804,"depth":187,"text":805},{"id":1433,"depth":180,"text":1434},{"id":1732,"depth":180,"text":1707},{"id":1861,"depth":180,"text":1862},{"id":1959,"depth":180,"text":1960,"children":3011},[3012,3013,3014,3015,3016,3017,3018],{"id":1970,"depth":187,"text":1971},{"id":2028,"depth":187,"text":2029},{"id":2072,"depth":187,"text":2073},{"id":2110,"depth":187,"text":2111},{"id":2270,"depth":187,"text":2271},{"id":2307,"depth":187,"text":2308},{"id":2318,"depth":187,"text":2319},{"id":2329,"depth":180,"text":2330},{"id":2832,"depth":180,"text":2833},{"id":2909,"depth":180,"text":2910},{"id":2964,"depth":180,"text":2965},"Let LLMs orchestrate multiple tool calls in a single JavaScript execution.","md",null,{},{"icon":109},{"title":106,"description":3029},"Reduce token usage and latency by letting LLMs write JavaScript that orchestrates MCP tools in a secure V8 sandbox.","HdvX4k1ijpZCQtri-cSeCrSFKMvK_c1nv2LcdmQXkKM",[3032,3034],{"title":101,"path":102,"stem":103,"description":3033,"icon":104,"children":-1},"Conditionally register tools, resources, and prompts based on authentication, roles, or request context.",{"title":116,"path":117,"stem":118,"description":3035,"icon":119,"children":-1},"Secure your MCP endpoints with Bearer token authentication.",1776256257606]