Core Concepts

Model Context Protocol (MCP)

Last updated by Harlan Wilton in fix!: rework module.

Model Context Protocol (MCP) support via @nuxtjs/mcp-toolkit.

Your site exposes tools and resources that AI agents like Claude can query for page data and search.

Installation

npx nuxi module add @nuxtjs/mcp-toolkit
nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-ai-ready',
    '@nuxtjs/mcp-toolkit',
  ],
})

See @nuxtjs/mcp-toolkit docs for server configuration.

Connection

Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "my-site": {
      "command": "npx",
      "args": ["-y", "@nuxtjs/mcp-client", "https://example.com/mcp"]
    }
  }
}

Tools

list_pages

Returns page metadata as JSON. Cached 1 hour.

Parameters: None

Response:

[
  {
    "route": "/docs/getting-started",
    "title": "Getting Started",
    "description": "Quick start guide",
    "headings": "h1:Getting Started|h2:Installation",
    "updatedAt": "2025-01-15T10:30:00Z"
  }
]

search_pages_fuzzy

Fuzzy search across pages via Fuse.js. Searches title, description, and route. Cached 5 minutes.

Parameters:

ParamTypeDescription
querystringSearch query
limitnumberMax results (default: 10)

Response:

[
  {
    "route": "/docs/installation",
    "title": "Installation",
    "description": "Install the module",
    "score": 0.15
  }
]

Resources

resource://nuxt-ai-ready/pages

Page listing as JSON. Same data as list_pages tool. Cached 1 hour.

Use resources when agents need static data without parameters.

Data Availability

MCP tools return data from prerendered pages stored in page-data.jsonl.

EnvironmentData Source
Dev modeEmpty (no prerender data)
ProductionVirtual module reads JSONL

For full MCP functionality, test with a production build (nuxi generate).

Configuration

Disable specific features:

nuxt.config.ts
export default defineNuxtConfig({
  aiReady: {
    mcp: {
      tools: false, // Disable all tools
      resources: false, // Disable all resources
    },
  }
})
Did this page help you?