mcp
@nuxtjs/mcp-toolkit

Create MCP servers directly in your app with zero configuration.

Nuxt MCP Toolkit

Install MCP in Cursor Install MCP in VS Code

Nuxt MCP Toolkit

npm version npm downloads license

A Nuxt module to easily create a Model Context Protocol (MCP) server directly in your Nuxt application. Define MCP tools, resources, and prompts with zero configuration - just create files and they're automatically discovered and registered.

✨ Features

  • 🎯 Zero Configuration - Automatic discovery of tools, resources, prompts, and apps
  • 📦 File-based - Organize definitions in intuitive directory structures
  • 🚀 Multiple Handlers - Create multiple MCP endpoints in a single app
  • 🖼️ MCP Apps - Ship interactive Vue UI widgets to MCP Apps-compatible hosts
  • 🔍 Built-in Inspector - Visual debugging tool in Nuxt DevTools
  • 📝 TypeScript First - Full type safety with auto-imports
  • 🔒 Zod Validation - Built-in input/output validation
  • 🤖 Agent Discovery - Advertises your server in llms.txt when nuxt-llms is registered

🚀 Installation

Use nuxt to install the module automatically:

npx nuxt add mcp

Or install manually:

# npm
npm install -D @nuxtjs/mcp-toolkit zod

# yarn
yarn add -D @nuxtjs/mcp-toolkit zod

# pnpm
pnpm add -D @nuxtjs/mcp-toolkit zod

# bun
bun add -D @nuxtjs/mcp-toolkit zod

📖 Quick Start

Add the module to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['@nuxtjs/mcp-toolkit'],
  mcp: {
    name: 'My MCP Server',
    version: '1.0.0',
  },
})

Create your first tool in server/mcp/tools/echo.ts:

import { z } from 'zod'

export default defineMcpTool({
  description: 'Echo back a message',
  inputSchema: {
    message: z.string().describe('The message to echo back'),
  },
  handler: async ({ message }) => {
    return {
      content: [{
        type: 'text',
        text: `Echo: ${message}`,
      }],
    }
  },
})

The tool will be automatically discovered and registered. No imports needed - all helpers are auto-imported!

☁️ Cloudflare Workers

For Cloudflare Workers/Pages deployment, install the agents package:

pnpm add agents

The module automatically detects Cloudflare presets and uses the native MCP handler.

📚 Documentation

📖 Full Documentation →

🤝 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

# Install dependencies
pnpm install

# Generate type stubs
pnpm run dev:prepare

# Start the playground
pnpm run dev

# Run tests
pnpm run test

📄 License

Published under the MIT license.

Made by @HugoRCD and community 💛

Sponsors

HugoRCD sponsors