wordpress-mcp-server
WordPress MCP 服务器
用于 WordPress 集成的模型上下文协议 (MCP) 服务器,兼容 Windows、macOS 和 Linux。
概述
此 MCP 服务器支持通过 WordPress REST API 与 WordPress 网站进行交互。它提供了使用 JSON-RPC 2.0 协议创建、检索和更新帖子的工具。
Related MCP server: wp-cli-mcp
安装
克隆存储库
安装依赖项:
npm install构建项目:
npm run build配置
将服务器添加到您的 MCP 设置文件中,并使用 WordPress 凭据的环境变量:
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["path/to/build/index.js"],
"env": {
"WORDPRESS_SITE_URL": "https://your-wordpress-site.com",
"WORDPRESS_USERNAME": "your-username",
"WORDPRESS_PASSWORD": "your-app-password"
}
}
}
}环境变量包括:
WORDPRESS_SITE_URL:您的 WordPress 网站 URL
WORDPRESS_USERNAME:WordPress 用户名
WORDPRESS_PASSWORD:WordPress 应用程序密码
如果您不想使用环境变量,您也可以在请求参数中提供这些凭据。
可用方法
创建帖子
创建一个新的 WordPress 帖子。
参数:
siteUrl:(如果在环境中设置则为可选)WordPress 网站 URL
用户名:(如果在环境中设置则可选)WordPress 用户名
密码:(如果在环境中设置则为可选)WordPress 应用程序密码
标题:文章标题
内容:帖子内容
状态:(可选)“草稿”|“发布”|“私人”(默认:“草稿”)
获取帖子
检索 WordPress 帖子。
参数:
siteUrl:(如果在环境中设置则为可选)WordPress 网站 URL
用户名:(如果在环境中设置则可选)WordPress 用户名
密码:(如果在环境中设置则为可选)WordPress 应用程序密码
perPage:(可选)每页的帖子数(默认值:10)
page:(可选)页码(默认值:1)
更新帖子
更新现有的 WordPress 帖子。
参数:
siteUrl:(如果在环境中设置则为可选)WordPress 网站 URL
用户名:(如果在环境中设置则可选)WordPress 用户名
密码:(如果在环境中设置则为可选)WordPress 应用程序密码
postId:要更新的帖子的ID
标题:(可选)新帖子标题
content:(可选)新帖子内容
状态:(可选)‘草稿’|‘发布’|‘私人’
安全说明
为了安全起见,建议使用 WordPress 应用程序密码,而不是主账户密码。您可以在 WordPress 信息中心的“用户”→“安全”→“应用程序密码”下生成应用程序密码。
示例用法
使用环境变量:
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"title": "My New Post",
"content": "Hello World!",
"status": "draft"
}
}没有环境变量:
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"siteUrl": "https://your-wordpress-site.com",
"username": "your-username",
"password": "your-app-password",
"title": "My New Post",
"content": "Hello World!",
"status": "draft"
}
}要求
Node.js 20.0.0 或更高版本
启用 REST API 的 WordPress 网站
用于身份验证的 WordPress 应用程序密码
执照
MIT 许可证 - 详情请参阅许可证文件
This server cannot be deployed
Maintenance
Related MCP Connectors
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
WordPress MCP server: publish posts, AI images, SEO and full site management, self-hosted
WordPress MCP server: generate SEO posts, AI images, autoblog & WooCommerce on your self-hosted site
Manage WordPress blogs and WooCommerce shops from Claude, ChatGPT, Cursor and other MCP apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server for WordPress automation that enables users to manage content, themes, and site configurations using AI-driven workflows and the WordPress REST API. It provides a wide array of tools for site planning, management, and optimization compatible with tools like Cursor and Claude.64 npm1ISC
- AlicenseBqualityDmaintenanceMCP server that gives AI tools full WordPress management via WP-CLI. 30+ tools for themes, plugins, posts, menus, users, database, scaffolding, and cache. Works locally or over SSH.3418 npm5MIT
- FlicenseBqualityDmaintenanceLocal MCP server for Codex/Claude to query and edit WordPress content through the WordPress REST API.26-
- AlicenseNot gradedqualityCmaintenanceMCP server for WordPress content management via REST API, supporting posts, pages, media, comments, and terms through natural language interfaces like Cursor, ChatGPT, Codex, and Claude.15 npmMIT