Core Concepts

Model Context Protocol (MCP)

Last updated by Harlan Wilton in chore: sync.

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 with pagination. Cached 1 hour.

Parameters:

ParamTypeDescription
limitnumberMax pages to return (default: 100)
offsetnumberSkip first N pages (default: 0)

Response:

{
  "pages": [
    {
      "route": "/docs/getting-started",
      "title": "Getting Started",
      "description": "Quick start guide",
      "headings": "h1:Getting Started|h2:Installation",
      "updatedAt": "2025-01-15T10:30:00Z"
    }
  ],
  "total": 50,
  "limit": 100,
  "offset": 0,
  "hasMore": false
}

search_pages

Full-text search across pages via SQLite FTS5. Searches title, description, route, headings, keywords, and content. 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 the SQLite database populated during prerendering.

EnvironmentData Source
Dev modeEmpty (no prerender data)
ProductionSQLite database

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?