---
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 Claude, Cursor, and VS Code."
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 Claude, Cursor, and VS Code.

<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 Model Context Protocol (MCP) servers on Nitro 2 and 3. Drop tools, resources, and prompts into `server/mcp`, isolate multiple servers, and protect private endpoints with OAuth 2.1.

</template>
</landing-hero>

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

Write TypeScript, ship an MCP server

</template>

<template v-slot:description="">

Define tools, resources, prompts, and authenticated servers in standard TypeScript files under `server/mcp`. The module discovers every file and serves it 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-architecture href="https://github.com/nuxt/nuxt.com/pull/2567" hrefLabel="nuxt/nuxt.com#2567" linkLabel="Read the nuxt.com walkthrough" to="https://mcp-toolkit.nuxt.dev/1.x/examples/admin-mcp-server">
<template v-slot:title="">

One Nuxt app, isolated MCP servers

</template>

<template v-slot:description="">

Configure public and private endpoints with `mcp.servers` and `defineMcpServer`. Enforce OAuth 2.1, server policies, per-tool scopes, and service tokens before any handler runs.

</template>
</landing-architecture>

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

Built for production MCP servers

</template>

<template v-slot:description="">

Powered by a web-standard Nitro runtime on `h3-mcp`, with typed definitions, multi-server composition, and full developer tooling.

</template>

<template v-slot:features="">
<landing-feature-item description="Runs on nitro-mcp-toolkit and h3-mcp with no Node built-ins. Deploy on Nitro 2 or Nitro 3 across Node, Vercel, Cloudflare Workers, Deno, and Bun." icon="i-lucide-cpu" title="Nitro 2 & 3 engine" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/protocol-runtimes">



</landing-feature-item>

<landing-feature-item description="Create files in server/mcp/{tools,resources,prompts}, including across Nuxt layers. Filenames become names with no manual registry." 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="Scale from one /mcp route to named mcp.servers, defineMcpServer files, directory overlays, or explicit createMcpHandler() routes." icon="i-lucide-layers" title="Composition APIs" to="https://mcp-toolkit.nuxt.dev/1.x/servers/composition">



</landing-feature-item>

<landing-feature-item description="Built-in OAuth 2.1 resource server with Better Auth, Clerk, Okta, and WorkOS adapters plus automatic RFC 9728 discovery metadata." icon="i-lucide-shield-check" title="OAuth 2.1 & providers" to="https://mcp-toolkit.nuxt.dev/1.x/authentication/providers">



</landing-feature-item>

<landing-feature-item description="Require per-definition scopes with 403 insufficient_scope challenges, run authorize() per request, and accept scoped service tokens." icon="i-lucide-lock" title="Scopes & service tokens" to="https://mcp-toolkit.nuxt.dev/1.x/authentication/scopes">



</landing-feature-item>

<landing-feature-item description="Validate inputs and outputs with Zod, Valibot, or ArkType. Return plain objects for structuredContent with a JSON text fallback." icon="i-lucide-braces" title="Standard Schema & outputs" to="https://mcp-toolkit.nuxt.dev/1.x/tools/define-tools">



</landing-feature-item>

<landing-feature-item description="Import stable Mcp* types from @nuxtjs/mcp-toolkit/server with full inference and no leaked internal engine types." icon="i-lucide-file-code-2" title="Toolkit-owned types" to="https://mcp-toolkit.nuxt.dev/1.x/reference/types">



</landing-feature-item>

<landing-feature-item description="Answer 2026-07-28 and 2025-era MCP clients on one URL by default (era: 'dual'), including elicitation and progress notifications." icon="i-lucide-network" title="Dual protocol support" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/protocol-runtimes">



</landing-feature-item>

<landing-feature-item description="Read verified identity, cancellation, and middleware state from (args, event) in every handler, and pair with Nitro cached functions." 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="Ship InstallButton, SVG badges, IDE deeplinks for Cursor and VS Code, and an llms.txt section that advertises your endpoint." icon="i-lucide-download" title="1-click client install" to="https://mcp-toolkit.nuxt.dev/1.x/getting-started/connection">



</landing-feature-item>

<landing-feature-item description="Drive a real MCP client against your handlers in memory during CI, and verify tool selection with the AI SDK and Evalite." icon="i-lucide-flask-conical" title="Testing & evals" to="https://mcp-toolkit.nuxt.dev/1.x/advanced/testing">



</landing-feature-item>

<landing-feature-item description="Inspect live tools, resources, and prompts in Nuxt DevTools, and install Agent Skills so coding agents build and review tools with you." icon="i-lucide-wand-2" title="DevTools & Agent Skills" to="https://mcp-toolkit.nuxt.dev/1.x/getting-started/agent-skills">



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

<landing-dev-tools darkImage="/mcp-devtools-dark.png" imageAlt="MCP Inspector tab in Nuxt DevTools" lightImage="/mcp-devtools-light.png" linkLabel="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="">

Launch the bundled MCP Inspector directly from Nuxt DevTools. List and call tools, read resources, expand prompts, and pass local auth headers with no client setup.

</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","size":"xl"},{"label":"Migrate from 0.x","to":"/1.x/getting-started/migration","icon":"i-lucide-git-branch","color":"neutral","variant":"outline","size":"xl"},{"label":"Star on GitHub","to":"https://github.com/nuxt-modules/mcp-toolkit","icon":"i-lucide-github","color":"neutral","variant":"ghost","size":"xl"}]">
<template v-slot:title="">

Ready to build your Nuxt MCP server?

</template>

<template v-slot:description="">

Install the 1.0 beta, define your first typed tool, and connect Claude, Cursor, or VS Code in minutes.

</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.
