[{"data":1,"prerenderedAt":2540},["ShallowReactive",2],{"navigation_docs":3,"-advanced-logging":149,"-advanced-logging-surround":2535},[4,40,65,120],{"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,110,115],{"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},"Logging","\u002Fadvanced\u002Flogging","3.advanced\u002F10.logging","i-lucide-scroll-text",{"title":81,"path":82,"stem":83,"icon":84},"Middleware","\u002Fadvanced\u002Fmiddleware","3.advanced\u002F2.middleware","i-lucide-shield",{"title":86,"path":87,"stem":88,"icon":89},"TypeScript","\u002Fadvanced\u002Ftypescript","3.advanced\u002F3.typescript","i-lucide-type",{"title":91,"path":92,"stem":93,"icon":94},"Hooks","\u002Fadvanced\u002Fhooks","3.advanced\u002F4.hooks","i-lucide-webhook",{"title":96,"path":97,"stem":98,"icon":99},"MCP Evals","\u002Fadvanced\u002Fevals","3.advanced\u002F5.evals","i-lucide-flask-conical",{"title":101,"path":102,"stem":103,"icon":104},"Sessions","\u002Fadvanced\u002Fsessions","3.advanced\u002F6.sessions","i-lucide-database",{"title":106,"path":107,"stem":108,"icon":109},"Dynamic Definitions","\u002Fadvanced\u002Fdynamic-definitions","3.advanced\u002F7.dynamic-definitions","i-lucide-toggle-right",{"title":111,"path":112,"stem":113,"icon":114},"Code Mode","\u002Fadvanced\u002Fcode-mode","3.advanced\u002F8.code-mode","i-lucide-code",{"title":116,"path":117,"stem":118,"icon":119},"Elicitation","\u002Fadvanced\u002Felicitation","3.advanced\u002F9.elicitation","i-lucide-message-square-quote",{"title":121,"path":122,"stem":123,"children":124,"page":39},"Examples","\u002Fexamples","4.examples",[125,130,135,140,145],{"title":126,"path":127,"stem":128,"icon":129},"Authentication","\u002Fexamples\u002Fauthentication","4.examples\u002F1.authentication","i-lucide-shield-check",{"title":131,"path":132,"stem":133,"icon":134},"API Integration","\u002Fexamples\u002Fapi-integration","4.examples\u002F2.api-integration","i-lucide-globe",{"title":136,"path":137,"stem":138,"icon":139},"Common Patterns","\u002Fexamples\u002Fcommon-patterns","4.examples\u002F3.common-patterns","i-lucide-lightbulb",{"title":141,"path":142,"stem":143,"icon":144},"File Operations","\u002Fexamples\u002Ffile-operations","4.examples\u002F4.file-operations","i-lucide-file",{"title":146,"path":147,"stem":148,"icon":59},"Prompt Examples","\u002Fexamples\u002Fprompt-examples","4.examples\u002F5.prompt-examples",{"id":150,"title":76,"body":151,"description":2526,"extension":2527,"links":2528,"meta":2529,"navigation":2530,"path":77,"seo":2531,"stem":78,"__hash__":2534},"docs\u002F3.advanced\u002F10.logging.md",{"type":152,"value":153,"toc":2510},"minimark",[154,159,172,248,259,358,362,371,376,379,399,409,413,425,522,526,595,600,603,1219,1222,1260,1263,1408,1418,1422,1437,1443,1447,1454,1582,1617,1627,1957,1960,2104,2108,2124,2143,2231,2258,2271,2274,2400,2410,2421,2425,2466,2470,2506],[155,156,158],"h2",{"id":157},"two-channels-one-composable","Two Channels, One Composable",[160,161,162,166,167,171],"p",{},[163,164,165],"code",{},"useMcpLogger()"," exposes a ",[168,169,170],"strong",{},"split-channel"," API because the two destinations have very different audiences:",[173,174,175,191],"table",{},[176,177,178],"thead",{},[179,180,181,185,188],"tr",{},[182,183,184],"th",{},"Channel",[182,186,187],{},"Audience",[182,189,190],{},"API",[192,193,194,219],"tbody",{},[179,195,196,207,210],{},[197,198,199,202,203,206],"td",{},[168,200,201],{},"Client notifications"," (",[163,204,205],{},"notifications\u002Fmessage",")",[197,208,209],{},"The end user \u002F agent UI (Cursor, Claude, MCP Inspector, …)",[197,211,212,215,216],{},[163,213,214],{},"log.notify(...)",", ",[163,217,218],{},"log.notify.debug\u002Finfo\u002Fwarning\u002Ferror(...)",[179,220,221,234,237],{},[197,222,223,226,227,206],{},[168,224,225],{},"Wide events"," (server-side, powered by ",[228,229,233],"a",{"href":230,"rel":231},"https:\u002F\u002Fevlog.dev",[232],"nofollow","evlog",[197,235,236],{},"Operators, dev terminal, drains (Axiom, OTLP, Datadog, …)",[197,238,239,215,242,215,245],{},[163,240,241],{},"log.set(...)",[163,243,244],{},"log.event(...)",[163,246,247],{},"log.evlog",[160,249,250,251,254,255,258],{},"Notifications are ",[168,252,253],{},"user-facing"," and may end up in chat transcripts. Wide events are ",[168,256,257],{},"operator-facing",", pretty-printed in the dev terminal at the end of each request and shipped to drains in production.",[260,261,262],"code-collapse",{},[263,264,270],"pre",{"className":265,"code":266,"filename":267,"language":268,"meta":269,"style":269},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Add structured logging to my Nuxt MCP server (@nuxtjs\u002Fmcp-toolkit).\n\n- Use useMcpLogger() inside a tool handler (auto-imported)\n- log.notify.info({ … }) sends notifications\u002Fmessage to the connected MCP client\n- Shortcuts: log.notify.debug\u002Finfo\u002Fwarning\u002Ferror — respect logging\u002FsetLevel\n- log.set({ user: { id } }) accumulates context onto the request's evlog wide event\n- log.event('charge_started', { amount }) captures a discrete event in the same wide event\n- log.evlog gives you the underlying RequestLogger (fork, error, getContext, …)\n- Install the optional evlog peer dep to enable wide events: `pnpm add evlog`\n- Ship to Axiom \u002F Sentry \u002F Datadog \u002F OTLP \u002F HyperDX \u002F Better Stack \u002F PostHog with one Nitro plugin (`server\u002Fplugins\u002Fevlog-axiom.ts`)\n- Custom drains: register any `(ctx) => Promise\u003Cvoid>` on the `evlog:drain` hook\n- Disable observability entirely with mcp.logging: false (notify still works)\n\nDocs: https:\u002F\u002Fmcp-toolkit.nuxt.dev\u002Fadvanced\u002Flogging\n","Prompt","txt","",[163,271,272,280,287,293,299,305,311,317,323,329,335,341,347,352],{"__ignoreMap":269},[273,274,277],"span",{"class":275,"line":276},"line",1,[273,278,279],{},"Add structured logging to my Nuxt MCP server (@nuxtjs\u002Fmcp-toolkit).\n",[273,281,283],{"class":275,"line":282},2,[273,284,286],{"emptyLinePlaceholder":285},true,"\n",[273,288,290],{"class":275,"line":289},3,[273,291,292],{},"- Use useMcpLogger() inside a tool handler (auto-imported)\n",[273,294,296],{"class":275,"line":295},4,[273,297,298],{},"- log.notify.info({ … }) sends notifications\u002Fmessage to the connected MCP client\n",[273,300,302],{"class":275,"line":301},5,[273,303,304],{},"- Shortcuts: log.notify.debug\u002Finfo\u002Fwarning\u002Ferror — respect logging\u002FsetLevel\n",[273,306,308],{"class":275,"line":307},6,[273,309,310],{},"- log.set({ user: { id } }) accumulates context onto the request's evlog wide event\n",[273,312,314],{"class":275,"line":313},7,[273,315,316],{},"- log.event('charge_started', { amount }) captures a discrete event in the same wide event\n",[273,318,320],{"class":275,"line":319},8,[273,321,322],{},"- log.evlog gives you the underlying RequestLogger (fork, error, getContext, …)\n",[273,324,326],{"class":275,"line":325},9,[273,327,328],{},"- Install the optional evlog peer dep to enable wide events: `pnpm add evlog`\n",[273,330,332],{"class":275,"line":331},10,[273,333,334],{},"- Ship to Axiom \u002F Sentry \u002F Datadog \u002F OTLP \u002F HyperDX \u002F Better Stack \u002F PostHog with one Nitro plugin (`server\u002Fplugins\u002Fevlog-axiom.ts`)\n",[273,336,338],{"class":275,"line":337},11,[273,339,340],{},"- Custom drains: register any `(ctx) => Promise\u003Cvoid>` on the `evlog:drain` hook\n",[273,342,344],{"class":275,"line":343},12,[273,345,346],{},"- Disable observability entirely with mcp.logging: false (notify still works)\n",[273,348,350],{"class":275,"line":349},13,[273,351,286],{"emptyLinePlaceholder":285},[273,353,355],{"class":275,"line":354},14,[273,356,357],{},"Docs: https:\u002F\u002Fmcp-toolkit.nuxt.dev\u002Fadvanced\u002Flogging\n",[155,359,361],{"id":360},"setup","Setup",[160,363,364,366,367,370],{},[163,365,214],{}," works out of the box — no extra setup needed. Server-side wide events are powered by the optional ",[228,368,233],{"href":230,"rel":369},[232]," peer dependency.",[372,373,375],"h3",{"id":374},"enable-wide-events","Enable wide events",[160,377,378],{},"Install evlog alongside the toolkit:",[263,380,384],{"className":381,"code":382,"language":383,"meta":269,"style":269},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add evlog\n","bash",[163,385,386],{"__ignoreMap":269},[273,387,388,392,396],{"class":275,"line":276},[273,389,391],{"class":390},"sBMFI","pnpm",[273,393,395],{"class":394},"sfazB"," add",[273,397,398],{"class":394}," evlog\n",[160,400,401,402,215,405,408],{},"That's it. The toolkit auto-detects evlog and wires it into Nitro automatically — wide events show up in your dev terminal on every MCP request, with ",[163,403,404],{},"mcp.tool",[163,406,407],{},"mcp.session_id",", and friends already tagged.",[372,410,412],{"id":411},"configure-optional","Configure (optional)",[160,414,415,416,420,421,424],{},"Forward ",[228,417,419],{"href":230,"rel":418},[232],"evlog Nitro options"," under ",[163,422,423],{},"mcp.logging",":",[263,426,431],{"className":427,"code":428,"filename":429,"language":430,"meta":269,"style":269},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: ['@nuxtjs\u002Fmcp-toolkit'],\n  mcp: {\n    logging: {\n      \u002F\u002F Forward any evlog\u002Fnitro options here (drains, sampling, redaction, …)\n    },\n  },\n})\n","nuxt.config.ts","typescript",[163,432,433,454,479,489,498,504,509,514],{"__ignoreMap":269},[273,434,435,439,442,446,450],{"class":275,"line":276},[273,436,438],{"class":437},"s7zQu","export",[273,440,441],{"class":437}," default",[273,443,445],{"class":444},"s2Zo4"," defineNuxtConfig",[273,447,449],{"class":448},"sTEyZ","(",[273,451,453],{"class":452},"sMK4o","{\n",[273,455,456,460,462,465,468,471,473,476],{"class":275,"line":282},[273,457,459],{"class":458},"swJcz","  modules",[273,461,424],{"class":452},[273,463,464],{"class":448}," [",[273,466,467],{"class":452},"'",[273,469,470],{"class":394},"@nuxtjs\u002Fmcp-toolkit",[273,472,467],{"class":452},[273,474,475],{"class":448},"]",[273,477,478],{"class":452},",\n",[273,480,481,484,486],{"class":275,"line":289},[273,482,483],{"class":458},"  mcp",[273,485,424],{"class":452},[273,487,488],{"class":452}," {\n",[273,490,491,494,496],{"class":275,"line":295},[273,492,493],{"class":458},"    logging",[273,495,424],{"class":452},[273,497,488],{"class":452},[273,499,500],{"class":275,"line":301},[273,501,503],{"class":502},"sHwdD","      \u002F\u002F Forward any evlog\u002Fnitro options here (drains, sampling, redaction, …)\n",[273,505,506],{"class":275,"line":307},[273,507,508],{"class":452},"    },\n",[273,510,511],{"class":275,"line":313},[273,512,513],{"class":452},"  },\n",[273,515,516,519],{"class":275,"line":319},[273,517,518],{"class":452},"}",[273,520,521],{"class":448},")\n",[372,523,525],{"id":524},"force-on-opt-out","Force on \u002F opt out",[173,527,528,540],{},[176,529,530],{},[179,531,532,537],{},[182,533,534,536],{},[163,535,423],{}," value",[182,538,539],{},"Behavior",[192,541,542,556,570],{},[179,543,544,550],{},[197,545,546,549],{},[163,547,548],{},"undefined"," (default)",[197,551,552,553,555],{},"Auto-detect: on if ",[163,554,233],{}," is installed, off otherwise.",[179,557,558,564],{},[197,559,560,563],{},[163,561,562],{},"true"," or object",[197,565,566,567,569],{},"Force on. Build throws with install instructions if ",[163,568,233],{}," is missing.",[179,571,572,577],{},[197,573,574],{},[163,575,576],{},"false",[197,578,579,580,582,583,585,586,585,588,590,591,594],{},"Force off. ",[163,581,214],{}," keeps working; ",[163,584,241],{}," \u002F ",[163,587,244],{},[163,589,247],{}," throw an ",[163,592,593],{},"McpObservabilityNotEnabledError",".",[155,596,598],{"id":597},"usemcplogger",[163,599,165],{},[160,601,602],{},"Auto-imported. Must be called inside a tool, resource, or prompt handler.",[263,604,607],{"className":427,"code":605,"filename":606,"language":430,"meta":269,"style":269},"import { z } from 'zod'\nimport { defineMcpTool } from '@nuxtjs\u002Fmcp-toolkit\u002Fserver'\n\nexport default defineMcpTool({\n  name: 'charge_card',\n  description: 'Charge a payment method',\n  inputSchema: {\n    userId: z.string(),\n    amount: z.number().int(),\n  },\n  handler: async ({ userId, amount }) => {\n    const log = useMcpLogger('billing')\n\n    \u002F\u002F → server: merged into the request's wide event, printed in the\n    \u002F\u002F   dev terminal at the end of the request, shipped to drains.\n    log.set({ user: { id: userId }, billing: { amount } })\n\n    \u002F\u002F → client: appears in the MCP Inspector \"Server Notifications\" panel\n    \u002F\u002F   (and in Cursor \u002F Claude's log viewer). Honours `logging\u002FsetLevel`.\n    await log.notify.info({ msg: 'starting charge', amount })\n\n    try {\n      const receipt = await charge(userId, amount)\n      log.event('charge_completed', { receiptId: receipt.id })\n      await log.notify.info({ msg: 'charge ok', receiptId: receipt.id })\n      return `Charged ${amount}.`\n    }\n    catch (err) {\n      log.evlog.error('charge failed', err)\n      await log.notify.error({ msg: 'charge failed', error: String(err) })\n      throw err\n    }\n  },\n})\n","server\u002Fmcp\u002Ftools\u002Fcharge.ts",[163,608,609,635,655,659,671,687,703,712,731,756,760,792,817,821,826,832,880,885,891,897,939,944,952,980,1020,1067,1092,1098,1114,1144,1193,1202,1207,1212],{"__ignoreMap":269},[273,610,611,614,617,620,623,626,629,632],{"class":275,"line":276},[273,612,613],{"class":437},"import",[273,615,616],{"class":452}," {",[273,618,619],{"class":448}," z",[273,621,622],{"class":452}," }",[273,624,625],{"class":437}," from",[273,627,628],{"class":452}," '",[273,630,631],{"class":394},"zod",[273,633,634],{"class":452},"'\n",[273,636,637,639,641,644,646,648,650,653],{"class":275,"line":282},[273,638,613],{"class":437},[273,640,616],{"class":452},[273,642,643],{"class":448}," defineMcpTool",[273,645,622],{"class":452},[273,647,625],{"class":437},[273,649,628],{"class":452},[273,651,652],{"class":394},"@nuxtjs\u002Fmcp-toolkit\u002Fserver",[273,654,634],{"class":452},[273,656,657],{"class":275,"line":289},[273,658,286],{"emptyLinePlaceholder":285},[273,660,661,663,665,667,669],{"class":275,"line":295},[273,662,438],{"class":437},[273,664,441],{"class":437},[273,666,643],{"class":444},[273,668,449],{"class":448},[273,670,453],{"class":452},[273,672,673,676,678,680,683,685],{"class":275,"line":301},[273,674,675],{"class":458},"  name",[273,677,424],{"class":452},[273,679,628],{"class":452},[273,681,682],{"class":394},"charge_card",[273,684,467],{"class":452},[273,686,478],{"class":452},[273,688,689,692,694,696,699,701],{"class":275,"line":307},[273,690,691],{"class":458},"  description",[273,693,424],{"class":452},[273,695,628],{"class":452},[273,697,698],{"class":394},"Charge a payment method",[273,700,467],{"class":452},[273,702,478],{"class":452},[273,704,705,708,710],{"class":275,"line":313},[273,706,707],{"class":458},"  inputSchema",[273,709,424],{"class":452},[273,711,488],{"class":452},[273,713,714,717,719,721,723,726,729],{"class":275,"line":319},[273,715,716],{"class":458},"    userId",[273,718,424],{"class":452},[273,720,619],{"class":448},[273,722,594],{"class":452},[273,724,725],{"class":444},"string",[273,727,728],{"class":448},"()",[273,730,478],{"class":452},[273,732,733,736,738,740,742,745,747,749,752,754],{"class":275,"line":325},[273,734,735],{"class":458},"    amount",[273,737,424],{"class":452},[273,739,619],{"class":448},[273,741,594],{"class":452},[273,743,744],{"class":444},"number",[273,746,728],{"class":448},[273,748,594],{"class":452},[273,750,751],{"class":444},"int",[273,753,728],{"class":448},[273,755,478],{"class":452},[273,757,758],{"class":275,"line":331},[273,759,513],{"class":452},[273,761,762,765,767,771,774,778,781,784,787,790],{"class":275,"line":337},[273,763,764],{"class":444},"  handler",[273,766,424],{"class":452},[273,768,770],{"class":769},"spNyl"," async",[273,772,773],{"class":452}," ({",[273,775,777],{"class":776},"sHdIc"," userId",[273,779,780],{"class":452},",",[273,782,783],{"class":776}," amount",[273,785,786],{"class":452}," })",[273,788,789],{"class":769}," =>",[273,791,488],{"class":452},[273,793,794,797,800,803,806,808,810,813,815],{"class":275,"line":343},[273,795,796],{"class":769},"    const",[273,798,799],{"class":448}," log",[273,801,802],{"class":452}," =",[273,804,805],{"class":444}," useMcpLogger",[273,807,449],{"class":458},[273,809,467],{"class":452},[273,811,812],{"class":394},"billing",[273,814,467],{"class":452},[273,816,521],{"class":458},[273,818,819],{"class":275,"line":349},[273,820,286],{"emptyLinePlaceholder":285},[273,822,823],{"class":275,"line":354},[273,824,825],{"class":502},"    \u002F\u002F → server: merged into the request's wide event, printed in the\n",[273,827,829],{"class":275,"line":828},15,[273,830,831],{"class":502},"    \u002F\u002F   dev terminal at the end of the request, shipped to drains.\n",[273,833,835,838,840,843,845,848,851,853,855,858,860,862,865,868,870,872,874,876,878],{"class":275,"line":834},16,[273,836,837],{"class":448},"    log",[273,839,594],{"class":452},[273,841,842],{"class":444},"set",[273,844,449],{"class":458},[273,846,847],{"class":452},"{",[273,849,850],{"class":458}," user",[273,852,424],{"class":452},[273,854,616],{"class":452},[273,856,857],{"class":458}," id",[273,859,424],{"class":452},[273,861,777],{"class":448},[273,863,864],{"class":452}," },",[273,866,867],{"class":458}," billing",[273,869,424],{"class":452},[273,871,616],{"class":452},[273,873,783],{"class":448},[273,875,622],{"class":452},[273,877,622],{"class":452},[273,879,521],{"class":458},[273,881,883],{"class":275,"line":882},17,[273,884,286],{"emptyLinePlaceholder":285},[273,886,888],{"class":275,"line":887},18,[273,889,890],{"class":502},"    \u002F\u002F → client: appears in the MCP Inspector \"Server Notifications\" panel\n",[273,892,894],{"class":275,"line":893},19,[273,895,896],{"class":502},"    \u002F\u002F   (and in Cursor \u002F Claude's log viewer). Honours `logging\u002FsetLevel`.\n",[273,898,900,903,905,907,910,912,915,917,919,922,924,926,929,931,933,935,937],{"class":275,"line":899},20,[273,901,902],{"class":437},"    await",[273,904,799],{"class":448},[273,906,594],{"class":452},[273,908,909],{"class":448},"notify",[273,911,594],{"class":452},[273,913,914],{"class":444},"info",[273,916,449],{"class":458},[273,918,847],{"class":452},[273,920,921],{"class":458}," msg",[273,923,424],{"class":452},[273,925,628],{"class":452},[273,927,928],{"class":394},"starting charge",[273,930,467],{"class":452},[273,932,780],{"class":452},[273,934,783],{"class":448},[273,936,622],{"class":452},[273,938,521],{"class":458},[273,940,942],{"class":275,"line":941},21,[273,943,286],{"emptyLinePlaceholder":285},[273,945,947,950],{"class":275,"line":946},22,[273,948,949],{"class":437},"    try",[273,951,488],{"class":452},[273,953,955,958,961,963,966,969,971,974,976,978],{"class":275,"line":954},23,[273,956,957],{"class":769},"      const",[273,959,960],{"class":448}," receipt",[273,962,802],{"class":452},[273,964,965],{"class":437}," await",[273,967,968],{"class":444}," charge",[273,970,449],{"class":458},[273,972,973],{"class":448},"userId",[273,975,780],{"class":452},[273,977,783],{"class":448},[273,979,521],{"class":458},[273,981,983,986,988,991,993,995,998,1000,1002,1004,1007,1009,1011,1013,1016,1018],{"class":275,"line":982},24,[273,984,985],{"class":448},"      log",[273,987,594],{"class":452},[273,989,990],{"class":444},"event",[273,992,449],{"class":458},[273,994,467],{"class":452},[273,996,997],{"class":394},"charge_completed",[273,999,467],{"class":452},[273,1001,780],{"class":452},[273,1003,616],{"class":452},[273,1005,1006],{"class":458}," receiptId",[273,1008,424],{"class":452},[273,1010,960],{"class":448},[273,1012,594],{"class":452},[273,1014,1015],{"class":448},"id",[273,1017,622],{"class":452},[273,1019,521],{"class":458},[273,1021,1023,1026,1028,1030,1032,1034,1036,1038,1040,1042,1044,1046,1049,1051,1053,1055,1057,1059,1061,1063,1065],{"class":275,"line":1022},25,[273,1024,1025],{"class":437},"      await",[273,1027,799],{"class":448},[273,1029,594],{"class":452},[273,1031,909],{"class":448},[273,1033,594],{"class":452},[273,1035,914],{"class":444},[273,1037,449],{"class":458},[273,1039,847],{"class":452},[273,1041,921],{"class":458},[273,1043,424],{"class":452},[273,1045,628],{"class":452},[273,1047,1048],{"class":394},"charge ok",[273,1050,467],{"class":452},[273,1052,780],{"class":452},[273,1054,1006],{"class":458},[273,1056,424],{"class":452},[273,1058,960],{"class":448},[273,1060,594],{"class":452},[273,1062,1015],{"class":448},[273,1064,622],{"class":452},[273,1066,521],{"class":458},[273,1068,1070,1073,1076,1079,1082,1085,1087,1089],{"class":275,"line":1069},26,[273,1071,1072],{"class":437},"      return",[273,1074,1075],{"class":452}," `",[273,1077,1078],{"class":394},"Charged ",[273,1080,1081],{"class":452},"${",[273,1083,1084],{"class":448},"amount",[273,1086,518],{"class":452},[273,1088,594],{"class":394},[273,1090,1091],{"class":452},"`\n",[273,1093,1095],{"class":275,"line":1094},27,[273,1096,1097],{"class":452},"    }\n",[273,1099,1101,1104,1106,1109,1112],{"class":275,"line":1100},28,[273,1102,1103],{"class":437},"    catch",[273,1105,202],{"class":458},[273,1107,1108],{"class":448},"err",[273,1110,1111],{"class":458},") ",[273,1113,453],{"class":452},[273,1115,1117,1119,1121,1123,1125,1128,1130,1132,1135,1137,1139,1142],{"class":275,"line":1116},29,[273,1118,985],{"class":448},[273,1120,594],{"class":452},[273,1122,233],{"class":448},[273,1124,594],{"class":452},[273,1126,1127],{"class":444},"error",[273,1129,449],{"class":458},[273,1131,467],{"class":452},[273,1133,1134],{"class":394},"charge failed",[273,1136,467],{"class":452},[273,1138,780],{"class":452},[273,1140,1141],{"class":448}," err",[273,1143,521],{"class":458},[273,1145,1147,1149,1151,1153,1155,1157,1159,1161,1163,1165,1167,1169,1171,1173,1175,1178,1180,1183,1185,1187,1189,1191],{"class":275,"line":1146},30,[273,1148,1025],{"class":437},[273,1150,799],{"class":448},[273,1152,594],{"class":452},[273,1154,909],{"class":448},[273,1156,594],{"class":452},[273,1158,1127],{"class":444},[273,1160,449],{"class":458},[273,1162,847],{"class":452},[273,1164,921],{"class":458},[273,1166,424],{"class":452},[273,1168,628],{"class":452},[273,1170,1134],{"class":394},[273,1172,467],{"class":452},[273,1174,780],{"class":452},[273,1176,1177],{"class":458}," error",[273,1179,424],{"class":452},[273,1181,1182],{"class":444}," String",[273,1184,449],{"class":458},[273,1186,1108],{"class":448},[273,1188,1111],{"class":458},[273,1190,518],{"class":452},[273,1192,521],{"class":458},[273,1194,1196,1199],{"class":275,"line":1195},31,[273,1197,1198],{"class":437},"      throw",[273,1200,1201],{"class":448}," err\n",[273,1203,1205],{"class":275,"line":1204},32,[273,1206,1097],{"class":452},[273,1208,1210],{"class":275,"line":1209},33,[273,1211,513],{"class":452},[273,1213,1215,1217],{"class":275,"line":1214},34,[273,1216,518],{"class":452},[273,1218,521],{"class":448},[160,1220,1221],{},"What happens:",[1223,1224,1225,1243],"ol",{},[1226,1227,1228,1229,1234,1235,215,1237,1239,1240,1242],"li",{},"The MCP client receives ",[168,1230,1231,1232],{},"two ",[163,1233,205],{}," entries (",[163,1236,914],{},[163,1238,914],{},") and one ",[163,1241,1127],{}," if the charge fails.",[1226,1244,1245,1246,215,1249,1252,1253,1255,1256,1259],{},"The wide event for this request is enriched with ",[163,1247,1248],{},"user.id",[163,1250,1251],{},"billing.amount",", plus a ",[163,1254,997],{}," (or ",[163,1257,1258],{},"charge_failed",") discrete event — visible in your dev terminal and forwarded to any configured evlog drain.",[372,1261,190],{"id":1262},"api",[173,1264,1265,1277],{},[176,1266,1267],{},[179,1268,1269,1272,1274],{},[182,1270,1271],{},"Method",[182,1273,184],{},[182,1275,1276],{},"Description",[192,1278,1279,1295,1310,1324,1338,1352,1365,1377],{},[179,1280,1281,1286,1289],{},[197,1282,1283],{},[163,1284,1285],{},"notify(level, data, logger?)",[197,1287,1288],{},"client",[197,1290,1291,1292,1294],{},"Send a ",[163,1293,205],{},". Drops silently when the level is filtered out by the client.",[179,1296,1297,1302,1304],{},[197,1298,1299],{},[163,1300,1301],{},"notify.debug(data, logger?)",[197,1303,1288],{},[197,1305,1306,1307,594],{},"Shortcut for ",[163,1308,1309],{},"notify('debug', …)",[179,1311,1312,1317,1319],{},[197,1313,1314],{},[163,1315,1316],{},"notify.info(data, logger?)",[197,1318,1288],{},[197,1320,1306,1321,594],{},[163,1322,1323],{},"notify('info', …)",[179,1325,1326,1331,1333],{},[197,1327,1328],{},[163,1329,1330],{},"notify.warning(data, logger?)",[197,1332,1288],{},[197,1334,1306,1335,594],{},[163,1336,1337],{},"notify('warning', …)",[179,1339,1340,1345,1347],{},[197,1341,1342],{},[163,1343,1344],{},"notify.error(data, logger?)",[197,1346,1288],{},[197,1348,1306,1349,594],{},[163,1350,1351],{},"notify('error', …)",[179,1353,1354,1359,1362],{},[197,1355,1356],{},[163,1357,1358],{},"set(fields)",[197,1360,1361],{},"server (evlog)",[197,1363,1364],{},"Merge fields into the current request's wide event.",[179,1366,1367,1372,1374],{},[197,1368,1369],{},[163,1370,1371],{},"event(name, fields?)",[197,1373,1361],{},[197,1375,1376],{},"Capture a discrete event in the wide event's request log.",[179,1378,1379,1383,1385],{},[197,1380,1381],{},[163,1382,233],{},[197,1384,1361],{},[197,1386,1387,1388,1395,1396,215,1399,215,1401,215,1404,1407],{},"Underlying ",[228,1389,1392],{"href":1390,"rel":1391},"https:\u002F\u002Fevlog.dev\u002Fdocs\u002Fapi\u002Frequest-logger",[232],[163,1393,1394],{},"RequestLogger"," — ",[163,1397,1398],{},"fork",[163,1400,1127],{},[163,1402,1403],{},"getContext",[163,1405,1406],{},"emit",", …",[160,1409,1410,1413,1414,1417],{},[163,1411,1412],{},"logger"," is the prefix attached to the notification (visible to the client). Pass it as the argument to ",[163,1415,1416],{},"useMcpLogger('prefix')"," to set a default for the request, or pass it per call to override.",[372,1419,1421],{"id":1420},"level-filtering","Level Filtering",[160,1423,1424,1425,1428,1429,1432,1433,1436],{},"Per the MCP spec, clients can call ",[163,1426,1427],{},"logging\u002FsetLevel"," to filter which messages they want. The toolkit forwards the current MCP session id to the SDK so each session's filter is applied independently — ",[163,1430,1431],{},"log.notify.debug(...)"," becomes a no-op for clients that asked for ",[163,1434,1435],{},"warning"," or higher.",[160,1438,1439,1440,1442],{},"The ",[163,1441,909],{}," methods always resolve and never throw, even when the transport is disconnected or the level is filtered out, so you can use them freely on hot paths.",[155,1444,1446],{"id":1445},"wide-events-with-evlog","Wide Events with evlog",[160,1448,1449,1450,1453],{},"Every MCP request is wrapped in an evlog ",[168,1451,1452],{},"wide event"," — one structured log line per request, accumulated as the handler runs. The toolkit automatically tags each wide event with:",[173,1455,1456,1465],{},[176,1457,1458],{},[179,1459,1460,1463],{},[182,1461,1462],{},"Field",[182,1464,1276],{},[192,1466,1467,1484,1494,1507,1536,1546,1558,1570],{},[179,1468,1469,1474],{},[197,1470,1471],{},[163,1472,1473],{},"mcp.transport",[197,1475,1476,1479,1480,1483],{},[163,1477,1478],{},"streamable-http"," (default) or ",[163,1481,1482],{},"cloudflare-do"," on Workers",[179,1485,1486,1491],{},[197,1487,1488],{},[163,1489,1490],{},"mcp.route",[197,1492,1493],{},"The configured MCP endpoint path",[179,1495,1496,1500],{},[197,1497,1498],{},[163,1499,407],{},[197,1501,1502,1503,1506],{},"Copied from the ",[163,1504,1505],{},"mcp-session-id"," header (when present)",[179,1508,1509,1514],{},[197,1510,1511],{},[163,1512,1513],{},"mcp.method",[197,1515,1516,1517,215,1520,215,1523,215,1526,215,1529,215,1532,1535],{},"The JSON-RPC method (",[163,1518,1519],{},"tools\u002Fcall",[163,1521,1522],{},"tools\u002Flist",[163,1524,1525],{},"initialize",[163,1527,1528],{},"resources\u002Fread",[163,1530,1531],{},"prompts\u002Fget",[163,1533,1534],{},"notifications\u002Finitialized",", …)",[179,1537,1538,1543],{},[197,1539,1540],{},[163,1541,1542],{},"mcp.request_id",[197,1544,1545],{},"The JSON-RPC request id when the message has one",[179,1547,1548,1552],{},[197,1549,1550],{},[163,1551,404],{},[197,1553,1554,1555,1557],{},"The tool name on a ",[163,1556,1519],{}," request",[179,1559,1560,1565],{},[197,1561,1562],{},[163,1563,1564],{},"mcp.resource",[197,1566,1567,1568,1557],{},"The URI on a ",[163,1569,1528],{},[179,1571,1572,1577],{},[197,1573,1574],{},[163,1575,1576],{},"mcp.prompt",[197,1578,1579,1580,1557],{},"The prompt name on a ",[163,1581,1531],{},[160,1583,1584,1585,215,1588,215,1591,215,1594,215,1597,1600,1601,215,1604,215,1607,215,1610,215,1613,1616],{},"For batched JSON-RPC payloads the singular keys (",[163,1586,1587],{},"method",[163,1589,1590],{},"tool",[163,1592,1593],{},"resource",[163,1595,1596],{},"prompt",[163,1598,1599],{},"request_id",") flip to plural arrays (",[163,1602,1603],{},"methods",[163,1605,1606],{},"tools",[163,1608,1609],{},"resources",[163,1611,1612],{},"prompts",[163,1614,1615],{},"request_ids","). No user code or middleware is required — these fields land on every request automatically.",[160,1618,1619,1620,1623,1624,424],{},"You stack additional context with ",[163,1621,1622],{},"set()"," and capture milestones with ",[163,1625,1626],{},"event()",[263,1628,1631],{"className":427,"code":1629,"filename":1630,"language":430,"meta":269,"style":269},"import { defineMcpTool } from '@nuxtjs\u002Fmcp-toolkit\u002Fserver'\n\nexport default defineMcpTool({\n  name: 'import_csv',\n  description: 'Import a CSV file',\n  inputSchema: { url: z.string().url() },\n  handler: async ({ url }) => {\n    const log = useMcpLogger('import')\n    log.set({ source: { kind: 'csv', url } })\n\n    const rows = await fetchCsv(url)\n    log.event('rows_fetched', { count: rows.length })\n\n    const inserted = await insertRows(rows)\n    log.set({ result: { inserted } })\n\n    return `Imported ${inserted} rows.`\n  },\n})\n","server\u002Fmcp\u002Ftools\u002Fimport-csv.ts",[163,1632,1633,1651,1655,1667,1682,1697,1729,1747,1767,1808,1812,1832,1869,1873,1894,1921,1925,1947,1951],{"__ignoreMap":269},[273,1634,1635,1637,1639,1641,1643,1645,1647,1649],{"class":275,"line":276},[273,1636,613],{"class":437},[273,1638,616],{"class":452},[273,1640,643],{"class":448},[273,1642,622],{"class":452},[273,1644,625],{"class":437},[273,1646,628],{"class":452},[273,1648,652],{"class":394},[273,1650,634],{"class":452},[273,1652,1653],{"class":275,"line":282},[273,1654,286],{"emptyLinePlaceholder":285},[273,1656,1657,1659,1661,1663,1665],{"class":275,"line":289},[273,1658,438],{"class":437},[273,1660,441],{"class":437},[273,1662,643],{"class":444},[273,1664,449],{"class":448},[273,1666,453],{"class":452},[273,1668,1669,1671,1673,1675,1678,1680],{"class":275,"line":295},[273,1670,675],{"class":458},[273,1672,424],{"class":452},[273,1674,628],{"class":452},[273,1676,1677],{"class":394},"import_csv",[273,1679,467],{"class":452},[273,1681,478],{"class":452},[273,1683,1684,1686,1688,1690,1693,1695],{"class":275,"line":301},[273,1685,691],{"class":458},[273,1687,424],{"class":452},[273,1689,628],{"class":452},[273,1691,1692],{"class":394},"Import a CSV file",[273,1694,467],{"class":452},[273,1696,478],{"class":452},[273,1698,1699,1701,1703,1705,1708,1710,1712,1714,1716,1718,1720,1723,1726],{"class":275,"line":307},[273,1700,707],{"class":458},[273,1702,424],{"class":452},[273,1704,616],{"class":452},[273,1706,1707],{"class":458}," url",[273,1709,424],{"class":452},[273,1711,619],{"class":448},[273,1713,594],{"class":452},[273,1715,725],{"class":444},[273,1717,728],{"class":448},[273,1719,594],{"class":452},[273,1721,1722],{"class":444},"url",[273,1724,1725],{"class":448},"() ",[273,1727,1728],{"class":452},"},\n",[273,1730,1731,1733,1735,1737,1739,1741,1743,1745],{"class":275,"line":313},[273,1732,764],{"class":444},[273,1734,424],{"class":452},[273,1736,770],{"class":769},[273,1738,773],{"class":452},[273,1740,1707],{"class":776},[273,1742,786],{"class":452},[273,1744,789],{"class":769},[273,1746,488],{"class":452},[273,1748,1749,1751,1753,1755,1757,1759,1761,1763,1765],{"class":275,"line":319},[273,1750,796],{"class":769},[273,1752,799],{"class":448},[273,1754,802],{"class":452},[273,1756,805],{"class":444},[273,1758,449],{"class":458},[273,1760,467],{"class":452},[273,1762,613],{"class":394},[273,1764,467],{"class":452},[273,1766,521],{"class":458},[273,1768,1769,1771,1773,1775,1777,1779,1782,1784,1786,1789,1791,1793,1796,1798,1800,1802,1804,1806],{"class":275,"line":325},[273,1770,837],{"class":448},[273,1772,594],{"class":452},[273,1774,842],{"class":444},[273,1776,449],{"class":458},[273,1778,847],{"class":452},[273,1780,1781],{"class":458}," source",[273,1783,424],{"class":452},[273,1785,616],{"class":452},[273,1787,1788],{"class":458}," kind",[273,1790,424],{"class":452},[273,1792,628],{"class":452},[273,1794,1795],{"class":394},"csv",[273,1797,467],{"class":452},[273,1799,780],{"class":452},[273,1801,1707],{"class":448},[273,1803,622],{"class":452},[273,1805,622],{"class":452},[273,1807,521],{"class":458},[273,1809,1810],{"class":275,"line":331},[273,1811,286],{"emptyLinePlaceholder":285},[273,1813,1814,1816,1819,1821,1823,1826,1828,1830],{"class":275,"line":337},[273,1815,796],{"class":769},[273,1817,1818],{"class":448}," rows",[273,1820,802],{"class":452},[273,1822,965],{"class":437},[273,1824,1825],{"class":444}," fetchCsv",[273,1827,449],{"class":458},[273,1829,1722],{"class":448},[273,1831,521],{"class":458},[273,1833,1834,1836,1838,1840,1842,1844,1847,1849,1851,1853,1856,1858,1860,1862,1865,1867],{"class":275,"line":343},[273,1835,837],{"class":448},[273,1837,594],{"class":452},[273,1839,990],{"class":444},[273,1841,449],{"class":458},[273,1843,467],{"class":452},[273,1845,1846],{"class":394},"rows_fetched",[273,1848,467],{"class":452},[273,1850,780],{"class":452},[273,1852,616],{"class":452},[273,1854,1855],{"class":458}," count",[273,1857,424],{"class":452},[273,1859,1818],{"class":448},[273,1861,594],{"class":452},[273,1863,1864],{"class":448},"length",[273,1866,622],{"class":452},[273,1868,521],{"class":458},[273,1870,1871],{"class":275,"line":349},[273,1872,286],{"emptyLinePlaceholder":285},[273,1874,1875,1877,1880,1882,1884,1887,1889,1892],{"class":275,"line":354},[273,1876,796],{"class":769},[273,1878,1879],{"class":448}," inserted",[273,1881,802],{"class":452},[273,1883,965],{"class":437},[273,1885,1886],{"class":444}," insertRows",[273,1888,449],{"class":458},[273,1890,1891],{"class":448},"rows",[273,1893,521],{"class":458},[273,1895,1896,1898,1900,1902,1904,1906,1909,1911,1913,1915,1917,1919],{"class":275,"line":828},[273,1897,837],{"class":448},[273,1899,594],{"class":452},[273,1901,842],{"class":444},[273,1903,449],{"class":458},[273,1905,847],{"class":452},[273,1907,1908],{"class":458}," result",[273,1910,424],{"class":452},[273,1912,616],{"class":452},[273,1914,1879],{"class":448},[273,1916,622],{"class":452},[273,1918,622],{"class":452},[273,1920,521],{"class":458},[273,1922,1923],{"class":275,"line":834},[273,1924,286],{"emptyLinePlaceholder":285},[273,1926,1927,1930,1932,1935,1937,1940,1942,1945],{"class":275,"line":882},[273,1928,1929],{"class":437},"    return",[273,1931,1075],{"class":452},[273,1933,1934],{"class":394},"Imported ",[273,1936,1081],{"class":452},[273,1938,1939],{"class":448},"inserted",[273,1941,518],{"class":452},[273,1943,1944],{"class":394}," rows.",[273,1946,1091],{"class":452},[273,1948,1949],{"class":275,"line":887},[273,1950,513],{"class":452},[273,1952,1953,1955],{"class":275,"line":893},[273,1954,518],{"class":452},[273,1956,521],{"class":448},[160,1958,1959],{},"In your dev terminal you'll get something like:",[263,1961,1963],{"className":381,"code":1962,"language":383,"meta":269,"style":269},"INFO [Playground MCP] POST \u002Fmcp 200 in 18ms\n├─ requestId: c6a9094f-bd24-4971-88ee-a53a28fab13a\n├─ mcp: transport=streamable-http route=\u002Fmcp session_id=ef39698f-… method=tools\u002Fcall request_id=1 tool=import_csv\n├─ source: kind=csv url=https:\u002F\u002Fexample.com\u002Fdata.csv\n├─ result: inserted=128\n└─ requestLogs: 0={\"level\":\"info\",\"message\":\"rows_fetched\",...}\n",[163,1964,1965,1992,2003,2031,2044,2057],{"__ignoreMap":269},[273,1966,1967,1970,1973,1976,1979,1982,1986,1989],{"class":275,"line":276},[273,1968,1969],{"class":390},"INFO",[273,1971,1972],{"class":448}," [Playground ",[273,1974,1975],{"class":394},"MCP]",[273,1977,1978],{"class":394}," POST",[273,1980,1981],{"class":394}," \u002Fmcp",[273,1983,1985],{"class":1984},"sbssI"," 200",[273,1987,1988],{"class":394}," in",[273,1990,1991],{"class":394}," 18ms\n",[273,1993,1994,1997,2000],{"class":275,"line":282},[273,1995,1996],{"class":390},"├─",[273,1998,1999],{"class":394}," requestId:",[273,2001,2002],{"class":394}," c6a9094f-bd24-4971-88ee-a53a28fab13a\n",[273,2004,2005,2007,2010,2013,2016,2019,2022,2025,2028],{"class":275,"line":289},[273,2006,1996],{"class":390},[273,2008,2009],{"class":394}," mcp:",[273,2011,2012],{"class":394}," transport=streamable-http",[273,2014,2015],{"class":394}," route=\u002Fmcp",[273,2017,2018],{"class":394}," session_id=ef39698f-…",[273,2020,2021],{"class":394}," method=tools\u002Fcall",[273,2023,2024],{"class":394}," request_id=",[273,2026,2027],{"class":1984},"1",[273,2029,2030],{"class":394}," tool=import_csv\n",[273,2032,2033,2035,2038,2041],{"class":275,"line":295},[273,2034,1996],{"class":390},[273,2036,2037],{"class":394}," source:",[273,2039,2040],{"class":394}," kind=csv",[273,2042,2043],{"class":394}," url=https:\u002F\u002Fexample.com\u002Fdata.csv\n",[273,2045,2046,2048,2051,2054],{"class":275,"line":301},[273,2047,1996],{"class":390},[273,2049,2050],{"class":394}," result:",[273,2052,2053],{"class":394}," inserted=",[273,2055,2056],{"class":1984},"128\n",[273,2058,2059,2062,2065,2068,2071,2074,2076,2078,2080,2082,2084,2086,2088,2091,2093,2095,2097,2099,2101],{"class":275,"line":307},[273,2060,2061],{"class":390},"└─",[273,2063,2064],{"class":394}," requestLogs:",[273,2066,2067],{"class":394}," 0={",[273,2069,2070],{"class":452},"\"",[273,2072,2073],{"class":394},"level",[273,2075,2070],{"class":452},[273,2077,424],{"class":394},[273,2079,2070],{"class":452},[273,2081,914],{"class":394},[273,2083,2070],{"class":452},[273,2085,780],{"class":394},[273,2087,2070],{"class":452},[273,2089,2090],{"class":394},"message",[273,2092,2070],{"class":452},[273,2094,424],{"class":394},[273,2096,2070],{"class":452},[273,2098,1846],{"class":394},[273,2100,2070],{"class":452},[273,2102,2103],{"class":394},",...}\n",[155,2105,2107],{"id":2106},"ship-to-your-observability-stack","Ship to Your Observability Stack",[160,2109,2110,2111,2114,2115,2118,2119,215,2121,2123],{},"evlog ships ",[168,2112,2113],{},"drain adapters"," for Axiom, Sentry, OpenTelemetry \u002F OTLP, HyperDX, Datadog, Better Stack, and PostHog. A drain is just a function registered on the ",[163,2116,2117],{},"evlog:drain"," Nitro hook — every MCP wide event (already tagged with ",[163,2120,404],{},[163,2122,407],{},", …) is forwarded to whichever destinations you wire up.",[160,2125,2126,2127,2130,2131,2134,2135,2138,2139,2142],{},"The pattern is always the same: drop a Nitro plugin under ",[163,2128,2129],{},"server\u002Fplugins\u002F"," that imports a ",[163,2132,2133],{},"createXxxDrain()"," from ",[163,2136,2137],{},"evlog\u002Fadapters\u002F*"," and registers it on the hook. Most adapters are ",[168,2140,2141],{},"zero-config"," if you set the standard env vars.",[263,2144,2147],{"className":427,"code":2145,"filename":2146,"language":430,"meta":269,"style":269},"import { createAxiomDrain } from 'evlog\u002Fadapters\u002Faxiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n})\n","server\u002Fplugins\u002Fevlog-axiom.ts",[163,2148,2149,2169,2173,2195,2225],{"__ignoreMap":269},[273,2150,2151,2153,2155,2158,2160,2162,2164,2167],{"class":275,"line":276},[273,2152,613],{"class":437},[273,2154,616],{"class":452},[273,2156,2157],{"class":448}," createAxiomDrain",[273,2159,622],{"class":452},[273,2161,625],{"class":437},[273,2163,628],{"class":452},[273,2165,2166],{"class":394},"evlog\u002Fadapters\u002Faxiom",[273,2168,634],{"class":452},[273,2170,2171],{"class":275,"line":282},[273,2172,286],{"emptyLinePlaceholder":285},[273,2174,2175,2177,2179,2182,2184,2186,2189,2191,2193],{"class":275,"line":289},[273,2176,438],{"class":437},[273,2178,441],{"class":437},[273,2180,2181],{"class":444}," defineNitroPlugin",[273,2183,449],{"class":448},[273,2185,449],{"class":452},[273,2187,2188],{"class":776},"nitroApp",[273,2190,206],{"class":452},[273,2192,789],{"class":769},[273,2194,488],{"class":452},[273,2196,2197,2200,2202,2205,2207,2210,2212,2214,2216,2218,2220,2222],{"class":275,"line":295},[273,2198,2199],{"class":448},"  nitroApp",[273,2201,594],{"class":452},[273,2203,2204],{"class":448},"hooks",[273,2206,594],{"class":452},[273,2208,2209],{"class":444},"hook",[273,2211,449],{"class":458},[273,2213,467],{"class":452},[273,2215,2117],{"class":394},[273,2217,467],{"class":452},[273,2219,780],{"class":452},[273,2221,2157],{"class":444},[273,2223,2224],{"class":458},"())\n",[273,2226,2227,2229],{"class":275,"line":301},[273,2228,518],{"class":452},[273,2230,521],{"class":448},[263,2232,2235],{"className":381,"code":2233,"filename":2234,"language":383,"meta":269,"style":269},"NUXT_AXIOM_TOKEN=xaat-...\nNUXT_AXIOM_DATASET=mcp-server\n",".env",[163,2236,2237,2248],{"__ignoreMap":269},[273,2238,2239,2242,2245],{"class":275,"line":276},[273,2240,2241],{"class":448},"NUXT_AXIOM_TOKEN",[273,2243,2244],{"class":452},"=",[273,2246,2247],{"class":394},"xaat-...\n",[273,2249,2250,2253,2255],{"class":275,"line":282},[273,2251,2252],{"class":448},"NUXT_AXIOM_DATASET",[273,2254,2244],{"class":452},[273,2256,2257],{"class":394},"mcp-server\n",[160,2259,2260,2261,215,2263,215,2265,2267,2268,2270],{},"You can now slice MCP traffic in Axiom by ",[163,2262,404],{},[163,2264,407],{},[163,2266,1248],{},", latency, error rate — every field you ",[163,2269,1622],{}," on a wide event is queryable.",[160,2272,2273],{},"The hook is additive: register multiple drains for parallel forwarding (e.g. Axiom for storage + Sentry for alerting), and a failure in one drain doesn't affect the others.",[263,2275,2278],{"className":427,"code":2276,"filename":2277,"language":430,"meta":269,"style":269},"import { createAxiomDrain } from 'evlog\u002Fadapters\u002Faxiom'\nimport { createSentryDrain } from 'evlog\u002Fadapters\u002Fsentry'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n  nitroApp.hooks.hook('evlog:drain', createSentryDrain())\n})\n","server\u002Fplugins\u002Fevlog-drains.ts",[163,2279,2280,2298,2318,2322,2342,2368,2394],{"__ignoreMap":269},[273,2281,2282,2284,2286,2288,2290,2292,2294,2296],{"class":275,"line":276},[273,2283,613],{"class":437},[273,2285,616],{"class":452},[273,2287,2157],{"class":448},[273,2289,622],{"class":452},[273,2291,625],{"class":437},[273,2293,628],{"class":452},[273,2295,2166],{"class":394},[273,2297,634],{"class":452},[273,2299,2300,2302,2304,2307,2309,2311,2313,2316],{"class":275,"line":282},[273,2301,613],{"class":437},[273,2303,616],{"class":452},[273,2305,2306],{"class":448}," createSentryDrain",[273,2308,622],{"class":452},[273,2310,625],{"class":437},[273,2312,628],{"class":452},[273,2314,2315],{"class":394},"evlog\u002Fadapters\u002Fsentry",[273,2317,634],{"class":452},[273,2319,2320],{"class":275,"line":289},[273,2321,286],{"emptyLinePlaceholder":285},[273,2323,2324,2326,2328,2330,2332,2334,2336,2338,2340],{"class":275,"line":295},[273,2325,438],{"class":437},[273,2327,441],{"class":437},[273,2329,2181],{"class":444},[273,2331,449],{"class":448},[273,2333,449],{"class":452},[273,2335,2188],{"class":776},[273,2337,206],{"class":452},[273,2339,789],{"class":769},[273,2341,488],{"class":452},[273,2343,2344,2346,2348,2350,2352,2354,2356,2358,2360,2362,2364,2366],{"class":275,"line":301},[273,2345,2199],{"class":448},[273,2347,594],{"class":452},[273,2349,2204],{"class":448},[273,2351,594],{"class":452},[273,2353,2209],{"class":444},[273,2355,449],{"class":458},[273,2357,467],{"class":452},[273,2359,2117],{"class":394},[273,2361,467],{"class":452},[273,2363,780],{"class":452},[273,2365,2157],{"class":444},[273,2367,2224],{"class":458},[273,2369,2370,2372,2374,2376,2378,2380,2382,2384,2386,2388,2390,2392],{"class":275,"line":307},[273,2371,2199],{"class":448},[273,2373,594],{"class":452},[273,2375,2204],{"class":448},[273,2377,594],{"class":452},[273,2379,2209],{"class":444},[273,2381,449],{"class":458},[273,2383,467],{"class":452},[273,2385,2117],{"class":394},[273,2387,467],{"class":452},[273,2389,780],{"class":452},[273,2391,2306],{"class":444},[273,2393,2224],{"class":458},[273,2395,2396,2398],{"class":275,"line":313},[273,2397,518],{"class":452},[273,2399,521],{"class":448},[160,2401,2402,2403,2406,2407,2409],{},"A drain is just ",[163,2404,2405],{},"(ctx: DrainContext | DrainContext[]) => Promise\u003Cvoid>"," — write your own for Slack alerts on failed ",[163,2408,1519],{},", persisting to your own database for audit, forwarding to an internal SIEM, etc.",[2411,2412,2415,2416,2420],"callout",{"icon":2413,"target":2414,"to":230},"i-lucide-arrow-up-right","_blank","See the ",[228,2417,2419],{"href":230,"rel":2418},[232],"evlog docs"," for the full list of adapters, configuration options (sampling, redaction, enrichers), and how to build custom drains.",[155,2422,2424],{"id":2423},"production-tips","Production Tips",[2426,2427,2428,2437,2448],"ul",{},[1226,2429,2430,2436],{},[168,2431,2432,2433,2435],{},"Use ",[163,2434,909],{}," sparingly."," Each notification is a network round-trip and ends up in the user's chat history. Keep it for actionable progress updates (\"opened PR #42\") or genuine errors.",[1226,2438,2439,2447],{},[168,2440,2432,2441,2443,2444,2446],{},[163,2442,842],{}," and ",[163,2445,990],{}," liberally."," They're cheap, batched into the wide event, and never leak to the client. This is where you put structured business data, timings, retry counts, etc.",[1226,2449,2450,2456,2457,2459,2460,2465],{},[168,2451,2452,2453,594],{},"Pair with ",[163,2454,2455],{},"extractToolNames()"," Combine ",[163,2458,165],{}," in middleware with ",[228,2461,2462],{"href":82},[163,2463,2464],{},"extractToolNames(event)"," to record every tool call, including failed ones, for audit trails.",[155,2467,2469],{"id":2468},"requirements","Requirements",[2411,2471,2473,2475,2476,2479,2480,2482,2483,215,2485,2487,2488,2490,2491,2493,2494,2496,2497,2499,2500,2502,2503,2505],{"icon":2472,"color":1435},"i-lucide-triangle-alert",[163,2474,165],{}," requires ",[163,2477,2478],{},"nitro.experimental.asyncContext"," to be ",[163,2481,562],{}," (default since Nuxt 3.8+). The ",[163,2484,842],{},[163,2486,990],{},", and ",[163,2489,233],{}," channels throw an ",[163,2492,593],{}," when the optional ",[163,2495,233],{}," peer dependency is missing or ",[163,2498,423],{}," is set to ",[163,2501,576],{},". The ",[163,2504,909],{}," channel keeps working in both cases.",[2507,2508,2509],"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 .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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":269,"searchDepth":282,"depth":282,"links":2511},[2512,2513,2518,2522,2523,2524,2525],{"id":157,"depth":282,"text":158},{"id":360,"depth":282,"text":361,"children":2514},[2515,2516,2517],{"id":374,"depth":289,"text":375},{"id":411,"depth":289,"text":412},{"id":524,"depth":289,"text":525},{"id":597,"depth":282,"text":165,"children":2519},[2520,2521],{"id":1262,"depth":289,"text":190},{"id":1420,"depth":289,"text":1421},{"id":1445,"depth":282,"text":1446},{"id":2106,"depth":282,"text":2107},{"id":2423,"depth":282,"text":2424},{"id":2468,"depth":282,"text":2469},"Stream logs to MCP clients and capture structured wide events with useMcpLogger().","md",null,{},{"icon":79},{"title":2532,"description":2533},"MCP Logging & Observability","Send notifications\u002Fmessage to connected MCP clients and capture structured server-side wide events with the built-in evlog integration.","efdBWgH29p_cCg4uj_aE36cuAsVJOnO6GET32xVMFP4",[2536,2538],{"title":71,"path":72,"stem":73,"description":2537,"icon":74,"children":-1},"Customize where the module looks for MCP definitions.",{"title":81,"path":82,"stem":83,"description":2539,"icon":84,"children":-1},"Intercept MCP requests to add authentication, logging, analytics, and more.",1776853498548]