Skip to main content
Glama
Leonelberio

WordPress MCP Server

by Leonelberio

WordPress MCP 服务器

用于 WordPress 集成的模型上下文协议 (MCP) 服务器,兼容 Windows、macOS 和 Linux。

概述

此 MCP 服务器支持通过 WordPress REST API 与 WordPress 网站进行交互。它提供了使用 JSON-RPC 2.0 协议创建、检索和更新帖子的工具。

Related MCP server: WordPress MCP Server

安装

  1. 克隆存储库

  2. 安装依赖项:

npm install
  1. 构建项目:

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 许可证 - 详情请参阅许可证文件

Install Server
A
license - permissive license
B
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    -
    quality
    D
    maintenance
    A server enabling seamless interaction between AI models and WordPress sites with secure, standardized communication using the WordPress REST API for comprehensive site management.
    408
    159
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A comprehensive MCP server for managing WordPress sites through the REST API, featuring 38 tools for content, media, plugin, and theme management. It supports secure Application Password authentication and offers specific compatibility for Divi theme shortcode structures.

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/Leonelberio/the-wordpress-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server