---
title: "Tools Reference"
description: "Complete reference for WPNuxt MCP server tools"
canonical_url: "https://wpnuxt.com/ai/tools"
---
# Tools Reference

> Complete reference for WPNuxt MCP server tools

This page documents all available tools in the WPNuxt MCP server.

## WordPress Discovery Tools

### wp_connect

Connect to a WordPress site for the current session.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        wordpressUrl
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      WordPress site URL (e.g., <code>
        https://your-site.com
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

**Example:**

```text
Connect to https://wordpress.wpnuxt.com
```

**Returns:** Site information including title, description, language, and GraphQL endpoint status.

---

### wp_get_site_settings

Fetch WordPress general settings (site title, tagline, URL, etc.).

**Parameters:** None

**Returns:** Site title, description, URL, language, and reading settings.

---

### wp_list_content_types

List all content types in WordPress including custom post types.

**Parameters:** None

**Returns:** Array of content types with:

- `name` - Internal name (e.g., `post`, `page`, `product`)
- `graphqlSingleName` - Singular GraphQL name
- `graphqlPluralName` - Plural GraphQL name
- `hierarchical` - Whether content supports parent/child relationships

---

### wp_list_taxonomies

List all taxonomies (categories, tags, custom taxonomies).

**Parameters:** None

**Returns:** Array of taxonomies with GraphQL names and associated content types.

---

### wp_list_menus

List all WordPress navigation menus with their items.

**Parameters:** None

**Returns:** Array of menus with:

- `name` - Menu name
- `slug` - Menu slug
- `locations` - Theme locations where menu is assigned
- `items` - Menu items with labels, URLs, and hierarchy

---

### wp_detect_plugins

Detect installed WordPress plugins by analyzing the GraphQL schema.

**Parameters:** None

**Returns:** Detected plugins including:

- WooCommerce
- Advanced Custom Fields (ACF)
- Yoast SEO
- WPGraphQL extensions
- Headless Login for WPGraphQL

---

### wp_list_blocks

Analyze Gutenberg blocks used across the site.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sampleSize
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Number of posts/pages to scan (10-100, default 50)
    </td>
  </tr>
</tbody>
</table>

**Returns:** Block usage statistics including:

- Core blocks (paragraph, heading, image, etc.)
- Custom/plugin blocks
- Usage frequency
- Sample attributes

---

## Content Fetching Tools

### wp_fetch_posts

Fetch posts from WordPress.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        first
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Number of posts (1-100, default 10)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        after
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Cursor for pagination
    </td>
  </tr>
</tbody>
</table>

**Returns:** Posts with title, excerpt, content, featured image, author, and categories.

---

### wp_fetch_pages

Fetch pages from WordPress.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        first
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Number of pages (1-100, default 10)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        after
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Cursor for pagination
    </td>
  </tr>
</tbody>
</table>

**Returns:** Pages with title, content, featured image, and parent/child hierarchy.

---

### wp_sample_content

Get sample content for development and testing.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        contentType
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Content type to sample (default: <code>
        post
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        count
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Number of items (1-10, default 3)
    </td>
  </tr>
</tbody>
</table>

**Returns:** Sample content items with full data structure.

---

### wp_query

Execute a custom GraphQL query against WordPress.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        query
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      GraphQL query string
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        variables
      </code>
    </td>
    
    <td>
      object
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Query variables
    </td>
  </tr>
</tbody>
</table>

**Returns:** Raw GraphQL response.

---

## Code Generation Tools

### wpnuxt_init

Generate a complete WPNuxt project based on WordPress site analysis.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        projectName
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Project folder name
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        packageManager
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      <code>
        pnpm
      </code>
      
      , <code>
        npm
      </code>
      
      , <code>
        yarn
      </code>
      
      , or <code>
        bun
      </code>
      
       (default: <code>
        pnpm
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeNuxtUI
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Include Nuxt UI v4 (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        generatePages
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate page components (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        generateComponents
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate content components (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        setupMenus
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate menu components (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        generateQueries
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate GraphQL queries (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

**Returns:** Complete project files including:

- `nuxt.config.ts`
- `package.json`
- `app.vue`
- Default layout
- Home page
- Environment files

---

### wpnuxt_generate_pages

Generate Nuxt page components for WordPress content types.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        contentTypes
      </code>
    </td>
    
    <td>
      string<span>
        
      </span>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Content types to generate pages for
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeHome
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate home page (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeCatchAll
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate catch-all route (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        displayPreferences
      </code>
    </td>
    
    <td>
      object
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Layout preferences per content type
    </td>
  </tr>
</tbody>
</table>

**Returns:** Page components with:

- Archive (index) pages
- Single item pages
- Catch-all route for WordPress URIs

---

### wpnuxt_generate_components

Generate Vue components for WordPress content types.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        contentTypes
      </code>
    </td>
    
    <td>
      string<span>
        
      </span>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Content types (default: <code>
        post
      </code>
      
      , <code>
        page
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeTaxonomies
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate taxonomy lists (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeUtilities
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate utility components (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

**Returns:** Components including:

- `PostCard.vue` / `PageCard.vue` - Content preview cards
- `PostsList.vue` / `PagesList.vue` - Grid list components
- `CategoriesList.vue` / `TagsList.vue` - Taxonomy lists
- `FeaturedImage.vue` - Responsive image component

---

### wpnuxt_generate_queries

Generate custom GraphQL queries for content types.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        contentTypes
      </code>
    </td>
    
    <td>
      string<span>
        
      </span>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Content types to generate queries for
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeFragments
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Include reusable fragments (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

**Returns:** GraphQL query files for the `extend/queries/` folder.

---

### wpnuxt_generate_block_renderers

Generate Vue components for rendering Gutenberg blocks.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        includeCore
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Include core block renderers (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeCustom
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Include custom/plugin blocks (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

**Returns:** Block renderer components including:

- `BlockRenderer.vue` - Main renderer component
- `CoreParagraph.vue`, `CoreHeading.vue`, etc. - Core blocks
- Custom block components based on detected usage

---

### wpnuxt_setup_menus

Generate navigation menu components.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        menuName
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Specific menu to generate for
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        includeNuxtUI
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Use Nuxt UI components (default: auto-detect)
    </td>
  </tr>
</tbody>
</table>

**Returns:** Menu components with:

- Desktop navigation
- Mobile navigation
- Dropdown submenus

---

## Utility Tools

### wpnuxt_list_composables

List WPNuxt composables available for the project.

**Parameters:** None

**Returns:** Available composables with:

- Default composables (`usePosts`, `usePages`, `useMenu`, etc.)
- Naming convention explanation
- Usage examples

---

### wpnuxt_migrate

Analyze a WPNuxt v1 project and detect usage anti-patterns, then generate migration helpers.

**Parameters:**

<table>
<thead>
  <tr>
    <th>
      Name
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        fileContents
      </code>
    </td>
    
    <td>
      array
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Files to scan (path and content)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        generateHelpers
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Generate compatibility helpers (default: <code>
        true
      </code>
      
      )
    </td>
  </tr>
</tbody>
</table>

**What it scans for:**

*v1 → v2 Migration Issues:*

- Removed composables (`useFeaturedImage`, `useWPUri`, `usePrevNextPost`, `isStaging`)
- Renamed composables (`useWPPosts` → `usePosts`, `useAsyncWPPosts` → `useLazyPosts`)
- Renamed directives (`v-sanitize` → `v-sanitize-html`)
- Removed components (`<WPContent>`, `<ContentRenderer>`, `<StagingBanner>`)
- Changed configuration options

*Usage Anti-Patterns (SSR issues):*

- Composables called inside lifecycle hooks (`onMounted`, etc.) - breaks SSR
- Composables called inside functions instead of top level
- Missing `.value` access on Refs returned by composables
- Incorrect data assignment patterns

**Example of anti-patterns detected:**

```vue
<script setup>
// ❌ BAD: Composable inside onMounted breaks SSR
onMounted(async () => {
  const { data } = await usePosts()  // Will not work on server!
  posts.value = data || []           // Missing .value on data
})

// ✅ GOOD: Composable at top level
const { data: posts } = await usePosts()
</script>
```

**Returns:**

- List of issues with file locations, line numbers, and severity
- Auto-fix suggestions
- Generated compatibility helper file (`app/composables/wpnuxt-compat.ts`)
- Step-by-step migration instructions

See [Migration Guide](https://wpnuxt.com/migration/v1-to-v2) for more details.


## Sitemap

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