---
title: "MCP Server"
description: "AI-powered development with the WPNuxt MCP Server"
canonical_url: "https://wpnuxt.com/ai"
---
# MCP Server

> AI-powered development with the WPNuxt MCP Server

WPNuxt provides a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that enables AI assistants to interact with your WordPress site and generate WPNuxt code.

## What is MCP?

MCP is an open protocol that allows AI assistants like Claude to connect to external tools and data sources. The WPNuxt MCP server gives AI assistants the ability to:

- Connect to your WordPress site via WPGraphQL
- Analyze your content structure (posts, pages, custom post types)
- Detect installed plugins and blocks
- Generate WPNuxt project files, pages, and components
- Help migrate from WPNuxt v1 to v2

## Getting Started

### Using with Claude Desktop

Add the WPNuxt MCP server to your Claude Desktop configuration:

```json
{
  "mcpServers": {
    "wpnuxt": {
      "url": "https://wpnuxt.com/mcp"
    }
  }
}
```

### Using with Claude Code

Add to your project's `.mcp.json`:

```json
{
  "mcpServers": {
    "wpnuxt": {
      "type": "sse",
      "url": "https://wpnuxt.com/mcp"
    }
  }
}
```

## Available Features

### Prompts

Prompts provide guided workflows for common tasks:

<table>
<thead>
  <tr>
    <th>
      Prompt
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        connect-wordpress
      </code>
    </td>
    
    <td>
      Connect to a WordPress site and explore available content
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        switch-wordpress
      </code>
    </td>
    
    <td>
      Switch to a different WordPress site or check connection status
    </td>
  </tr>
</tbody>
</table>

### Tools

Tools perform specific actions. See the [Tools Reference](https://wpnuxt.com/ai/tools) for the complete list.

**WordPress Discovery:**

- `wp_connect` - Connect to a WordPress site
- `wp_list_content_types` - List posts, pages, and custom post types
- `wp_list_menus` - List navigation menus
- `wp_list_taxonomies` - List categories, tags, and custom taxonomies
- `wp_detect_plugins` - Detect installed plugins
- `wp_list_blocks` - Analyze Gutenberg blocks in use

**Content Fetching:**

- `wp_fetch_posts` - Fetch posts with metadata
- `wp_fetch_pages` - Fetch pages with hierarchy
- `wp_sample_content` - Get sample content for development
- `wp_query` - Execute custom GraphQL queries

**Code Generation:**

- `wpnuxt_init` - Generate a complete WPNuxt project
- `wpnuxt_generate_pages` - Generate page components
- `wpnuxt_generate_components` - Generate content cards and lists
- `wpnuxt_generate_queries` - Generate custom GraphQL queries
- `wpnuxt_generate_block_renderers` - Generate Gutenberg block components
- `wpnuxt_setup_menus` - Generate navigation menu components

**Utilities:**

- `wpnuxt_list_composables` - List available WPNuxt composables
- `wpnuxt_migrate` - Analyze v1 projects and generate migration helpers

## Example: Creating a Blog Listing Page

Here's a real workflow showing how an AI assistant uses the MCP server to build a page.

**You:** Connect to my WordPress site at [https://wordpress.example.com](https://wordpress.example.com) and create a blog listing page.

**AI:** I'll connect to your site and analyze its content.

*The AI calls wp_connect with your URL, then wp_list_content_types to see what's available.*

**AI:** Your site has 24 posts across 5 categories. I'll generate a blog listing page with category filtering.

*The AI calls wpnuxt_generate_pages to create the page component:*

```vue [pages/blog.vue]
<script setup lang="ts">
const { data: posts } = await usePosts()

useHead({ title: 'Blog' })
</script>

<template>
  <div>
    <h1>Blog</h1>
    <article v-for="post in posts" :key="post.id">
      <NuxtLink :to="post.uri">
        <h2>{{ post.title }}</h2>
      </NuxtLink>
      <div v-sanitize-html="post.excerpt" />
    </article>
  </div>
</template>
```

**You:** Add featured images and a category filter.

**AI:** I'll check what image fields are available and generate the updated component.

*The AI calls wp_sample_content to inspect the post data structure, then updates the page.*

This back-and-forth continues until the page matches your requirements. The AI has full context of your WordPress content structure throughout the conversation.

## Self-Hosting

The MCP server is integrated into the WPNuxt documentation site. You can run it locally:

```bash
cd docs
pnpm install
pnpm dev
```

Then configure your MCP client to connect to `http://localhost:3000/mcp`.


## Sitemap

See the full [sitemap](https://wpnuxt.com/sitemap.md) for all pages.
