MCP Server
WPNuxt provides a Model Context Protocol (MCP) 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
- Access Nuxt and Nuxt UI documentation (proxied from official MCP servers)
Getting Started
Using with Claude Desktop
Add the WPNuxt MCP server to your Claude Desktop configuration:
{
"mcpServers": {
"wpnuxt": {
"url": "https://wpnuxt.com/mcp"
}
}
}
Using with Claude Code
Add to your project's .mcp.json:
{
"mcpServers": {
"wpnuxt": {
"type": "sse",
"url": "https://wpnuxt.com/mcp"
}
}
}
Available Features
Prompts
Prompts provide guided workflows for common tasks:
| Prompt | Description |
|---|---|
connect-wordpress | Connect to a WordPress site and explore available content |
switch-wordpress | Switch to a different WordPress site or check connection status |
Tools
Tools perform specific actions. See the Tools Reference for the complete list.
WordPress Discovery:
wp_connect- Connect to a WordPress sitewp_list_content_types- List posts, pages, and custom post typeswp_list_menus- List navigation menuswp_list_taxonomies- List categories, tags, and custom taxonomieswp_detect_plugins- Detect installed pluginswp_list_blocks- Analyze Gutenberg blocks in use
Content Fetching:
wp_fetch_posts- Fetch posts with metadatawp_fetch_pages- Fetch pages with hierarchywp_sample_content- Get sample content for developmentwp_query- Execute custom GraphQL queries
Code Generation:
wpnuxt_init- Generate a complete WPNuxt projectwpnuxt_generate_pages- Generate page componentswpnuxt_generate_components- Generate content cards and listswpnuxt_generate_queries- Generate custom GraphQL querieswpnuxt_generate_block_renderers- Generate Gutenberg block componentswpnuxt_setup_menus- Generate navigation menu components
Utilities:
wpnuxt_list_composables- List available WPNuxt composableswpnuxt_migrate- Analyze v1 projects and generate migration helpers
Nuxt Documentation Proxy:
nuxt_docs- Access Nuxt framework documentationnuxt_ui_docs- Access Nuxt UI component documentation
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 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:
<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:
cd docs
pnpm install
pnpm dev
Then configure your MCP client to connect to http://localhost:3000/mcp.