WP DevDocs MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add wp-devdocs -- npx wp-devdocs-mcp
README.md

A verified WordPress hook database for AI coding assistants.

wp-devdocs-mcp

Give your AI coding assistant a verified WordPress hook database instead of letting it guess.

wp-devdocs-mcp is a local MCP server that indexes every action, filter, block registration, and JS API call from WordPress, WooCommerce, Gutenberg, or any plugin you work with. It gives AI tools like Claude Code a verified database to search and validate against instead of relying on training data.

Works with Claude Code, Cursor, Windsurf, and any MCP-compatible client.

Why This Exists

AI coding assistants are changing how we build WordPress plugins. Tools like Claude Code, Cursor, and Windsurf can scaffold entire plugins in minutes — but they all share the same blind spot: hook names come from training data, not from the actual source code.

Most of the time this works fine. Models like Claude Sonnet nail common hooks almost every time. But "most of the time" isn't good enough when you're shipping production code, and not every model is Claude Sonnet. Across the landscape of LLMs doing code generation today:

  • Some models invent hooks that don't existwoocommerce_email_after_order_details sounds right but isn't real
  • Some use deprecated namespaceswp.editor.InspectorControls instead of wp.blockEditor.InspectorControls
  • Most miss newer hooks — suggesting pre_get_posts for WooCommerce order queries when HPOS uses woocommerce_order_list_table_prepare_items_query_args
  • Parameters get mixed up — wrong argument count or order in callback signatures
  • No model knows your custom plugins — private or proprietary hooks are invisible to every model's training data

The core issue is simple: we can't rely 100% on any model to produce correct WordPress hook names from memory alone. Even the best models benefit from verification, and the rest genuinely need it. You only find out about hallucinated hooks when the code doesn't work — and in an agentic workflow where the AI writes, tests, and iterates autonomously, one bad hook name can send it down a rabbit hole of debugging something that was never going to work.

The Solution

Feed the LLM real data. Instead of hoping the model remembers the right hook name, give it a verified database to query.

wp-devdocs-mcp parses the actual source code of any WordPress plugin and builds a searchable index of every hook with its exact name, type, parameters, file location, and surrounding code context. Your AI assistant queries this index before writing code — so every hook name in the generated code is verified against the real source.

This fits naturally into agentic coding workflows. When Claude Code (or any MCP-compatible assistant) needs to use a WordPress hook, it:

  1. Searches the indexed database for relevant hooks
  2. Validates the exact hook name exists before writing it into code
  3. Reads the context — parameters, docblock, surrounding code — to use it correctly

No hallucination. No guessing. No debugging phantom hooks.

What gets indexed:

Type Examples
PHP actions do_action(), do_action_ref_array()
PHP filters apply_filters(), apply_filters_ref_array()
JS hooks addAction(), addFilter(), applyFilters(), doAction()
Block registrations registerBlockType(), registerBlockVariation()
JS API usages wp.blocks.*, wp.blockEditor.*, wp.data.*, etc.
Markdown documentation Handbooks parsed into searchable pages (since v1.1.0)

What the AI gets for each hook:

  • Exact name (with dynamic name detection for hooks like woocommerce_thankyou_{$payment_method})
  • Type (action / filter / js_action / js_filter)
  • Parameters and count
  • File path and line number
  • Enclosing function and class
  • Docblock
  • Code window (8 lines before, 4 after)
  • Source plugin name

Quick Start

Install

npm install -g wp-devdocs-mcp

Or run directly with npx (no install needed):

npx wp-devdocs-mcp

Index Sources

# Add all preset sources at once (since v1.1.0)
wp-hooks quick-add-all

# Or add individual presets (since v1.1.0)
wp-hooks quick-add wp-core
wp-hooks quick-add woocommerce
wp-hooks quick-add gutenberg-source
wp-hooks quick-add plugin-handbook

Or add sources manually:

# WooCommerce (uses trunk branch)
wp-hooks source:add \
  --name woocommerce \
  --type github-public \
  --repo https://github.com/woocommerce/woocommerce \
  --subfolder plugins/woocommerce \
  --branch trunk

That's it. 3,500+ hooks indexed in under a minute.

Connect to Your AI Assistant

Add the MCP server to your configuration. Create or edit .mcp.json in your project root (or ~/.claude/.mcp.json globally):

{
  "mcpServers": {
    "wp-devdocs": {
      "command": "npx",
      "args": ["

Tools (2)

search_hooksSearch the indexed database for WordPress hooks, filters, and JS API calls.
get_hook_detailsRetrieve detailed context for a specific hook including parameters and source code.

Configuration

claude_desktop_config.json
{"mcpServers": {"wp-devdocs": {"command": "npx", "args": ["wp-devdocs-mcp"]}}}

Try it

Search for all available WooCommerce hooks related to order processing.
Find the correct parameters and usage for the 'wp_insert_post' filter.
Verify if 'woocommerce_email_after_order_details' is a valid hook and show its context.
List all Gutenberg block registration hooks available in the current index.

Frequently Asked Questions

What are the key features of WP DevDocs?

Indexes PHP actions, filters, and JS API calls from WordPress and plugins. Provides verified hook names, parameters, and docblocks to AI models. Includes code context with 8 lines before and 4 lines after hook definitions. Supports indexing of WordPress core, WooCommerce, Gutenberg, and custom plugins. Parses markdown documentation for searchable handbook pages.

What can I use WP DevDocs for?

Preventing AI from hallucinating non-existent WordPress hook names during plugin development. Ensuring correct parameter counts and order when implementing WordPress filters. Identifying deprecated namespaces in block editor code. Retrieving accurate context for proprietary hooks in custom private plugins.

How do I install WP DevDocs?

Install WP DevDocs by running: npx wp-devdocs-mcp

What MCP clients work with WP DevDocs?

WP DevDocs works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep WP DevDocs docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare