Cover image

此MCP服务器可让您与WordPress自动交互

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

WordPress MCP Integration

This is a streamlined version of the Model Context Protocol (MCP) TypeScript SDK that focuses specifically on WordPress integration. It enables interaction with WordPress sites through the WordPress REST API using the MCP protocol.

Overview

The WordPress MCP integration allows you to:

  • Create new WordPress posts
  • Retrieve existing WordPress posts
  • Update existing WordPress posts

Installation

  1. Clone this repository
  2. Install dependencies:
npm install

Configuration

There are two ways to configure the WordPress integration:

1. Environment Variables

Set the following environment variables:

  • WORDPRESS_SITE_URL: Your WordPress site URL
  • WORDPRESS_USERNAME: WordPress username
  • WORDPRESS_PASSWORD: WordPress application password

2. Request Parameters

Provide the credentials directly in the request parameters when calling the tools.

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.

Available Tools

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')

Example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_post",
    "arguments": {
      "title": "My New Post",
      "content": "Hello World!",
      "status": "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)

Example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_posts",
    "arguments": {
      "perPage": 5,
      "page": 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'

Example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_post",
    "arguments": {
      "postId": 123,
      "title": "Updated Post Title",
      "status": "publish"
    }
  }
}

Running the Server

Start the WordPress MCP server:

npm run server

This will start the server on stdio by default. To run it on a specific port (e.g., 3000):

npm run server 3000

Requirements

  • Node.js 18.0.0 or higher
  • WordPress site with REST API enabled
  • WordPress application password for authentication

License

MIT License - See LICENSE file for details

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • HiveNexus
  • 一个适用于中小型团队的AI聊天机器人,支持DeepSeek,Open AI,Claude和Gemini等车型。 专为中小团队设计的ai聊天应用,支持deepSeek,打开ai,claude,双子座等模型。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

    Reviews

    3 (1)
    Avatar
    user_Vb6DLjDt
    2025-04-17

    I'm a loyal user of mcp-for-wordpress and it's truly a game-changer. Dmitrii-Demenko did an outstanding job creating this plugin, making it incredibly easy to manage and customize WordPress sites. The integration is seamless, and the usability is top-notch. Highly recommend checking it out on GitHub!