[{"data":1,"prerenderedAt":688},["ShallowReactive",2],{"navigation":3,"/blog/nuxt-content-webmcp":66,"/blog/nuxt-content-webmcp-surround":683},[4],{"title":5,"path":6,"stem":7,"children":8,"page":65},"Blog","/blog","blog",[9,13,17,21,25,29,33,37,41,45,49,53,57,61],{"title":10,"path":11,"stem":12},"One Maintenance Session on an Agent-Assisted Client Project","/blog/agent-maintenance-session","blog/agent-maintenance-session",{"title":14,"path":15,"stem":16},"How Claude Skills + MCP Track My Capital Gains Tax","/blog/capital-gains-tracker-claude-skills-mcp","blog/capital-gains-tracker-claude-skills-mcp",{"title":18,"path":19,"stem":20},"ESLint Without Prettier: One Tool for Formatting and Linting in TypeScript","/blog/eslint-best-practice","blog/eslint-best-practice",{"title":22,"path":23,"stem":24},"Building GoSpendl: A Bitcoin Product Search Engine, End to End","/blog/gospendl-builder-story","blog/gospendl-builder-story",{"title":26,"path":27,"stem":28},"Why Your Startup Should Go Headless CMS from Day One","/blog/headless-cms-startups","blog/headless-cms-startups",{"title":30,"path":31,"stem":32},"How I Built a Token-Efficient Crawler for 900+ Shops with Crawl4AI","/blog/how-i-built-a-token-efficient-crawler","blog/how-i-built-a-token-efficient-crawler",{"title":34,"path":35,"stem":36},"Migrating a Live B2B Platform to AWS Without Stopping the Business","/blog/migrating-live-b2b-platform-aws","blog/migrating-live-b2b-platform-aws",{"title":38,"path":39,"stem":40},"WebMCP for Nuxt Content: Agents Read Your Whole Blog","/blog/nuxt-content-webmcp","blog/nuxt-content-webmcp",{"title":42,"path":43,"stem":44},"Nuxt 4 WebSockets Are Elegant. Here's Why They Break on Vercel.","/blog/nuxt-websockets-vs-vercel","blog/nuxt-websockets-vs-vercel",{"title":46,"path":47,"stem":48},"Host Your Docker Container on Railway in 5 Minutes (8GB RAM for $5)","/blog/railway-smart-docker-host","blog/railway-smart-docker-host",{"title":50,"path":51,"stem":52},"Storyblok as a WordPress Alternative: One Client Build","/blog/storyblok-wordpress-alternative","blog/storyblok-wordpress-alternative",{"title":54,"path":55,"stem":56},"Supabase vs Custom Auth: What I Recommend for Early-Stage SaaS","/blog/supabase-vs-custom-auth","blog/supabase-vs-custom-auth",{"title":58,"path":59,"stem":60},"Vue vs React: What Vapor Mode Actually Changes","/blog/vue-vs-react-headless-cms","blog/vue-vs-react-headless-cms",{"title":62,"path":63,"stem":64},"How to Migrate WordPress to Strapi Headless CMS (With 1,000+ Posts)","/blog/wordpress-to-strapi-migration","blog/wordpress-to-strapi-migration",false,{"id":67,"title":38,"author":68,"body":72,"date":669,"description":670,"extension":671,"featured":289,"image":672,"meta":673,"minRead":674,"navigation":289,"path":39,"seo":675,"sitemap":676,"stem":40,"tags":677,"__hash__":682},"blog/blog/nuxt-content-webmcp.md",{"name":69,"avatar":70},"Niklas Grieger",{"src":71,"alt":69},"/profile.jpg",{"type":73,"value":74,"toc":659},"minimark",[75,84,95,98,103,106,133,140,146,153,260,267,270,277,296,300,303,330,338,341,344,347,361,365,372,396,402,408,412,415,424,430,434,437,453,459,469,473,488,494,498,510,513,517,524,549,603,610,617,638,645,648,655],[76,77,78,79,83],"p",{},"WebMCP is a new browser API that lets a web page hand tools to an AI agent running in the browser. Instead of scraping the DOM, the agent calls functions the page registered on ",[80,81,82],"code",{},"document.modelContext",", gets JSON back, and works with that. Chrome started an origin trial for it in version 149, and Edge followed in 150.",[76,85,86,87,94],{},"A blog fits this well, because Nuxt Content already knows every post's title, description, date, tags and body. So I wrote ",[88,89,93],"a",{"href":90,"rel":91},"https://github.com/devonik/nuxt-content-webmcp",[92],"nofollow","nuxt-content-webmcp",", a Nuxt module that turns that data into four read-only tools, and put it on this site. It's open source and on npm.",[76,96,97],{},"Above all, I wanted an agent to be able to read a whole post, from the first line to the last.",[99,100,102],"h2",{"id":101},"reading-a-6582-character-post-in-8-calls","Reading a 6,582-character post in 8 calls",[76,104,105],{},"Chrome's guidance for WebMCP is to keep each tool result under 1,500 characters. A blog post is usually longer than that. If a tool returns the first 1,500 characters and stops, the agent only ever sees the intro.",[76,107,108,109,112,113,116,117,120,121,124,125,128,129,132],{},"So ",[80,110,111],{},"get_content_page"," returns the post in chunks. Each result carries the text from ",[80,114,115],{},"offset",", plus ",[80,118,119],{},"nextOffset"," and ",[80,122,123],{},"totalLength",", and the tool description tells the agent to call again with ",[80,126,127],{},"offset=nextOffset"," until it's ",[80,130,131],{},"null",". Chunks end at whitespace, and the chunk size shrinks when needed so the whole result, metadata included, stays under the limit.",[76,134,135,136,139],{},"I tested it with the Model Context Tool Inspector, a Chrome extension that connects the tools of the current tab to Gemini (here ",[80,137,138],{},"gemini-3.1-flash-lite","). The question:",[141,142,143],"blockquote",{},[76,144,145],{},"What did Niklas find out about Nuxt WebSockets on Vercel? Read the whole post before answering.",[76,147,148,149,152],{},"Gemini searched for \"Nuxt WebSockets Vercel\", got exactly one hit (",[88,150,151],{"href":43},"my WebSockets post","), and then read it like this:",[154,155,156,174],"table",{},[157,158,159],"thead",{},[160,161,162,166,170],"tr",{},[163,164,165],"th",{},"Call",[163,167,168],{},[80,169,115],{},[163,171,172],{},[80,173,119],{},[175,176,177,189,199,209,219,229,239,249],"tbody",{},[160,178,179,183,186],{},[180,181,182],"td",{},"1",[180,184,185],{},"0",[180,187,188],{},"900",[160,190,191,194,196],{},[180,192,193],{},"2",[180,195,188],{},[180,197,198],{},"1796",[160,200,201,204,206],{},[180,202,203],{},"3",[180,205,198],{},[180,207,208],{},"2693",[160,210,211,214,216],{},[180,212,213],{},"4",[180,215,208],{},[180,217,218],{},"3587",[160,220,221,224,226],{},[180,222,223],{},"5",[180,225,218],{},[180,227,228],{},"4480",[160,230,231,234,236],{},[180,232,233],{},"6",[180,235,228],{},[180,237,238],{},"5379",[160,240,241,244,246],{},[180,242,243],{},"7",[180,245,238],{},[180,247,248],{},"6278",[160,250,251,254,256],{},[180,252,253],{},"8",[180,255,248],{},[180,257,258],{},[80,259,131],{},[76,261,262,263,266],{},"The eight calls covered all 6,582 characters, without gaps or overlap. The answer covered the whole post: the missing upgrade handshake in Nitro's Vercel preset, the comparison with Next.js and ",[80,264,265],{},"experimental_upgradeWebSocket",", and the switch to Server-Sent Events with Upstash Redis at the end. I checked each point against the post. Most of it is well past the first 1,500 characters.",[76,268,269],{},"In the Network tab, those 8 calls caused one request: the post's text as a small JSON file. The module fetches it once and cuts the chunks in the browser.",[76,271,272],{},[273,274],"img",{"alt":275,"src":276},"The last get_content_page call with nextOffset null, followed by Gemini's answer. The Network panel shows two requests: the index and the post's text.","/blog/nuxt-content-webmcp/q2-last-chunk.png",[278,279,282,283],"div",{"className":280},[281],"max-w-2xl","\n  ",[284,285,290,291,282],"video",{"className":286,"controls":289,"muted":289,"playsInline":289},[287,288],"w-full","h-auto",true,"\n    ",[292,293],"source",{"src":294,"type":295},"/blog/nuxt-content-webmcp/demo.mp4","video/mp4",[99,297,299],{"id":298},"four-tools-built-from-one-static-index","Four tools, built from one static index",[76,301,302],{},"The module registers four tools when the page loads:",[304,305,306,313,319,324],"ul",{},[307,308,309,312],"li",{},[80,310,311],{},"search_content"," - keyword search over titles, tags, descriptions and a short excerpt",[307,314,315,318],{},[80,316,317],{},"list_content"," - list posts, filtered by tag, collection or date range",[307,320,321,323],{},[80,322,111],{}," - read one post in chunks, as above",[307,325,326,329],{},[80,327,328],{},"list_tags"," - the tags and collections with post counts, and the oldest and newest date",[76,331,332,333,120,335,337],{},"All four are marked read-only. ",[80,334,311],{},[80,336,111],{}," are also marked as returning untrusted content, so the agent knows the text is site content and not instructions.",[76,339,340],{},"At build time, the module writes two kinds of static files: an index with one entry per post (title, description, path, date, tags, a 280-character excerpt) and one file per post with its plain text. For this blog's 13 posts, the index is 9.1 KB. Nothing from the content goes into the JavaScript bundle. The index is fetched on the first tool call, and a post's text when an agent reads that post.",[342,343],"content-webmcp-flow-diagram",{},[76,345,346],{},"Search, filtering and paging all run in the browser on that index. There's no database and no server endpoint to keep running. Prerendered files on a CDN are enough.",[76,348,349,350,120,355,360],{},"The module sits on top of ",[88,351,354],{"href":352,"rel":353},"https://www.npmjs.com/package/nuxt-webmcp",[92],"nuxt-webmcp",[88,356,359],{"href":357,"rel":358},"https://www.npmjs.com/package/vue-webmcp",[92],"vue-webmcp",", which handle the registration itself, the origin trial token and the checks for Chrome's size limits. I only had to write the content side.",[99,362,364],{"id":363},"filtering-by-tag-instead-of-guessing-keywords","Filtering by tag instead of guessing keywords",[76,366,367,368,371],{},"To make filtering useful, I added a ",[80,369,370],{},"tags"," field to this blog's posts. Then I asked: \"Which posts on this site are case studies?\"",[76,373,374,375,377,378,381,382,384,385,388,389,120,392,395],{},"Gemini called ",[80,376,328],{}," first, saw a ",[80,379,380],{},"case-study"," tag with 4 posts, and then called ",[80,383,317],{}," with ",[80,386,387],{},"{\"tag\": \"case-study\"}",". The result had ",[80,390,391],{},"total: 4",[80,393,394],{},"nextOffset: null",", so it knew the list was complete. Its answer listed exactly those 4 posts with dates and links.",[76,397,398],{},[273,399],{"alt":400,"src":401},"Gemini calls list_tags, then list_content with the case-study tag, and starts listing the four case studies.","/blog/nuxt-content-webmcp/q1-case-studies.png",[76,403,404,405,407],{},"That's the reason ",[80,406,328],{}," exists. An agent can't filter by a tag it doesn't know about, and guessing keywords is less reliable than reading the site's own taxonomy.",[99,409,411],{"id":410},"some-answers-dont-need-the-full-text","Some answers don't need the full text",[76,413,414],{},"The third question: \"What has Niklas written about headless CMS, and which post should a startup founder read first?\"",[76,416,417,418,420,421,423],{},"One ",[80,419,311],{}," call for \"headless CMS\" returned 4 posts with their descriptions. Gemini answered from those and recommended ",[88,422,26],{"href":27},". It didn't open any post. The Network tab shows only the 9.1 KB index.",[76,425,426],{},[273,427],{"alt":428,"src":429},"One search_content call returns four headless CMS posts. Only index.json appears in the Network panel.","/blog/nuxt-content-webmcp/q3-headless-cms.png",[99,431,433],{"id":432},"where-the-agent-went-wrong-and-what-i-changed","Where the agent went wrong, and what I changed",[76,435,436],{},"When I ran the WebSockets question a second time, Gemini searched for \"Niklas Nuxt WebSockets Vercel\". The search required every word to match, and my name isn't in any title, tag or description, so it found nothing.",[76,438,439,440,442,443,446,447,449,450,452],{},"The result included a hint to try ",[80,441,317],{},", and Gemini followed it. Then it made up a path, ",[80,444,445],{},"/blog/nuxt-websockets-websockets-vercel",". The tool returned an error saying there's no page at that path and to use ",[80,448,311],{}," or ",[80,451,317],{}," to find valid paths. On the next call it used the right path and read the post in the same 8 chunks.",[76,454,455],{},[273,456],{"alt":457,"src":458},"The search for \"Niklas Nuxt WebSockets Vercel\" finds nothing, the agent lists posts, tries a wrong path, gets an error and recovers.","/blog/nuxt-content-webmcp/q2-search-recovery.png",[76,460,461,462,464,465,468],{},"So the hints and error messages did their job, but the detour cost three extra calls. Agents put the author's name into search queries often enough that I changed the search: since version 0.1.1, when no post matches every word, ",[80,463,311],{}," returns the posts that match some of them, ranked by how many, and marks the result with ",[80,466,467],{},"partial: true",". The same query now returns the WebSockets post first.",[99,470,472],{"id":471},"two-build-details-that-werent-obvious","Two build details that weren't obvious",[76,474,475,479,480,483,484,487],{},[476,477,478],"strong",{},"The index can't come from a content hook."," Nuxt Content v3 caches parsed files and skips its ",[80,481,482],{},"content:file:afterParse"," hook for files that haven't changed since the last build. An index built from that hook would be missing posts on every warm build. The module builds the index in a Nitro route instead, which reads every collection with ",[80,485,486],{},"queryCollection",", and prerenders that route.",[76,489,490,493],{},[476,491,492],{},"Nitro doesn't follow links from JSON responses."," I first tried to get the per-post files prerendered by listing them in a response header that Nitro's prerenderer reads. That only works for HTML responses. The fix was to hook into the prerenderer: when the index route is generated, the module reads the paths from the index and adds one route per post to the prerender queue.",[99,495,497],{"id":496},"how-it-compares-to-nuxt-ai-ready","How it compares to nuxt-ai-ready",[76,499,500,505,506,509],{},[88,501,504],{"href":502,"rel":503},"https://nuxtseo.com/ai-ready",[92],"nuxt-ai-ready"," also registers WebMCP tools, as part of a broader set of AI features (",[80,507,508],{},"llms.txt",", an MCP server, content signals). It covers every route of a site and has full-text search through a database on the server. Its tool for reading a page returns the page up to the output limit and truncates the rest.",[76,511,512],{},"nuxt-content-webmcp does less. It only covers Nuxt Content, and search only looks at titles, tags, descriptions and excerpts. In exchange, agents can read complete posts in chunks, filter by tag and date, and everything runs from static files. If you want full-text search across a whole site, nuxt-ai-ready is the better choice. For a Nuxt Content blog or docs site, this module is the smaller tool for that one job.",[99,514,516],{"id":515},"trying-it","Trying it",[76,518,519,520,523],{},"Add the module after ",[80,521,522],{},"@nuxt/content",":",[525,526,531],"pre",{"className":527,"code":528,"language":529,"meta":530,"style":530},"language-sh shiki shiki-themes github-light github-dark","pnpm add nuxt-content-webmcp\n","sh","",[80,532,533],{"__ignoreMap":530},[534,535,538,542,546],"span",{"class":536,"line":537},"line",1,[534,539,541],{"class":540},"sScJk","pnpm",[534,543,545],{"class":544},"sZZnC"," add",[534,547,548],{"class":544}," nuxt-content-webmcp\n",[525,550,554],{"className":551,"code":552,"language":553,"meta":530,"style":530},"language-ts shiki shiki-themes github-light github-dark","// nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: ['@nuxt/content', 'nuxt-content-webmcp']\n})\n","ts",[80,555,556,562,579,597],{"__ignoreMap":530},[534,557,558],{"class":536,"line":537},[534,559,561],{"class":560},"sJ8bj","// nuxt.config.ts\n",[534,563,565,569,572,575],{"class":536,"line":564},2,[534,566,568],{"class":567},"szBVR","export",[534,570,571],{"class":567}," default",[534,573,574],{"class":540}," defineNuxtConfig",[534,576,578],{"class":577},"sVt8B","({\n",[534,580,582,585,588,591,594],{"class":536,"line":581},3,[534,583,584],{"class":577},"  modules: [",[534,586,587],{"class":544},"'@nuxt/content'",[534,589,590],{"class":577},", ",[534,592,593],{"class":544},"'nuxt-content-webmcp'",[534,595,596],{"class":577},"]\n",[534,598,600],{"class":536,"line":599},4,[534,601,602],{"class":577},"})\n",[76,604,605,606,609],{},"On the next build, it logs the index size, for example ",[80,607,608],{},"content index: 13 entries, 9.1 KB",".",[76,611,612,613,616],{},"To check it locally, enable ",[80,614,615],{},"chrome://flags/#enable-webmcp-testing"," in Chrome, restart, and run this in the console of your site:",[525,618,622],{"className":619,"code":620,"language":621,"meta":530,"style":530},"language-js shiki shiki-themes github-light github-dark","await document.modelContext.getTools()\n","js",[80,623,624],{"__ignoreMap":530},[534,625,626,629,632,635],{"class":536,"line":537},[534,627,628],{"class":567},"await",[534,630,631],{"class":577}," document.modelContext.",[534,633,634],{"class":540},"getTools",[534,636,637],{"class":577},"()\n",[76,639,640,641,644],{},"For visitors' browsers without the flag, register an origin trial token for your domain and set it as ",[80,642,643],{},"NUXT_PUBLIC_WEBMCP_ORIGIN_TRIAL_TOKEN",". nuxt-webmcp adds the meta tag. This blog runs with a token, so if you open it in a current Chrome with the Model Context Tool Inspector, you can ask it the same questions.",[76,646,647],{},"Not every agent uses WebMCP tools yet. The Claude in Chrome extension, for example, didn't list them when I tested, even though the console showed all four. The API is still an origin trial, so expect that to change.",[76,649,650,651,609],{},"The code, the configuration options and the hooks for adding your own tools are in the ",[88,652,654],{"href":90,"rel":653},[92],"README on GitHub",[656,657,658],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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 .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":530,"searchDepth":564,"depth":564,"links":660},[661,662,663,664,665,666,667,668],{"id":101,"depth":564,"text":102},{"id":298,"depth":564,"text":299},{"id":363,"depth":564,"text":364},{"id":410,"depth":564,"text":411},{"id":432,"depth":564,"text":433},{"id":471,"depth":564,"text":472},{"id":496,"depth":564,"text":497},{"id":515,"depth":564,"text":516},"2026-11-27T00:00:00.000Z","I built nuxt-content-webmcp, an open-source Nuxt module that gives in-browser AI agents four read-only tools for a Nuxt Content site. In a test on this blog, Gemini read a 6,582-character post in 8 chunks from one static JSON file.","md","/blog/nuxt-content-webmcp/hero.png",{},8,{"title":38,"description":670},{"loc":39},[678,679,680,681],"nuxt","webmcp","ai-agents","open-source","80eGWOC2cHhvvpZWvzuJKeZGPNWvgvETFBB0oivxTWo",[684,686],{"title":34,"path":35,"stem":36,"description":685,"children":-1},"A four-year migration moved a veterinary industry webshop off a legacy monolith onto an orchestrated AWS architecture, service by service, without ever pausing the live business.",{"title":42,"path":43,"stem":44,"description":687,"children":-1},"A first-hand debugging story — Nuxt 4's native WebSocket API is the cleanest I've seen in a full-stack framework, but the Nitro Vercel preset never implements the upgrade handshake. Vercel supports WebSockets fine; Nuxt's adapter for it just doesn't exist yet.",1795780796173]