WordPress MCP 服务器
用于 WordPress 集成的模型上下文协议 (MCP) 服务器,兼容 Windows、macOS 和 Linux。
概述
此 MCP 服务器支持通过 WordPress REST API 与 WordPress 网站进行交互。它提供了使用 JSON-RPC 2.0 协议创建、检索和更新帖子的工具。
安装
克隆存储库
安装依赖项:
构建项目:
配置
将服务器添加到您的 MCP 设置文件中,并使用 WordPress 凭据的环境变量:
环境变量包括:
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 信息中心的“用户”→“安全”→“应用程序密码”下生成应用程序密码。
示例用法
使用环境变量:
没有环境变量:
要求
Node.js 20.0.0 或更高版本
启用 REST API 的 WordPress 网站
用于身份验证的 WordPress 应用程序密码
执照
MIT 许可证 - 详情请参阅许可证文件
Related MCP Servers
- AsecurityAlicenseAqualityA TypeScript-based MCP server that enables testing of REST APIs through Cline. This tool allows you to test and interact with any REST API endpoints directly from your development environment.Last updated -15078MIT License
- -securityAlicense-qualityWooCommerce MCP Server enables interaction with WooCommerce stores through the WordPress REST API. It provides comprehensive tools for managing all aspects of products, orders, customers, shipping, taxes, discounts, and store configuration using JSON-RPC 2.0 protocol.Last updated -70MIT License
- AsecurityAlicenseAqualityThis MCP server provides tools for interacting with Cloudflare Browser Rendering, allowing you to fetch and process web content for use as context in LLMs directly from Cline or Claude Desktop.Last updated -510MIT License
- AsecurityAlicenseAqualitySimple MCP Server to enable a human-in-the-loop workflow in tools like Cline and Cursor. This is especially useful for developing desktop applications that require complex user interactions to test.Last updated -150MIT License