New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wordpress-auto-mcp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wordpress-auto-mcp

WordPress autopost MCP server using Application Passwords (NodeJS)

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

WordPress 自动发文 MCP(应用程序密码 + NodeJS)

你在 Cursor 等工具和 AI 聊天时,让 AI 通过本 MCP 发布内容到你的 WordPress(自部署)站点,例如:生成技术方案、总结对话内容等。

前置条件

  • WordPress 站点开启 REST API(默认开启),能访问 WP_BASE_URL/wp-json/
  • 在 WordPress 后台为专用用户生成「应用程序密码」(建议角色:Author)。
  • 本机安装 Node.js(建议 18+;本项目在 Node 20 测试)。

安装

npm i
npm run build

在 Cursor 配置 MCP

在 Cursor 的 Settings JSON(或相应的 MCP 配置入口)里添加:

{
  "mcpServers": {
    "wordpressAutoMcp": {
      "command": "npx",
      "args": ["-y", "wordpress-auto-mcp"],
      "env": {
        "WP_BASE_URL": "https://your-site.example",
        "WP_USERNAME": "your_wp_username",
        "WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
        "WP_DEFAULT_STATUS": "publish",
        "WP_TIMEOUT_MS": "15000"
      }
    }
  }
}

说明:

  • 本项目仅从 MCP 配置传入的环境变量(env)读取配置
  • 本项目不做本地发布日志/幂等去重:重复调用 wp_publish_post 会重复发文,请务必在“确认发布”后再调用。

使用方式(预览 -> 确认 -> 发布)

  • 在对话中让 AI 生成文章,并调用 wp_preview_post
  • AI 会把预览内容展示给你。
  • 你回复“确认发布”。
  • AI 调用 wp_publish_post(建议传 finalStatus=publish),返回文章链接。

工具说明:

  • wp_preview_post:返回 draftPayload + contentHash
  • wp_publish_post:输入 draftPayload + contentHash(会校验 hash 防止内容被改动)

常见问题

  • 401/403:检查应用程序密码、用户名、以及该用户是否有发文权限(Author/Editor)。
  • 分类/标签categories/tags 需要传 ID 数组(不是名字)。
  • 内容格式content 建议传 HTML;你也可以先让 AI 产出 Markdown,再自行在发布前转换为 HTML。

Keywords

mcp

FAQs

Package last updated on 21 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts