WordPress MCP Server

WordPress MCP Server

Enables AI agents to manage WordPress sites through the WordPress REST API, supporting content, media, users, settings, and Elementor management with safety policies for production use.

Category
访问服务器

README

WordPress MCP Server

Production-oriented Model Context Protocol server for AI agents that need to manage WordPress websites through the official WordPress REST API and REST-exposed plugin resources.

What It Provides

  • MCP tools with typed input schemas for posts, pages, custom post types, media, terms, users, settings, Elementor data, menus, widgets, and guarded raw REST calls.
  • MCP resources for site overview, REST route discovery, settings, content items, and Elementor layouts.
  • Conservative policy gates for publishing, destructive actions, settings writes, user management, and raw REST mutations.
  • WordPress authentication through Application Passwords, bearer/JWT tokens, basic auth, or no auth for read-only public testing.
  • Stdio transport for local AI agents and optional Streamable HTTP transport for remote/deployed clients.

Setup

npm install
cp .env.example .env
npm run build

Configure .env:

WP_SITE_URL=https://example.com
WP_AUTH_METHOD=application_password
WP_USERNAME=editor@example.com
WP_APPLICATION_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx

Use a WordPress user with the narrowest role that can perform the tasks you want the agent to perform. For production, use HTTPS and WordPress Application Passwords or a hardened OAuth/JWT plugin.

Connect From an MCP Client

Stdio is the default transport:

{
  "mcpServers": {
    "wordpress": {
      "command": "node",
      "args": ["C:/Users/Ahmed/Desktop/wp-mcp/dist/index.js"],
      "env": {
        "WP_SITE_URL": "https://example.com",
        "WP_AUTH_METHOD": "application_password",
        "WP_USERNAME": "editor@example.com",
        "WP_APPLICATION_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
      }
    }
  }
}

For HTTP:

MCP_TRANSPORT=http MCP_HTTP_BEARER_TOKEN=replace-me npm run start:http

Then connect the client to:

http://localhost:3333/mcp

Include Authorization: Bearer replace-me when MCP_HTTP_BEARER_TOKEN is set.

Safety Policy

The server starts with write operations available but sensitive changes blocked unless explicitly enabled:

Environment flag Allows
WP_ALLOW_PUBLISH=true Publishing/private/future statuses and content-changing admin resources
WP_ALLOW_DESTRUCTIVE=true Permanent deletes and destructive operations
WP_ALLOW_SETTINGS_WRITE=true /wp/v2/settings updates
WP_ALLOW_USER_MANAGEMENT=true Creating, updating, and deleting users
WP_ALLOW_RAW_REST=true Non-GET calls through wp_rest_request
WP_REQUIRE_CONFIRMATION=true Requires confirmation tokens for gated actions

Confirmation tokens:

  • CONFIRM_PUBLISH
  • CONFIRM_DESTRUCTIVE
  • CONFIRM_SETTINGS_WRITE
  • CONFIRM_USER_MANAGEMENT
  • CONFIRM_RAW_REST

This lets an AI agent inspect freely while requiring deliberate approval for high-impact actions.

Core Tools

  • wp_discover: Inspect REST routes, current user, post types, taxonomies, and policy.
  • wp_get_settings, wp_update_settings: Read and update core site settings.
  • wp_list_content, wp_get_content, wp_create_content, wp_update_content, wp_delete_content: Manage posts, pages, attachments, templates, and REST-exposed custom post types.
  • wp_upload_media: Upload local files to the media library.
  • wp_manage_terms: Manage categories, tags, and custom taxonomies.
  • wp_manage_users: Manage users when policy and WordPress permissions allow it.
  • wp_get_elementor_data, wp_update_elementor_data: Read/replace Elementor layout metadata.
  • wp_manage_navigation: Manage REST-exposed menus, locations, and menu items.
  • wp_manage_widgets: Manage REST-exposed widgets, sidebars, and widget types.
  • wp_rest_request: Guarded escape hatch for plugin endpoints discovered by wp_discover.

Elementor Notes

Elementor stores layout data as JSON in WordPress post metadata. This server reads Elementor data from the REST response meta object and updates _elementor_data, _elementor_edit_mode, and optional template metadata. Your site must expose the relevant meta keys to the REST API or provide a custom secure endpoint. If your site blocks private Elementor meta through core REST responses, use wp_rest_request against a custom endpoint with a proper WordPress permission_callback.

Custom Post Types and Plugin Resources

Custom post types and taxonomies must be registered with REST support in WordPress. Discover the REST base with wp_discover, then pass that base as type or taxonomy.

For plugin-specific resources, prefer purpose-built tools. Use wp_rest_request only when a route has been discovered and the action is understood.

Development

npm run dev
npm run dev:http
npm run typecheck
npm run build

Production Hardening Checklist

  • Use HTTPS for WordPress and remote MCP HTTP.
  • Use a least-privilege WordPress account.
  • Keep destructive and admin flags disabled unless needed.
  • Keep MCP_HTTP_BEARER_TOKEN set for HTTP mode and rotate it regularly.
  • Put HTTP mode behind trusted infrastructure with TLS, request logging, and rate limiting.
  • Review tool calls before allowing publish, settings, user, raw REST, or destructive confirmations.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选