ItchWPMCP
ItchWPMCP
用于 Codex/Claude 的本地 MCP 服务器,可通过 WordPress REST API 查询和编辑 WordPress 内容。
它可用于任何启用了 REST API 并支持应用程序密码 (Application Password) 身份验证的 WordPress 站点。
设置
创建 WordPress 应用程序密码:
WordPress 管理后台 -> 用户 -> 个人资料 -> 应用程序密码将
.env.example复制为.env并填写:WP_BASE_URL=https://your-wordpress-site.example WP_USERNAME=your-wordpress-username WP_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx WP_ALLOW_PRODUCTION_WRITES=false安装依赖:
npm install运行服务器:
$env:NODE_OPTIONS='--use-system-ca' npm start在 Windows 上,当 Node 需要系统证书存储时,
NODE_OPTIONS=--use-system-ca可能会有所帮助。
Related MCP server: mcp-wordpress
工具
wordpress_list_pages: 列出 WordPress 页面。wordpress_get_page: 通过 ID 获取页面。wordpress_create_page: 创建页面,默认为草稿状态。wordpress_clone_page: 将现有页面克隆为新的草稿页面。wordpress_update_page: 更新标题、内容、摘要、别名、状态、父级或菜单顺序。wordpress_update_page_status: 仅更新页面状态。wordpress_delete_page: 将页面移至回收站或删除(需确认)。wordpress_list_posts: 列出 WordPress 文章。wordpress_get_post: 通过 ID 获取文章。wordpress_create_post: 创建文章,默认为草稿状态。wordpress_update_post: 更新文章。wordpress_delete_post: 将文章移至回收站或删除(需确认)。wordpress_list_media: 列出媒体库项目。wordpress_upload_media: 将本地文件上传到媒体库。wordpress_list_categories: 列出文章分类。wordpress_create_category: 创建文章分类。wordpress_list_tags: 列出文章标签。wordpress_create_tag: 创建文章标签。wordpress_list_plugins: 如果已认证用户拥有权限,则列出插件。wordpress_update_plugin_status: 激活或停用已安装的插件。wordpress_get_settings: 读取常规站点设置。wordpress_update_settings: 更新选定的常规站点设置。wordpress_list_users: 如果已认证用户拥有权限,则列出用户。wordpress_list_menus: 如果 REST 端点可用,则列出菜单。wordpress_list_menu_items: 如果 REST 端点可用,则列出菜单项。wordpress_rest_request: 高级 REST API 逃生舱。
写入工具在暂存 (staging) URL 上启用。如果 WP_BASE_URL 更改为生产环境,除非在 .env 中设置了 WP_ALLOW_PRODUCTION_WRITES=true,否则写入操作将被阻止。
使用其他 WordPress 站点
在该 WordPress 站点的管理后台创建一个应用程序密码,然后更新 .env:
WP_BASE_URL=https://another-wordpress-site.example
WP_USERNAME=your-wordpress-username
WP_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
WP_ALLOW_PRODUCTION_WRITES=false除非您有意要在生产 URL 上启用写入工具,否则请保持 WP_ALLOW_PRODUCTION_WRITES=false。
为他人移植
将此
ItchWPMCP文件夹复制到他们的机器上,或将其发布为私有/公共仓库。在文件夹内运行
npm install。从
.env.example创建一个.env文件。在他们的 WordPress 管理后台中,创建一个应用程序密码:
用户 -> 个人资料 -> 应用程序密码将他们的站点 URL、用户名和应用程序密码填入
.env。在他们的 MCP 客户端中注册该 MCP 服务器。
不要提交 .env 文件。应用程序密码应保留在每个用户/站点本地。
Codex 配置
将其添加到 ~/.codex/config.toml:
[mcp_servers.itch_wp_mcp]
command = "node"
args = ["C:\\path\\to\\ItchWPMCP\\src\\server.js"]
enabled = true
startup_timeout_sec = 20
tool_timeout_sec = 60
[mcp_servers.itch_wp_mcp.env]
WP_BASE_URL = "https://your-wordpress-site.example"
WP_USERNAME = "your-wordpress-username"
WP_APP_PASSWORD = "xxxx xxxx xxxx xxxx xxxx xxxx"
WP_ALLOW_PRODUCTION_WRITES = "false"
NODE_OPTIONS = "--use-system-ca"在 Windows 上,使用完整的 Node 路径可能更可靠:
command = "C:\\Program Files\\nodejs\\node.exe"Claude Desktop 配置
将其添加到 Claude Desktop 的 claude_desktop_config.json 中的 mcpServers 下:
{
"mcpServers": {
"itch_wp_mcp": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": [
"C:\\path\\to\\ItchWPMCP\\src\\server.js"
],
"env": {
"WP_BASE_URL": "https://your-wordpress-site.example",
"WP_USERNAME": "your-wordpress-username",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
"WP_ALLOW_PRODUCTION_WRITES": "false",
"NODE_OPTIONS": "--use-system-ca"
}
}
}
}在 Windows 上,Claude Desktop 配置通常位于此处:
%APPDATA%\Claude\claude_desktop_config.json更改配置后重启 Claude Desktop。
多站点设置
您不需要为每个 WordPress 网站单独复制一份 ItchWPMCP。保留一个代码库并注册多个 MCP 服务器,每个服务器使用不同的环境变量。
Codex 多站点示例
[mcp_servers.wp_erm_staging]
command = "C:\\Program Files\\nodejs\\node.exe"
args = ["C:\\Users\\hesha\\Documents\\GitHub\\ItchWPMCP\\src\\server.js"]
enabled = true
startup_timeout_sec = 20
tool_timeout_sec = 60
[mcp_servers.wp_erm_staging.env]
WP_BASE_URL = "https://staging.erm.buzzinn.co"
WP_USERNAME = "erm-admin"
WP_APP_PASSWORD = "xxxx xxxx xxxx xxxx xxxx xxxx"
WP_ALLOW_PRODUCTION_WRITES = "false"
NODE_OPTIONS = "--use-system-ca"
[mcp_servers.wp_client_site]
command = "C:\\Program Files\\nodejs\\node.exe"
args = ["C:\\Users\\hesha\\Documents\\GitHub\\ItchWPMCP\\src\\server.js"]
enabled = true
startup_timeout_sec = 20
tool_timeout_sec = 60
[mcp_servers.wp_client_site.env]
WP_BASE_URL = "https://client-site.example"
WP_USERNAME = "client-admin"
WP_APP_PASSWORD = "xxxx xxxx xxxx xxxx xxxx xxxx"
WP_ALLOW_PRODUCTION_WRITES = "false"
NODE_OPTIONS = "--use-system-ca"Claude 多站点示例
{
"mcpServers": {
"wp_erm_staging": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": ["C:\\Users\\hesha\\Documents\\GitHub\\ItchWPMCP\\src\\server.js"],
"env": {
"WP_BASE_URL": "https://staging.erm.buzzinn.co",
"WP_USERNAME": "erm-admin",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
"WP_ALLOW_PRODUCTION_WRITES": "false",
"NODE_OPTIONS": "--use-system-ca"
}
},
"wp_client_site": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": ["C:\\Users\\hesha\\Documents\\GitHub\\ItchWPMCP\\src\\server.js"],
"env": {
"WP_BASE_URL": "https://client-site.example",
"WP_USERNAME": "client-admin",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
"WP_ALLOW_PRODUCTION_WRITES": "false",
"NODE_OPTIONS": "--use-system-ca"
}
}
}
}.env 文件现在仅作为本地后备。当由 Codex 或 Claude 提供时,每个站点的 MCP 环境变量具有优先权。
安全模型
新页面/文章默认为
draft(草稿)。破坏性工具需要
confirmDelete=true。除非设置了
WP_ALLOW_PRODUCTION_WRITES=true,否则非暂存环境的写入操作将被阻止。wordpress_rest_request仅允许/wp-json/下的路径。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceHosted MCP server that bridges Claude.ai with one or more WordPress sites.5ISC
- AlicenseAqualityBmaintenanceA Model Context Protocol server that gives Claude (or any MCP-compatible LLM) direct access to a self-hosted WordPress site over its REST API.73MIT
- AlicenseNot gradedqualityBmaintenanceA local server that enables Claude or other MCP tools to manage WordPress posts and media via REST API.21MIT
- FlicenseNot gradedqualityCmaintenanceA local MCP server that bridges Claude Desktop to your WordPress site via the WordPress MCP Adapter. It dynamically discovers and proxies all tools, resources, and prompts registered through the WordPress Abilities API.
Related MCP Connectors
WordPress MCP server: generate SEO posts, AI images, autoblog & WooCommerce on your self-hosted site
WordPress MCP server: publish posts, AI images, SEO and full site management, self-hosted
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/manofsadness/ItchWPMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server