wp-navigator-mcp

littlebearapps/wp-navigator-mcp

3.2

If you are the rightful owner of wp-navigator-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

WP Navigator MCP Server is a Model Context Protocol server designed for AI-assisted WordPress management, compatible with Claude Code, Claude Desktop, and other MCP-compatible clients.

Tools
5
Resources
0
Prompts
0

WP Navigator MCP

npm version npm downloads CI codecov License: MIT

AI-powered WordPress management via Claude Code and MCP-compatible clients.

Manage posts, pages, media, plugins, themes, and Gutenberg blocks through natural language — all with safe-by-default writes and full rollback support.


Coming Soon — January 2025

The WP Navigator WordPress plugin is not yet available. This MCP server requires the plugin to be installed on your WordPress site.

Register your interest at wpnav.ai →


Who Is This For?

WordPress DeveloperContent Manager
"I want AI to help build and maintain sites""I want to manage content with natural language"
You build WordPress sites and want AI assistance for development tasks.You manage content and want faster, more intuitive workflows.
Key features: Gutenberg block editing, plugin management, theme switching, bulk operationsKey features: Post/page creation, media uploads, safe publishing, content rollback

What WP Navigator MCP Does

Content Management

  • Create and edit posts/pages with Gutenberg blocks
  • Upload media from URLs (sideload images automatically)
  • Manage comments, categories, and tags
  • Full revision history with rollback support

Site Management

  • Install, activate, and manage plugins
  • Switch and customize themes
  • View and manage WordPress users

Safety & Rollback

  • Safe by default — Writes disabled until explicitly enabled
  • Full revision history — Rollback any content change
  • Policy-based access — WordPress plugin enforces granular permissions
  • HTTPS enforced — Secure connections for non-localhost

Quick Start

1. Install WP Navigator Plugin

Free Version (WordPress.org)

Search for "WP Navigator" in WordPress Plugins → Add New, or:

  1. Download from WordPress.org
  2. Upload to /wp-content/plugins/
  3. Activate the plugin
Pro Version
  1. Purchase at wpnav.ai/pro
  2. Download the plugin ZIP
  3. Upload via WordPress Admin → Plugins → Add New → Upload
  4. Activate and enter your license key

2. Create Application Password

In WordPress Admin: Users → Your Profile → Application Passwords

  1. Enter a name (e.g., "WP Navigator MCP")
  2. Click "Add New Application Password"
  3. Copy the password immediately (it won't be shown again)

3. Create Configuration File

Create wpnav.config.json in your project directory:

{
  "WP_BASE_URL": "https://your-site.com",
  "WP_REST_API": "https://your-site.com/wp-json",
  "WPNAV_BASE": "https://your-site.com/wp-json/wpnav/v1",
  "WPNAV_INTROSPECT": "https://your-site.com/wp-json/wpnav/v1/introspect",
  "WP_APP_USER": "your-username",
  "WP_APP_PASS": "xxxx xxxx xxxx xxxx xxxx xxxx"
}

4. Configure Your MCP Client

Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "wpnav": {
      "command": "npx",
      "args": ["-y", "@littlebearapps/wp-navigator-mcp", "./wpnav.config.json"],
      "env": {
        "WPNAV_ENABLE_WRITES": "1"
      }
    }
  }
}

Note: WPNAV_ENABLE_WRITES=1 enables create/update/delete operations. Without it, only read operations work (safe by default).

5. Verify Connection

In Claude, try:

"Use wpnav_introspect to check the WordPress connection"


CLI Mode

WP Navigator MCP also works as a standalone CLI for scripts and web-based AI agents.

Invocation Patterns

# Recommended: Use the package directly (runs CLI if command provided)
npx @littlebearapps/wp-navigator-mcp init
npx @littlebearapps/wp-navigator-mcp --version
npx @littlebearapps/wp-navigator-mcp tools

# Alternative: Use the wpnav binary (installed globally or via npx -p)
npx -p @littlebearapps/wp-navigator-mcp wpnav init
npm install -g @littlebearapps/wp-navigator-mcp && wpnav init

Note: The package is scoped, so npx wpnav@version won't work. Use the full package name @littlebearapps/wp-navigator-mcp.

Initialize a Project

npx wpnav init                   # Interactive wizard (guided mode)
npx wpnav init --mode scaffold   # Quick setup without prompts
npx wpnav init --mode ai-handoff # Create AI-ready handoff document
npx wpnav init --repair          # Fix broken configuration (v2.4.0+)

Creates project structure with wpnavigator.jsonc manifest and sample-prompts/ folder containing ready-to-use AI prompts (self-test, add-page, content-audit, etc.).

Direct Tool Invocation

# List posts
npx wpnav call wpnav_list_posts --limit 5

# Get site overview
npx wpnav call wpnav_get_site_overview

# Preview a change without executing
npx wpnav call wpnav_update_post --id 1 --title "New Title" --dry-run

Other Commands

npx wpnav status      # Check WordPress connection and plugin edition
npx wpnav tools       # List available tools
npx wpnav tools --format markdown  # Generate documentation
npx wpnav configure   # Set up credentials interactively
npx wpnav validate    # Validate config and manifest
npx wpnav doctor      # Run system diagnostics
npx wpnav cleanup     # Remove onboarding helper files

Multi-Platform Support (v2.3.0)

# Generate MCP configuration for your platform
npx wpnav mcp-config --claude    # Claude Code (.mcp.json)
npx wpnav mcp-config --codex     # OpenAI Codex (config.toml)
npx wpnav mcp-config --gemini    # Google Gemini CLI (settings.json)

# Export config as environment variables
npx wpnav export-env             # Shell format
npx wpnav export-env --format docker  # Dockerfile
npx wpnav export-env --format github  # GitHub Actions

Zero-Friction Setup (v2.7.0)

Magic Link — Connect instantly from WordPress admin:

# Copy link from WordPress → WP Navigator → Connect AI
npx wpnav connect wpnav://connect?site=example.com&token=abc123...

Context for non-MCP agents — Generate context for ChatGPT and other web AI:

npx wpnav context                # Markdown format
npx wpnav context --compact      # Reduced tokens

Role management — AI personas with focused tool access:

npx wpnav role list              # List available roles
npx wpnav role show developer    # Show role details
npx wpnav role set content-editor # Set active role

AI Guidance Features (v2.6.0)

Roles — AI personas with focused tool access and behavior guidance:

npx wpnav call wpnav_list_roles           # List available roles
npx wpnav call wpnav_load_role --slug content-editor  # Load a role

Built-in roles: content-editor, developer, seo-specialist, site-admin

Cookbooks — Plugin-specific AI guidance for Gutenberg, Elementor, and more:

npx wpnav call wpnav_list_cookbooks       # List available cookbooks
npx wpnav call wpnav_load_cookbook --slug gutenberg  # Load cookbook

MCP Resources — Context delivery for AI assistants:

  • wpnav://tools/overview — Categorized tool list
  • wpnav://site/context — Current site information
  • wpnav://roles/{slug} — Role definitions
  • wpnav://cookbooks/{slug} — Plugin guidance

Site Understanding Tools (v2.8.0)

Site Health — WordPress Site Health integration:

npx wpnav call wpnav_site_health                      # Full health report
npx wpnav call wpnav_site_health --categories security,performance

Site Statistics & Settings — Comprehensive site metrics:

npx wpnav call wpnav_site_statistics     # Posts, users, comments counts
npx wpnav call wpnav_site_settings       # General settings overview

Discovery — Explore WordPress capabilities:

npx wpnav call wpnav_list_rest_routes    # All REST API endpoints
npx wpnav call wpnav_list_shortcodes     # Registered shortcodes
npx wpnav call wpnav_list_block_patterns # Available block patterns
npx wpnav call wpnav_list_block_templates # FSE block templates

Options Management — Plugin options (safe by default):

npx wpnav call wpnav_get_option --option woocommerce_currency
npx wpnav call wpnav_set_option --option yoast_seo_title --value "My Site"

Security: wpnav_set_option only allows plugin-detected prefixes (e.g., woocommerce_*, yoast_*). Core WordPress options are blocked.

Maintenance — Site maintenance operations:

npx wpnav call wpnav_flush_rewrite       # Flush rewrite rules
npx wpnav call wpnav_maintenance_mode --enable true   # Enable maintenance
npx wpnav call wpnav_maintenance_mode --enable false  # Disable maintenance

AI-Friendly Suggestions — Context-aware guidance:

npx wpnav suggest                        # Get contextual suggestions
npx wpnav suggest --limit 3              # Limit suggestions

Snapshot & Sync Workflow

npx wpnav snapshot site       # Capture full site index
npx wpnav snapshot page about # Capture single page
npx wpnav diff                # Compare manifest vs WordPress
npx wpnav sync --dry-run      # Preview changes
npx wpnav sync                # Apply manifest to WordPress
npx wpnav rollback <id>       # Restore from pre-sync snapshot

See for complete documentation.


Project Structure

When you initialize a WP Navigator project with npx wpnav init, the following structure is created:

my-wp-project/
├── wpnavigator.jsonc       # Site manifest (your intent)
├── wpnav.config.json       # Connection configuration
├── .gitignore              # Ignores credentials and snapshots
├── snapshots/              # Site state snapshots
│   ├── site_index.json     # Full site structure
│   └── pages/              # Individual page snapshots
├── roles/                  # Custom AI role definitions
├── cookbooks/              # Custom plugin cookbooks (override bundled)
├── docs/                   # Project documentation
└── sample-prompts/         # Ready-to-use AI prompts
    ├── self-test.txt
    ├── add-page.txt
    └── content-audit.txt

Directory Purposes

DirectoryPurposeGit Status
snapshots/Read-only state from WordPressIgnore (regeneratable)
roles/Custom AI behavior definitionsCommit
cookbooks/Plugin-specific AI guidanceCommit
docs/Project documentationCommit
sample-prompts/Reusable AI promptsCommit

Recommended .gitignore

# Credentials (NEVER commit)
wpnav.config.json

# Snapshots (regenerate with wpnav snapshot)
snapshots/

Available Tools

93 tools available through the Dynamic Toolsets architecture.

MCP-Exposed Tools (5)

These tools are directly exposed to AI via MCP:

ToolPurpose
wpnav_introspectCheck connection, policy, plugin status
wpnav_search_toolsFind tools by query or category
wpnav_describe_toolsLoad full schemas for specific tools
wpnav_executeExecute any tool dynamically
wpnav_contextGet context for non-MCP AI agents

Discoverable Tools (93)

All other tools are discovered via wpnav_search_tools and executed via wpnav_execute:

CategoryToolsExamples
Core7wpnav_get_site_overview, wpnav_search, wpnav_list_post_types
Posts7wpnav_list_posts, wpnav_create_post_with_blocks
Pages6wpnav_list_pages, wpnav_snapshot_page
Media4wpnav_upload_media_from_url
Plugins7wpnav_list_plugins, wpnav_activate_plugin
Themes7wpnav_list_themes, wpnav_activate_theme
Gutenberg7wpnav_gutenberg_insert_block
Users5wpnav_list_users, wpnav_get_user
Comments5wpnav_list_comments, wpnav_create_comment
Taxonomy12wpnav_list_categories, wpnav_create_tag
Batch3wpnav_batch_get, wpnav_batch_update, wpnav_batch_delete
Cookbook3wpnav_list_cookbooks, wpnav_load_cookbook
Roles2wpnav_list_roles, wpnav_load_role
Options2wpnav_get_option, wpnav_set_option
Settings2wpnav_site_settings, wpnav_site_statistics
Health1wpnav_site_health
Discovery4wpnav_list_rest_routes, wpnav_list_shortcodes, wpnav_list_block_patterns
Maintenance2wpnav_flush_rewrite, wpnav_maintenance_mode

CLI Tool Discovery

List and search tools via CLI:

npx wpnav tools                          # List all tools
npx wpnav tools --category gutenberg     # Filter by category
npx wpnav tools --search "create post"   # Search by query

Architecture

┌─────────────────────┐     MCP Protocol     ┌────────────────────┐
│    Claude Code /    │ ◄──────────────────► │  WP Navigator MCP  │
│    MCP Clients      │                       │   (npm package)    │
└─────────────────────┘                       └─────────┬──────────┘
                                                        │ REST API
                                                        ▼
                                              ┌────────────────────┐
                                              │     WordPress      │
                                              │   + WP Navigator   │
                                              │      Plugin        │
                                              └────────────────────┘

Dynamic Toolsets (v2.7.0)

WP Navigator uses a Dynamic Toolsets architecture for token efficiency:

ApproachToken UsageTools Exposed
v2.6 (legacy)~19,500 tokens75 individual tools
v2.7+ (dynamic)~500 tokens5 meta-tools (93 discoverable)

How it works:

  1. Search — AI uses wpnav_search_tools to find relevant tools by natural language query
  2. Describe — AI uses wpnav_describe_tools to load full schemas for tools it wants to use
  3. Execute — AI uses wpnav_execute to run tools with validated arguments

Meta-tools exposed to AI:

ToolPurpose
wpnav_introspectCheck connection, policy, plugin status
wpnav_search_toolsFind tools by query or category
wpnav_describe_toolsGet full schemas for specific tools
wpnav_executeExecute any tool dynamically
wpnav_contextGet context for non-MCP AI agents

Example flow:

AI: "I need to create a blog post"

1. wpnav_search_tools(query: "create blog post")
   → Returns: wpnav_create_post, wpnav_create_post_with_blocks

2. wpnav_describe_tools(tools: ["wpnav_create_post_with_blocks"])
   → Returns: Full schema with parameters

3. wpnav_execute(tool: "wpnav_create_post_with_blocks", arguments: {...})
   → Creates the post

Local Development (v2.4.0+)

WP Navigator supports local development environments like LocalWP, Docker, and MAMP.

Environment Variable Credentials

Keep credentials out of config files using $VAR syntax:

{
  "WP_BASE_URL": "http://localhost:8080",
  "WP_REST_API": "http://localhost:8080/wp-json",
  "WPNAV_BASE": "http://localhost:8080/wp-json/wpnav/v1",
  "WPNAV_INTROSPECT": "http://localhost:8080/wp-json/wpnav/v1/introspect",
  "WP_APP_USER": "$WP_APP_USER",
  "WP_APP_PASS": "$WP_APP_PASS"
}

Then set environment variables:

export WP_APP_USER="admin"
export WP_APP_PASS="xxxx xxxx xxxx xxxx"

HTTP for Localhost

For local development without HTTPS:

ALLOW_INSECURE_HTTP=1 npx wpnav status

Or in your MCP config:

{
  "env": {
    "ALLOW_INSECURE_HTTP": "1"
  }
}

Repair Mode

Fix broken or outdated configuration:

npx wpnav init --repair

This validates existing files and regenerates any that are missing or invalid.


Environment Variables

VariableDefaultDescription
WPNAV_ENABLE_WRITES0Enable write operations (create/update/delete)
ALLOW_INSECURE_HTTP0Allow HTTP for localhost development
WPNAV_TOOL_TIMEOUT_MS600000Per-tool timeout (10 minutes)
WPNAV_MAX_RESPONSE_KB64Maximum response size before truncation
WP_APP_USER-WordPress username (for env-based credentials)
WP_APP_PASS-WordPress application password (for env-based credentials)

Compatibility

WP Navigator MCPWP Navigator FreeWP Navigator ProNode.js
v1.0.xv1.0+v1.0+18+

MCP Clients: Claude Code, Gemini CLI, any MCP-compatible client

Platforms: macOS (Apple Silicon & Intel), Linux (x64), Windows (via WSL)


Quick Troubleshooting

IssueSolution
"Command starts MCP server"Update to v2.8.0+, use npx @littlebearapps/wp-navigator-mcp@latest
"Config not found"Config auto-discovers from parent dirs; use --config for explicit path
"401 Unauthorized"Regenerate Application Password in WordPress Admin → Users → Profile
"WRITES_DISABLED"Set WPNAV_ENABLE_WRITES=1 environment variable
"Plugin not found" (404)Ensure WP Navigator plugin is installed and activated
SSL errorsUse ALLOW_INSECURE_HTTP=1 for localhost development

Full diagnostics:

npx wpnav doctor          # Run system health checks
npx wpnav doctor --json   # JSON output for debugging

See for detailed solutions.


Documentation

Getting Started:

  • — Quick setup in 5 minutes
  • — Configure Claude Code, Codex, Gemini CLI

Reference:

  • — Complete command documentation
  • — Token-efficient tool discovery architecture
  • — Security model and best practices

Guides:

  • — Token optimization, security, and workflow tips
  • — Dynamic Toolsets workflow for AI agents
  • — Common issues and solutions
  • — Frequently asked questions
  • — How to contribute

Support & Community


Related Projects

ProjectDescription
WP Navigator FreeWordPress plugin (Free)
WP Navigator ProWordPress plugin (Premium)

License

MIT — see for details.


Made with care by Little Bear Apps

Issues · Discussions ·