# WordPress MCP Server

An MCP server that hands your assistant the WordPress database: posts, comments, users, terms, metadata and site settings. Useful when you edit content from a chat instead of wp-admin.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: rnaga
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rnaga/wp-mcp
- Updated: 2026-07-22
- HTML: https://affpapa.org/en/nevibecode/mcp/wordpress-mcp-server

## What it does

The server sits on top of `@rnaga/wp-node` and exposes a toolset for CRUD work: create, read, update and delete posts along with their revisions, moderate comment threads, change user roles, handle categories, tags and custom taxonomies, edit meta fields and site options. Two deployment shapes are available. A local STDIO server talks to the database directly; a Streamable HTTP server covers remote access. Clients that cannot do OAuth or Application Password can go through the CLI proxy, which presents itself as a local MCP server and forwards requests to the HTTP endpoint.

A CLI named `wp-mcp` ships with the project. It walks you through the database connection (`npx @rnaga/wp-mcp -- local config-set` asks for host, port, database name, user and password), scaffolds an Express-based HTTP server, authenticates against a remote WordPress install and keeps credentials under `~/.wp-mcp`. To see which primitives exist and what they require, run `npx @rnaga/wp-mcp -- utils list-prims` — the table lists each primitive, its required capabilities and allowed roles.

\`LOCAL_USERNAME` in the client config is not optional. The server reads that WordPress user's capabilities to decide which tools to expose at all: an administrator gets the full set, including post deletion and user management, while a subscriber sees a narrow slice. That filtering is what keeps a privileged call from firing by accident.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `LOCAL_USERNAME`, `WP_DB_HOST`, `WP_DB_PORT`, `WP_DB_NAME`, `WP_DB_USER`, `WP_DB_PASSWORD`, `LOCAL_MULTISITE`, `LOCAL_DEFAULT_BLOG_ID`, `LOCAL_DEFAULT_SITE_ID`, `LOCAL_SSL_ENABLED` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add wp-mcp -e LOCAL_USERNAME=<LOCAL_USERNAME> -e WP_DB_HOST=<WP_DB_HOST> -e WP_DB_NAME=<WP_DB_NAME> -e WP_DB_USER=<WP_DB_USER> -e WP_DB_PASSWORD=<WP_DB_PASSWORD> -- npx -y @rnaga/wp-mcp
```
Replace <…> with your own values. 8 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add wordpress-mcp-server --env LOCAL_USERNAME=<LOCAL_USERNAME> --env WP_DB_HOST=<WP_DB_HOST> --env WP_DB_PORT=<WP_DB_PORT> --env WP_DB_NAME=<WP_DB_NAME> --env WP_DB_USER=<WP_DB_USER> -- npx -y @rnaga/wp-mcp
```
Replace <…> with your own values. 8 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "wordpress-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@rnaga/wp-mcp"
            ],
            "env": {
                "LOCAL_USERNAME": "<LOCAL_USERNAME>",
                "WP_DB_HOST": "<WP_DB_HOST>",
                "WP_DB_PORT": "<WP_DB_PORT>",
                "WP_DB_NAME": "<WP_DB_NAME>",
                "WP_DB_USER": "<WP_DB_USER>"
            }
        }
    }
}
```
Replace <…> with your own values. 8 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "wordpress-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@rnaga/wp-mcp"
            ],
            "env": {
                "LOCAL_USERNAME": "<LOCAL_USERNAME>",
                "WP_DB_HOST": "<WP_DB_HOST>",
                "WP_DB_PORT": "<WP_DB_PORT>",
                "WP_DB_NAME": "<WP_DB_NAME>",
                "WP_DB_USER": "<WP_DB_USER>"
            }
        }
    }
}
```
Replace <…> with your own values. 8 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LOCAL_USERNAME=<LOCAL_USERNAME> -e WP_DB_HOST=<WP_DB_HOST> -e WP_DB_PORT=<WP_DB_PORT> -e WP_DB_NAME=<WP_DB_NAME> -e WP_DB_USER=<WP_DB_USER> wordpress-mcp-server npx -y @rnaga/wp-mcp
```
Replace <…> with your own values. 8 more environment variables are in the server README

## When to use it
- draft a post and publish it without leaving the chat
- work through a comment queue and reply to some of them
- promote a contributor to editor or disable an account
- fix meta fields across posts and terms in one pass
- flip site options without opening the admin panel

## Example prompts
- List the latest drafts and show me their titles
- Create a post titled "Quarterly recap" and save it as a draft
- Show every user with the editor role

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
