---
title: "Nuxt MCP Toolkit"
description: "Add typed Model Context Protocol (MCP) servers to Nuxt on Nitro 2 & 3. Expose tools, resources, and prompts with OAuth 2.1 to any MCP client."
canonical_url: "https://mcp-toolkit.nuxt.dev"
---
# Nuxt MCP Toolkit

> Add typed Model Context Protocol (MCP) servers to Nuxt on Nitro 2 & 3. Expose tools, resources, and prompts with OAuth 2.1 to any MCP client.

<landing-hero :badge="{"label":"1.0 Beta · Nitro 2 & 3 · h3-mcp","to":"/1.x/getting-started/migration"}" :secondary="{"label":"Migrate from 0.x","to":"/1.x/getting-started/migration"}" command="npx skills add https://mcp-toolkit.nuxt.dev" installCommand="pnpm add @nuxtjs/mcp-toolkit@beta" linkLabel="Get Started" linkTo="/1.x/getting-started/installation">
<template v-slot:title="">

Expose your Nuxt app to any AI

</template>

<template v-slot:description="">

Build typed MCP servers in Nuxt on Nitro 2 and 3. Drop tools, resources, and prompts into `server/mcp` and connect any MCP client.

</template>
</landing-hero>

<landing-code>
<template v-slot:title="">

Define tools, resources, and prompts in TypeScript

</template>

<template v-slot:description="">

Create files under `server/mcp`. The module discovers each definition, validates inputs and outputs, and serves them over HTTP.

</template>

<template v-slot:tools="">

```ts
// server/mcp/tools/calculate-total.ts
import { z } from 'zod'
import { defineMcpTool } from '@nuxtjs/mcp-toolkit/server'

export default defineMcpTool({
  description: 'Add a list of numbers',
  annotations: { readOnlyHint: true, openWorldHint: false },
  inputSchema: z.object({
    values: z.array(z.number()).min(1).describe('Numbers to sum'),
  }),
  outputSchema: z.object({ total: z.number() }),
  handler: ({ values }) => ({
    total: values.reduce((sum, value) => sum + value, 0),
  }),
})
```

</template>

<template v-slot:resources="">

```ts
// server/mcp/resources/guide.ts
import { z } from 'zod'
import { defineMcpResource } from '@nuxtjs/mcp-toolkit/server'

export default defineMcpResource({
  uriTemplate: 'docs://guides/{slug}',
  description: 'Read an application guide',
  mimeType: 'text/markdown',
  handler: async (_uri, variables) => {
    const { slug } = z.object({ slug: z.string().min(1) }).parse(variables)
    return await readGuide(slug)
  },
})
```

</template>

<template v-slot:prompts="">

```ts
// server/mcp/prompts/weekly-digest.ts
import { z } from 'zod'
import { defineMcpPrompt } from '@nuxtjs/mcp-toolkit/server'

export default defineMcpPrompt({
  scopes: ['admin:analytics'],
  description: 'Generate a weekly activity digest',
  inputSchema: z.object({
    sinceDays: z.coerce.number().int().min(1).max(60).default(7),
  }),
  handler: ({ sinceDays }) =>
    `Summarize feedback and traffic for the last ${sinceDays} days.`,
})
```

</template>

<template v-slot:servers="">

```ts
// server/mcp-admin/index.ts
import { defineMcpServer } from '@nuxtjs/mcp-toolkit/server'
import { betterAuth } from '@nuxtjs/mcp-toolkit/oauth/better-auth'

export default defineMcpServer({
  name: 'admin',
  description: 'Team-only MCP server for analytics and feedback.',
  oauth: betterAuth({
    resource: 'https://nuxt.com/mcp/admin',
    issuer: 'https://nuxt.com',
    jwks: 'https://nuxt.com/api/auth/jwks',
    scopesSupported: ['offline_access', 'admin:analytics', 'admin:chats'],
  }),
  authorize: ({ sub }) => isMcpAdmin(sub),
})
```

</template>
</landing-code>

<landing-features>
<template v-slot:title="">

Everything included

</template>

<template v-slot:description="">

File-based discovery, schema validation, authentication, testing, and DevTools in one Nuxt module.

</template>

<template v-slot:features="">
<landing-feature-item description="Drop files into server/mcp/tools, resources, or prompts. Routes, names, and schemas wire up automatically." icon="i-lucide-folder-search" title="File-based discovery" to="https://mcp-toolkit.nuxt.dev/1.x/servers/directories-layers">



</landing-feature-item>

<landing-feature-item description="Validate inputs and outputs with Zod, Valibot, or ArkType, and return plain objects with full TypeScript inference." icon="i-lucide-braces" title="Type-safe schemas" to="https://mcp-toolkit.nuxt.dev/1.x/tools/define-tools">



</landing-feature-item>

<landing-feature-item description="Protect private endpoints with Better Auth, Clerk, Okta, WorkOS, or service tokens, and restrict tools by scope." icon="i-lucide-shield-check" title="OAuth 2.1 & scopes" to="https://mcp-toolkit.nuxt.dev/1.x/authentication/providers">



</landing-feature-item>

<landing-feature-item description="Run a public /mcp endpoint and a private /mcp/admin endpoint in one Nuxt app with separate catalogs and auth." icon="i-lucide-layers" title="Multiple isolated servers" to="https://mcp-toolkit.nuxt.dev/1.x/servers/composition">



</landing-feature-item>

<landing-feature-item description="Web-standard runtime for Nitro 2 and Nitro 3 with no Node built-ins. Deploy to Vercel, Node, Cloudflare Workers, Deno, or Bun." icon="i-lucide-cloud" title="Deploy anywhere Nitro runs" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/protocol-runtimes">



</landing-feature-item>

<landing-feature-item description="Add an InstallButton or deeplink so users connect your MCP server to Cursor or VS Code in one click." icon="i-lucide-download" title="One-click client install" to="https://mcp-toolkit.nuxt.dev/1.x/getting-started/connection">



</landing-feature-item>

<landing-feature-item description="List tools, run arguments, and inspect responses straight from Nuxt DevTools without leaving your app." icon="i-lucide-terminal" title="Built-in DevTools Inspector" to="https://mcp-toolkit.nuxt.dev/1.x/getting-started/inspector">



</landing-feature-item>

<landing-feature-item description="Connect a real MCP client to your handlers in memory during CI with Vitest, with no extra server or tunnel." icon="i-lucide-flask-conical" title="Test like any route" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/testing">



</landing-feature-item>

<landing-feature-item description="Ask users for confirmation, missing fields, or sign-in mid-tool call inside their AI client." icon="i-lucide-message-square-plus" title="Interactive user input" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/elicitation">



</landing-feature-item>

<landing-feature-item description="Stream step-by-step progress back to the client while long-running tools fetch data or run jobs." icon="i-lucide-activity" title="Live progress updates" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/notifications-progress">



</landing-feature-item>

<landing-feature-item description="Read the signed-in user, headers, and Nitro cached functions directly inside every tool handler." icon="i-lucide-zap" title="Request context & caching" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/request-context">



</landing-feature-item>

<landing-feature-item description="Share MCP definitions across Nuxt Layers, and install Agent Skills so coding agents write tools with you." icon="i-lucide-sparkles" title="Nuxt Layers & Agent Skills" to="https://mcp-toolkit.nuxt.dev/1.x/getting-started/agent-skills">



</landing-feature-item>
</template>
</landing-features>

<landing-bento>
<template v-slot:title="">

Auth, elicitation, testing, and deployment

</template>

<template v-slot:description="">

Isolate public and private servers, ask users for input mid-call, run contract tests in Vitest, and deploy anywhere Nitro runs.

</template>
</landing-bento>

<landing-observability linkLabel="Read the Observability docs" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/observability">
<template v-slot:title="">

Know what every agent did, and why it failed

</template>

<template v-slot:description="">

Each request, auth decision, and tool call is reported with its outcome and duration. Log each request as one evlog wide event, or trace it with OpenTelemetry in Sentry, Datadog, or any OTLP backend.

</template>

<template v-slot:event="">

```json
{
  "level": "error",
  "path": "/mcp",
  "order": { "id": "o_42" },
  "mcp": {
    "method": { "name": "tools/call" },
    "client": { "name": "claude-code", "version": "2.1.0" },
    "operation": { "kind": "tool", "outcome": "error", "duration_ms": 37 }
  },
  "gen_ai": {
    "tool": { "name": "refund", "call": { "arguments": "{\"orderId\":\"o_42\"}" } }
  },
  "jsonrpc": { "request": { "id": "7" } },
  "error": { "message": "Refund window closed", "why": "Order older than 30 days" }
}
```

</template>
</landing-observability>

<landing-dev-tools darkImage="/mcp-devtools-dark.png" imageAlt="MCP Inspector tab in Nuxt DevTools" lightImage="/mcp-devtools-light.png" linkLabel="Read the Inspector docs" to="https://mcp-toolkit.nuxt.dev/1.x/getting-started/inspector">
<template v-slot:title="">

Built-in DevTools Inspector

</template>

<template v-slot:description="">

Browse discovered schemas, run tools with generated forms, and inspect responses straight from Nuxt DevTools.

</template>
</landing-dev-tools>

<landing-cta :links="[{"label":"Get Started","to":"/1.x/getting-started/installation","icon":"i-lucide-arrow-right","trailing":true,"color":"primary"},{"label":"Migrate from 0.x","to":"/1.x/getting-started/migration","icon":"i-lucide-git-branch","color":"neutral","variant":"outline"}]" installCommand="pnpm add @nuxtjs/mcp-toolkit@beta">
<template v-slot:title="">

Get started with Nuxt MCP Toolkit

</template>

<template v-slot:description="">

Install the 1.0 beta and connect your Nuxt app to any MCP client.

</template>
</landing-cta>

## Resources for Agents

- [API catalog: every service document this site publishes](https://mcp-toolkit.nuxt.dev/.well-known/api-catalog)
- [Sitemap (XML)](https://mcp-toolkit.nuxt.dev/sitemap.xml)
- [Sitemap (Markdown): every page on the site](https://mcp-toolkit.nuxt.dev/sitemap.md)
- [MCP server card: MCP endpoint at https://mcp-toolkit.nuxt.dev/mcp](https://mcp-toolkit.nuxt.dev/.well-known/mcp/server-card.json)
- [MCP endpoint (streamable HTTP)](https://mcp-toolkit.nuxt.dev/mcp)
- [llms.txt: index of the documentation for LLMs](https://mcp-toolkit.nuxt.dev/llms.txt)
- [llms-full.txt: the full documentation as a single file](https://mcp-toolkit.nuxt.dev/llms-full.txt)
- [Agent skills index: every skill published by this site](https://mcp-toolkit.nuxt.dev/.well-known/skills/index.json)
- [Agent skill: manage-mcp](https://mcp-toolkit.nuxt.dev/.well-known/skills/manage-mcp/SKILL.md)
- [OpenAPI document: every route this site serves to agents](https://mcp-toolkit.nuxt.dev/openapi.json)


## Sitemap

See the full [sitemap](https://mcp-toolkit.nuxt.dev/sitemap.md) for all pages.
