WordPress MCP Server

WordPress MCP Server

Enables AI assistants to interact with WordPress sites through REST APIs, allowing programmatic management of posts, users, comments, categories, and tags with secure authentication.

Category
访问服务器

Tools

get-users

Get a list of users from a WordPress site with advanced filtering options

get-user

Get a specific user by ID

create-user

Create a new WordPress user

update-user

Update an existing WordPress user

delete-user

Delete a WordPress user

list-posts

Get a list of posts with comprehensive filtering options

get-post

Get a specific post by ID

create-post

Create a new WordPress post

update-post

Update an existing WordPress post

delete-post

Delete a WordPress post

get-comments

Get a list of comments from a WordPress site

create-comment

Create a new comment on a WordPress post

get-stats-highlights

Get highlight metrics for a WordPress site from the last seven days

get-stats-summary

View a site's summarized views, visitors, likes and comments

get-top-posts

View a site's top posts and pages by views

get-referrers

View a site's referrers

get-country-views

View a site's views by country

get-post-stats

View a specific post's views

get-site-stats

Get comprehensive stats for a WordPress site

report-referrer-spam

Report a referrer as spam

remove-referrer-spam

Unreport a referrer as spam

get-clicks

View a site's outbound clicks

get-search-terms

View search terms used to find the site

get-streak-stats

Get stats for Calendar Heatmap showing publishing activity

list-categories

Get a list of categories with filtering options

get-category

Get a specific category by ID

create-category

Create a new WordPress category

update-category

Update an existing WordPress category

delete-category

Delete a WordPress category

README

Comprehensive WordPress MCP Server

A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with WordPress sites through the WordPress REST API. This server provides tools for managing all aspects of WordPress programmatically, including posts, users, comments, categories, tags, and custom endpoints.

<a href="https://glama.ai/mcp/servers/@prathammanocha/wordpress-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@prathammanocha/wordpress-mcp-server/badge" alt="WordPress Server MCP server" /> </a>

Features

Post Management

  • Create, retrieve, update, and delete WordPress posts
  • Filter posts by various parameters
  • Pagination support for post listings

User Management

  • Retrieve user information by ID or login
  • Update user details
  • Delete users

Comments Management

  • Create, retrieve, update, and delete comments
  • Filter comments by post
  • Pagination support for comment listings

Taxonomy Management

  • Manage categories and tags
  • Create, retrieve, update, and delete taxonomies
  • Find categories and tags by slug

Site Information

  • Retrieve general WordPress site information

Custom Requests

  • Support for custom REST API endpoints
  • Custom HTTP methods (GET, POST, PUT, DELETE)
  • Custom data and parameters

Prerequisites

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

Installation

  1. Clone this repository:
git clone [repository-url]
cd wordpress-mcp-server
  1. Install dependencies:
npm install
  1. Build the server:
npm run build

WordPress Configuration

Before using the server, you need to set up your WordPress site:

  1. Ensure your WordPress site has REST API enabled (enabled by default in WordPress 4.7+)
  2. Create an application password:
    • Log in to your WordPress admin panel
    • Go to Users → Profile
    • Scroll down to "Application Passwords"
    • Enter a name for the application (e.g., "MCP Server")
    • Click "Add New Application Password"
    • Copy the generated password (you won't be able to see it again)

MCP Configuration

Add the server to your MCP settings file (usually located at ~/AppData/Roaming/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "wordpress": {
      "command": "node",
      "args": ["path/to/wordpress-mcp-server/build/index.js"]
    }
  }
}

Available Tools

Post Management

1. create_post

Creates a new WordPress post.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • title (required): Post title
  • content (required): Post content
  • status (optional): Post status ('draft', 'publish', or 'private', defaults to 'draft')

Example:

{
  "tool": "create_post",
  "siteUrl": "https://example.com",
  "username": "admin",
  "password": "xxxx xxxx xxxx xxxx",
  "title": "My First Post",
  "content": "Hello, world!",
  "status": "draft"
}

2. get_posts

Retrieves WordPress posts with pagination.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • perPage (optional): Number of posts per page (default: 10)
  • page (optional): Page number (default: 1)
  • customParams (optional): Additional query parameters

Example:

{
  "tool": "get_posts",
  "siteUrl": "https://example.com",
  "username": "admin",
  "password": "xxxx xxxx xxxx xxxx",
  "perPage": 5,
  "page": 1
}

3. update_post

Updates an existing WordPress post.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • postId (required): ID of the post to update
  • title (optional): New post title
  • content (optional): New post content
  • status (optional): New post status ('draft', 'publish', or 'private')

Example:

{
  "tool": "update_post",
  "siteUrl": "https://example.com",
  "username": "admin",
  "password": "xxxx xxxx xxxx xxxx",
  "postId": 123,
  "title": "Updated Title",
  "content": "Updated content",
  "status": "publish"
}

4. delete_post

Deletes a WordPress post.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • postId (required): ID of the post to delete

Example:

{
  "tool": "delete_post",
  "siteUrl": "https://example.com",
  "username": "admin",
  "password": "xxxx xxxx xxxx xxxx",
  "postId": 123
}

User Management

1. get_users

Retrieves WordPress users.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • perPage (optional): Number of users per page (default: 10)
  • page (optional): Page number (default: 1)

2. get_user

Retrieves a specific WordPress user by ID.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • userId (required): ID of the user to retrieve

3. get_user_by_login

Retrieves a WordPress user by login name.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • userLogin (required): Login name of the user to retrieve

Comment Management

1. get_comments

Retrieves WordPress comments.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • perPage (optional): Number of comments per page (default: 10)
  • page (optional): Page number (default: 1)
  • postIdForComment (optional): Filter comments by post ID

2. create_comment

Creates a new comment on a post.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • postIdForComment (required): ID of the post to comment on
  • commentContent (required): Content of the comment
  • customData (optional): Additional comment data

Category and Tag Management

1. get_categories

Retrieves WordPress categories.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • perPage (optional): Number of categories per page (default: 10)
  • page (optional): Page number (default: 1)

2. create_category

Creates a new WordPress category.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • categoryName (required): Name of the category to create
  • customData (optional): Additional category data (description, parent, etc.)

Custom Requests

1. custom_request

Makes a custom request to any WordPress REST API endpoint.

Parameters:

  • siteUrl (required): Your WordPress site URL
  • username (required): WordPress username
  • password (required): WordPress application password
  • customEndpoint (required): API endpoint path
  • customMethod (optional): HTTP method ('GET', 'POST', 'PUT', 'DELETE', default: 'GET')
  • customData (optional): Data for POST/PUT requests
  • customParams (optional): URL parameters for GET requests

Example:

{
  "tool": "custom_request",
  "siteUrl": "https://example.com",
  "username": "admin",
  "password": "xxxx xxxx xxxx xxxx",
  "customEndpoint": "wp/v2/media",
  "customMethod": "GET",
  "customParams": {
    "per_page": 5
  }
}

Response Format

All tools return responses in the following format:

Success Response

{
  "success": true,
  "data": {
    // WordPress API response data
  },
  "meta": {
    // Optional metadata (pagination info, etc.)
  }
}

Error Response

{
  "success": false,
  "error": "Error message here"
}

Security Considerations

  • Always use HTTPS URLs for your WordPress site
  • Use application passwords instead of your main WordPress password
  • Keep your application passwords secure and don't share them
  • Consider using WordPress roles and capabilities to limit access
  • Regularly rotate application passwords

Development

To contribute to the development:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests (when available)
  5. Submit a pull request

For development mode with automatic recompilation:

npm run dev

License

This project is licensed under the ISC License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选