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