WO

WordPress MCP Server for LLM Integration

Turn your WordPress site into a simple MCP server to expose functionality to LLMs and AI agents for seamless integration.

Quick Install
npx -y @Automattic/wordpress-mcp

Overview

This project turns a WordPress install into a lightweight MCP (Model Context Protocol) server so large language models and agent frameworks can interact with your site programmatically. It exposes a set of discoverable tools and endpoints that map WordPress capabilities (reading posts, creating content, searching, uploading media, etc.) into a machine-readable protocol. That makes it straightforward for LLMs and automation agents to query site context and perform actions while respecting authentication and capability boundaries.

Running an MCP server inside WordPress is useful when you want AI models to operate against your live content and workflows without building a custom API layer. Instead of scraping pages or building bespoke endpoints, the plugin presents a unified, documented toolset that agents can discover and call, enabling use cases such as automated publishing, content summarization, intelligent search, and assisted moderation.

Features

  • Exposes an MCP-compatible discovery endpoint for tools and metadata
  • Built-in tools for common WP tasks: list/read posts, create/update posts, search, media upload, site info
  • Authentication support (token-based or WordPress credentials/application passwords)
  • Hook-based extensions: register custom tools and handlers via standard WP actions/filters
  • JSON Schema-compatible parameter descriptions for each tool
  • Lightweight—designed to plug into existing WordPress installs with minimal configuration

Installation / Configuration

Install via Git clone + WP-CLI or by copying the plugin folder into the plugin directory.

  1. Clone the repository into your WordPress plugins directory:
cd /var/www/html/wp-content/plugins
git clone https://github.com/Automattic/wordpress-mcp.git wordpress-mcp
  1. Activate the plugin (WP-CLI):
wp plugin activate wordpress-mcp
  1. Configure authentication and options in your wp-config.php or via environment variables (example constants):
// wp-config.php
define('MCP_AUTH_TOKEN', 'replace-with-secure-token'); // simple bearer token option
define('MCP_ALLOW_ANONYMOUS', false);                  // whether anonymous access is allowed
define('MCP_ENDPOINT_PATH', '/mcp');                   // optional: change discovery path
  1. Optionally set Application Passwords or JWT plugins to integrate with WordPress user credentials for finer-grained permissions.

Note: The MCP endpoint path is configurable. Use an HTTPS site for production, and restrict access to trusted models/agents.

Available Tools / Resources

The server includes a set of common tools out of the box. You can extend or override them by registering new tools through provided hooks.

Built-in tools (examples):

ToolPurpose
list_postsRetrieve a list of posts with filters (status, type, limit, etc.)
get_postFetch a single post by ID or slug
create_postCreate a new post (title, content, status, meta)
update_postUpdate an existing post
delete_postSoft-delete or trash a post
searchSearch across posts/pages with relevance scoring
upload_mediaUpload and attach media to the library
site_infoReturn site metadata (URL, title, timezone, available post types)

Discovery: the MCP discovery endpoint returns a JSON document that lists each tool with name, description, parameter schema, and permission requirements so agents can auto-generate calls.

Extending tools (example):

add_filter('mcp_tools', function($tools) {
    $tools['create_newsletter_post'] = [
        'name' => 'create_newsletter_post',
        'description' => 'Create a post optimized for the weekly newsletter',
        'parameters' => [
            'title' => ['type' => 'string'],
            'content' => ['type' =>
Tags:ai-ml