Enables the server to fetch and index WordPress plugin source code directly from public and private GitHub repositories.
Indexes block registrations and Gutenberg-specific JavaScript APIs, allowing AI tools to correctly reference editor namespaces and block variations.
Provides a searchable index of WooCommerce hooks, including dynamic names and callback signatures, to ensure accuracy in e-commerce development tasks.
Indexes every action, filter, and API call from WordPress core to provide AI assistants with a verified database for searching and validating hook names.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wp-devdocs-mcpsearch for hooks to modify the woocommerce checkout billing fields"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
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 exist —
woocommerce_email_after_order_detailssounds right but isn't realSome use deprecated namespaces —
wp.editor.InspectorControlsinstead ofwp.blockEditor.InspectorControlsMost miss newer hooks — suggesting
pre_get_postsfor WooCommerce order queries when HPOS useswoocommerce_order_list_table_prepare_items_query_argsParameters 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:
Searches the indexed database for relevant hooks
Validates the exact hook name exists before writing it into code
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 |
|
PHP filters |
|
JS hooks |
|
Block registrations |
|
JS API usages |
|
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
Index Your First Source
Each source:add command clones the repo and indexes it automatically:
That's it. 3,500+ hooks indexed in under a minute.
Connect to Claude Code
Add the MCP server to your Claude Code configuration. Create or edit .mcp.json in your project root:
Now when you ask Claude Code to write WordPress plugin code, it will automatically search and validate hook names against your indexed sources before generating code.
Indexing Sources
WordPress Core
Expected output:
Gutenberg
WooCommerce
Any Public Plugin
Your Private Plugins
For private GitHub repos, store your token in an environment variable (never in the config):
Local Plugin Development
Point directly at a folder on your machine — great for plugins you're actively developing:
Source Options
Option | Description |
| Unique name for this source (required) |
|
|
| GitHub repository URL |
| Only index a subfolder within the repo |
| Git branch (default: |
| Environment variable name holding a GitHub token (private repos) |
| Local folder path |
| Register the source without indexing it yet |
CLI Reference
CLI Examples
MCP Tools
When connected to Claude Code (or any MCP-compatible client), four tools are available:
search_hooks
Full-text search with BM25 ranking across all indexed hooks. Supports filters for type, source, dynamic hooks, and removed hooks.
validate_hook
Exact-match check — returns VALID with file locations, NOT_FOUND with similar suggestions, or REMOVED for deprecated hooks. This is how the AI confirms a hook name before using it in code.
get_hook_context
Returns the full code window around a hook: the line itself, 8 lines before, 4 lines after, the docblock, enclosing function, and class. Gives the AI enough context to use the hook correctly.
search_block_apis
Searches block registrations (registerBlockType, etc.) and JavaScript API usages (wp.blockEditor.*, wp.data.*, etc.). Only matches on structured fields (block name, API call, namespace) — not surrounding code — to prevent false positives.
How It Works
Sources are registered via the CLI — each points to a GitHub repo or local folder
Indexing clones/pulls the repo, scans PHP and JS/TS files, and extracts hooks using regex-based parsers
Storage uses SQLite with FTS5 full-text search and WAL mode for fast concurrent reads
Incremental updates skip files that haven't changed (mtime + content hash)
Soft-delete tracking marks hooks that were previously indexed but no longer found as
removedThe MCP server exposes the database as tools over stdio — your AI assistant queries it in real-time
Data Storage
All data lives in ~/.wp-devdocs-mcp/:
Requirements
Node.js 20+
~500MB disk space per large plugin source (WooCommerce, Gutenberg)
License
MIT