Build an MCP server with Nuxt
By Steven Van ·
Vercel's knowledge base shows how to add tools, resources, and prompts to a Nuxt app using the new Nuxt MCP Toolkit module.
The Vercel knowledge base now covers the Nuxt MCP Toolkit, a module that adds a Model Context Protocol server directly to a Nuxt application. Installing it with npx nuxt module add mcp-toolkit sets up an HTTP endpoint that AI clients like Cursor, VS Code, and Claude Desktop can connect to.
The walkthrough covers building tools, resources, and prompts under a server/mcp/ directory, where they're auto-discovered without manual wiring:
- Tools validate input with Zod and can return strings, objects, or full results, with errors thrown via h3's createError
- Resources expose read-only data such as files or database schemas for AI context
- Prompts are reusable message templates that appear when typing / in a chat client
The module also includes an MCP Inspector built into Nuxt DevTools for browsing and testing definitions, middleware support for adding Bearer token authentication, dynamic definitions, session persistence across tool calls, and a Code Mode that lets models orchestrate multiple tool calls in a single execution.