# automattic/wordpress-mcp architecture

> Architecture diagram of the GitHub repository automattic/wordpress-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/automattic/wordpress-mcp
- Repository: https://github.com/automattic/wordpress-mcp

## Overview

WordPress MCP is an archived plugin that exposes WordPress capabilities through the Model Context Protocol. Its main runtime flow starts at the plugin bootstrap, selects a transport, and serves MCP requests through handlers backed by registered tools, resources, and prompts. Tool calls are dispatched to WordPress operations; resources expose site and account information. The plugin also provides administrator settings and JWT token management, plus a CLI for validating tool definitions. The README marks the project deprecated; detailed links below are limited to relationships shown in excerpts, the source index, or the README.

Main entry points: [`includes/Core/WpMcp.php`](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/WpMcp.php) (MCP Registry), [`wordpress-mcp.php`](https://github.com/automattic/wordpress-mcp/blob/trunk/wordpress-mcp.php) (Plugin Bootstrap), [`includes/Tools`](https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Tools) (WordPress Tools), [`includes/Core/McpStreamableTransport.php`](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/McpStreamableTransport.php) (MCP Transports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["MCP Runtime"]
  node_bootstrap["Plugin Bootstrap<br/>[wordpress-mcp.php]"]
  node_transports["MCP Transports"]
  node_core["MCP Registry<br/>[WpMcp.php]"]
  node_toolhandler["Tool Requests<br/>[ToolsHandler.php]"]
  node_resourcehandler["Resource Requests"]
  node_prompthandler["Prompt Requests<br/>[PromptsHandler.php]"]
  node_dispatch["Tool Dispatcher"]
  node_toolregistration["Tool Registration"]
end

subgraph group_capabilities["WordPress Capabilities"]
  node_toolcatalog["WordPress Tools"]
  node_resources["Site Resources"]
  node_prompts["MCP Prompts"]
end

subgraph group_admin["Administration"]
  node_settings["Admin Settings<br/>[Settings.php]"]
  node_jwt["JWT Authentication<br/>[JwtAuth.php]"]
  node_settingsui["Settings Interface<br/>[index.js]"]
  node_tokenui["Token Controls"]
end

subgraph group_operations["Operations"]
  node_cli["Tool Validation CLI"]
  node_validator["Tool Validator<br/>[ValidateTool.php]"]
end

node_client(("MCP Client"))
node_wordpress[("WordPress Site")]

node_client -.->|"sends requests"| node_transports
node_bootstrap -->|"loads"| node_transports
node_transports -->|"uses registry"| node_core
node_core -->|"initializes tools"| node_toolcatalog
node_core -->|"initializes resources"| node_resources
node_core -->|"initializes prompts"| node_prompts
node_toolhandler -->|"lists tools"| node_core
node_resourcehandler -->|"reads registry"| node_core
node_prompthandler -->|"uses registry"| node_core
node_toolhandler -->|"dispatches calls"| node_dispatch
node_dispatch -->|"resolves tools"| node_core
node_toolcatalog -->|"registers tools"| node_toolregistration
node_resources -.->|"reads site data"| node_wordpress
node_toolcatalog -.->|"operates on content"| node_wordpress
node_bootstrap -->|"loads settings"| node_settings
node_bootstrap -->|"loads authentication"| node_jwt
node_settingsui -->|"renders tab"| node_tokenui
node_tokenui -.->|"manages tokens"| node_jwt
node_cli -->|"gets tools"| node_core
node_cli -->|"validates tools"| node_validator

click node_bootstrap "https://github.com/automattic/wordpress-mcp/blob/trunk/wordpress-mcp.php"
click node_transports "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/McpStreamableTransport.php"
click node_core "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/WpMcp.php"
click node_toolhandler "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/RequestMethodHandlers/ToolsHandler.php"
click node_resourcehandler "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/RequestMethodHandlers/ResourcesHandler.php"
click node_prompthandler "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/RequestMethodHandlers/PromptsHandler.php"
click node_dispatch "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Utils/HandleToolsCall.php"
click node_toolregistration "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/RegisterMcpTool.php"
click node_toolcatalog "https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Tools"
click node_resources "https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Resources"
click node_prompts "https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Prompts"
click node_settings "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Admin/Settings.php"
click node_jwt "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Auth/JwtAuth.php"
click node_settingsui "https://github.com/automattic/wordpress-mcp/blob/trunk/src/settings/index.js"
click node_tokenui "https://github.com/automattic/wordpress-mcp/blob/trunk/src/settings/AuthenticationTokensTab.js"
click node_cli "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Cli/ValidateToolsCommand.php"
click node_validator "https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Utils/ValidateTool.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_transports,node_core,node_toolhandler,node_resourcehandler,node_prompthandler,node_dispatch,node_toolregistration,node_client toneBlue
class node_toolcatalog,node_resources,node_prompts,node_wordpress toneAmber
class node_settings,node_jwt,node_settingsui,node_tokenui toneMint
class node_cli,node_validator toneRose
```

## Components

### MCP Runtime

- [Plugin Bootstrap](https://github.com/automattic/wordpress-mcp/blob/trunk/wordpress-mcp.php): `wordpress-mcp.php`
- [MCP Transports](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/McpStreamableTransport.php): `includes/Core/McpStreamableTransport.php`
- [MCP Registry](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/WpMcp.php): `includes/Core/WpMcp.php`
- [Tool Requests](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/RequestMethodHandlers/ToolsHandler.php): `includes/RequestMethodHandlers/ToolsHandler.php`
- [Resource Requests](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/RequestMethodHandlers/ResourcesHandler.php): `includes/RequestMethodHandlers/ResourcesHandler.php`
- [Prompt Requests](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/RequestMethodHandlers/PromptsHandler.php): `includes/RequestMethodHandlers/PromptsHandler.php`
- [Tool Dispatcher](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Utils/HandleToolsCall.php): `includes/Utils/HandleToolsCall.php`
- [Tool Registration](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Core/RegisterMcpTool.php): `includes/Core/RegisterMcpTool.php`

### WordPress Capabilities

- [WordPress Tools](https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Tools): `includes/Tools`
- [Site Resources](https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Resources): `includes/Resources`
- [MCP Prompts](https://github.com/automattic/wordpress-mcp/tree/trunk/includes/Prompts): `includes/Prompts`

### Administration

- [Admin Settings](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Admin/Settings.php): `includes/Admin/Settings.php`
- [JWT Authentication](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Auth/JwtAuth.php): `includes/Auth/JwtAuth.php`
- [Settings Interface](https://github.com/automattic/wordpress-mcp/blob/trunk/src/settings/index.js): `src/settings/index.js`
- [Token Controls](https://github.com/automattic/wordpress-mcp/blob/trunk/src/settings/AuthenticationTokensTab.js): `src/settings/AuthenticationTokensTab.js`

### Operations

- [Tool Validation CLI](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Cli/ValidateToolsCommand.php): `includes/Cli/ValidateToolsCommand.php`
- [Tool Validator](https://github.com/automattic/wordpress-mcp/blob/trunk/includes/Utils/ValidateTool.php): `includes/Utils/ValidateTool.php`

### Other components

- **MCP Client**
- **WordPress Site**

## Connections

- MCP Client → MCP Transports: sends requests
- Plugin Bootstrap → MCP Transports: loads (evidence: `wordpress-mcp.php`)
- MCP Transports → MCP Registry: uses registry (evidence: `includes/Core/McpStreamableTransport.php`)
- MCP Registry → WordPress Tools: initializes tools (evidence: `includes/Core/WpMcp.php`)
- MCP Registry → Site Resources: initializes resources (evidence: `includes/Core/WpMcp.php`)
- MCP Registry → MCP Prompts: initializes prompts (evidence: `includes/Core/WpMcp.php`)
- Tool Requests → MCP Registry: lists tools (evidence: `includes/RequestMethodHandlers/ToolsHandler.php`)
- Resource Requests → MCP Registry: reads registry (evidence: `includes/RequestMethodHandlers/ResourcesHandler.php`)
- Prompt Requests → MCP Registry: uses registry (evidence: `includes/RequestMethodHandlers/PromptsHandler.php`)
- Tool Requests → Tool Dispatcher: dispatches calls (evidence: `includes/RequestMethodHandlers/ToolsHandler.php`)
- Tool Dispatcher → MCP Registry: resolves tools (evidence: `includes/Utils/HandleToolsCall.php`)
- WordPress Tools → Tool Registration: registers tools (evidence: `includes/Tools/McpMediaTools.php`)
- Site Resources → WordPress Site: reads site data
- WordPress Tools → WordPress Site: operates on content
- Plugin Bootstrap → Admin Settings: loads settings (evidence: `wordpress-mcp.php`)
- Plugin Bootstrap → JWT Authentication: loads authentication (evidence: `wordpress-mcp.php`)
- Settings Interface → Token Controls: renders tab (evidence: `src/settings/index.js`)
- Token Controls → JWT Authentication: manages tokens
- Tool Validation CLI → MCP Registry: gets tools (evidence: `includes/Cli/ValidateToolsCommand.php`)
- Tool Validation CLI → Tool Validator: validates tools (evidence: `includes/Cli/ValidateToolsCommand.php`)
