
stefans71/wordpress-mcp-server 是从 https://github.com/stefans71/wordpress-mcp-server. 导入的 MCP 候选服务器。
概览
stefans71/wordpress-mcp-server 是从 https://github.com/stefans71/wordpress-mcp-server. 导入的 MCP 候选服务器。
概述(AI 翻译)
一款用于WordPress集成的模型上下文协议(MCP)服务器,兼容Windows、macOS和Linux。
概述
该MCP服务器通过WordPress REST API支持与WordPress网站的交互。它提供使用JSON-RPC 2.0协议创建、检索和更新帖子的工具。
安装
-
克隆仓库
-
安装依赖:
-
建设项目:
配置
将服务器添加到你的MCP设置文件中,并添加WordPress凭证的环境变量:
环境变量包括:
- WORDPRESS_SITE_URL:您的WordPress网站网址
- WORDPRESS_USERNAME:WordPress用户名
- WORDPRESS_PASSWORD:WordPress 应用密码
如果你不想使用环境变量,也可以在请求参数中提供这些凭证。
可用方法
create_post
创建一个新的WordPress帖子。
参数:
- siteUrl:(若在环境中设置为可选)WordPress 网站 URL
- 用户名:(若在环境中设置为可选)WordPress 用户名
- password:(如果在环境中设置,则可选)WordPress 应用密码
- 标题:标题
- 内容:帖子内容
- 状态:(可选)“draft” |“发布” |“private”(默认:“draft”)
get_posts
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
WordPress MCP Server
A Model Context Protocol (MCP) server for WordPress integration, compatible with Windows, macOS, and Linux.
Overview
This MCP server enables interaction with WordPress sites through the WordPress REST API. It provides tools for creating, retrieving, and updating posts using JSON-RPC 2.0 protocol.
Installation
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Add the server to your MCP settings file with environment variables for WordPress credentials:
{
"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"
}
}
}
}
The environment variables are:
- WORDPRESS_SITE_URL: Your WordPress site URL
- WORDPRESS_USERNAME: WordPress username
- WORDPRESS_PASSWORD: WordPress application password
You can also provide these credentials in the request parameters if you prefer not to use environment variables.
Available Methods
create_post
Creates a new WordPress post.
Parameters:
- siteUrl: (optional if set in env) WordPress site URL
- username: (optional if set in env) WordPress username
- password: (optional if set in env) WordPress application password
- title: Post title
- content: Post content
- status: (optional) ‘draft’ | ‘publish’ | ‘private’ (default: ‘draft’)
get_posts
Retrieves WordPress posts.
Parameters:
- siteUrl: (optional if set in env) WordPress site URL
- username: (optional if set in env) WordPress username
- password: (optional if set in env) WordPress application password
- perPage: (optional) Number of posts per page (default: 10)
- page: (optional) Page number (default: 1)
update_post
Updates an existing WordPress post.
Parameters:
- siteUrl: (optional if set in env) WordPress site URL
- username: (optional if set in env) WordPress username
- password: (optional if set in env) WordPress application password
- postId: ID of the post to update
- title: (optional) New post title
- content: (optional) New post content
- status: (optional) ‘draft’ | ‘publish’ | ‘private’
Security Note
For security, it’s recommended to use WordPress application passwords instead of your main account password. You can generate an application password in your WordPress dashboard under Users → Security → Application Passwords.
Example Usage
Using environment variables:
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"title": "My New Post",
"content": "Hello World!",
"status": "draft"
}
}
Without environment variables:
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_post",
"params": {
"siteUrl": "https://your-wordpress-site.com",
"username": "your-username",
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"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"
}
}
}
}