Cover image
Try Now
2025-03-10

MCP Server for WordPress

3 years

Works with Finder

1

Github Watches

1

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • 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.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

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

  • Khalid kalib
  • Write professional emails

  • 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

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • OffchainLabs
  • Go implementation of Ethereum proof of stake

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

    Reviews

    3 (1)
    Avatar
    user_Y44cToci
    2025-04-17

    I've been using mcp-for-wordpress by rizaardiyanto1412, and it's impressive! It's user-friendly and integrates perfectly with my WordPress site, enhancing my workflow significantly. Highly recommend checking it out at https://github.com/rizaardiyanto1412/mcp-for-wordpress.