WordPress-MCP

NemesisGuy/WordPress-MCP

3.2

If you are the rightful owner of WordPress-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The WordPress MCP Server integrates WordPress sites into Model Context Protocol workflows, enabling local-first LLM agents to manage content through natural language.

Tools
12
Resources
0
Prompts
0

WordPress MCP Server

Bring your WordPress site into any Model Context Protocol (MCP) workflow. This TypeScript server lets local-first LLM agents create, edit, and organize WordPress content through natural language prompts.

Table of contents

  1. Overview
  2. Quick start
  3. Configuration
  4. Running the MCP server
  5. Tool catalog
  6. Usage patterns
  7. Development & testing
  8. Troubleshooting
  9. Security
  10. Contributing & License

Overview

The WordPress MCP Server exposes curated REST actions as MCP tools so any compatible client (Claude Desktop, VS Code MCP plug-ins, custom shells) can manage content through voice or text automations. Use it to draft posts, update landing pages, or clean up categories without touching wp-admin.

Highlights

  • Full CRUD coverage for posts, pages, categories, and tags
  • Secure authentication powered by WordPress Application Passwords
  • Type-safe implementation with shared interfaces across client and server
  • Works with any MCP host over stdio; no network port exposure required
  • Ships with smoke-test scripts and troubleshooting guidance so you can validate locally before connecting a client

Quick start

git clone https://github.com/NemesisGuy/WordPress-MCP.git
cd WordPress-MCP
npm install
cp .env.example .env   # or `copy` on Windows
  1. Fill out .env using the variables listed below.
  2. Build the TypeScript sources: npm run build.
  3. Run a quick sanity check: node test-create-post.js. This script drops a draft post so you know auth and REST connectivity are good.
  4. Launch the MCP server in stdio mode: node build/index.js.
  5. Point your MCP client at the executable (see Running the MCP server).

Configuration

Environment variables

VariableDescriptionExample
WORDPRESS_URLBase URL to your WordPress site (must include protocol).https://example.com
WORDPRESS_USERNAMEWordPress user that generated the Application Password.editor_bot
WORDPRESS_APP_PASSWORDApplication Password copied from wp-admin (WordPress 5.6+).xxxx xxxx xxxx xxxx xxxx xxxx

Keep the space-separated format for Application Passwords. WordPress rejects tokens if you remove the spaces.

Creating an Application Password

  1. Log into wp-admin with the target user.
  2. Navigate to Users → Profile.
  3. Scroll to Application Passwords.
  4. Name it (e.g., "MCP Server") and click Add New.
  5. Copy the value immediately—WordPress never shows it again.
  6. Paste it into .env under WORDPRESS_APP_PASSWORD.

Running the MCP server

The server communicates over stdio, so you can embed it in any host that understands MCP.

Direct CLI

npm run build
node build/index.js

When the server logs Successfully connected to WordPress site!, it is ready to accept MCP requests.

Claude Desktop

Add the configuration to claude_desktop_config.json and restart Claude Desktop:

{
  "mcpServers": {
    "wordpress": {
      "command": "node",
      "args": ["C:\\Users\\YourUsername\\Projects\\WordPress-MCP\\build\\index.js"],
      "env": {
        "WORDPRESS_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "your-username",
        "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
      }
    }
  }
}

IDE + MCP tooling

VS Code (and other IDEs with MCP support) can reference the repository directly. See IDE_SETUP.md for a full walk-through tailored to this project, including a working example that also connects to the local VibeType agent.

Tool catalog

ToolPurposeRequired fieldsHelpful options
wordpress_create_postDraft or publish a posttitle, contentstatus, excerpt, categories, tags
wordpress_get_postFetch a specific postid
wordpress_list_postsList posts with filterspage, per_page, search, status, order, orderby
wordpress_update_postUpdate an existing postidtitle, content, status, excerpt, categories, tags, slug

You can speak or type natural-language prompts once the server is registered with your MCP client:

  • “Create a draft WordPress post titled ‘Hello World’ with content ‘This is my first post.’”
  • “Update WordPress post 123 and change its status to publish.”
  • “Update WordPress post 123 and set its slug to ‘hello-world-post’.”
  • “Upload a PNG image and attach as the featured image to post 123.”
  • “List the five most recent WordPress posts.”
  • “Create a new WordPress page called ‘About Us’ that summarizes our company.”
  • “Update WordPress page 42 and set its slug to ‘about-us-company’.”
  • “List all WordPress categories and tags so I can clean up duplicates.”

The included script test-create-post.js is another quick sanity check. After running npm run build, execute node test-create-post.js to create a draft titled “Second Test Post via MCP Server 🤖”. For upload testing, try node test-upload-media.js path/to/image.png <postId> to upload and (optionally) attach to a post as featured media.

Development & testing

CommandDescription
npm run buildCompile TypeScript sources in src/ to build/.
npm run watchRebuild on file changes for faster iteration.
node build/index.jsStart the MCP server after building.
node test-create-post.jsSmoke-test connectivity by creating a draft post.

Project layout:

src/                  # TypeScript sources and tool implementations
build/                # Compiled JS artifacts consumed by MCP hosts
docs/ (optional)      # Additional guides and blog content
IDE_SETUP.md          # IDE-specific MCP instructions
test-create-post.js   # Manual smoke test script

Troubleshooting

“Could not connect to WordPress site”

  • Confirm WORDPRESS_URL includes https:// and resolves from your machine.
  • Verify the REST API endpoint https://your-site.com/wp-json/wp/v2/ responds.
  • Check for firewalls or plugins that block Application Password requests.

“401 Unauthorized”

  • Double-check the username matches the Application Password issuer.
  • Regenerate the Application Password and update .env.
  • Keep the spaces in the password; WordPress expects them.

“Tool not found” inside an MCP client

  • Restart the client after editing its configuration.
  • Ensure npm run build succeeded and build/index.js exists.
  • Confirm file paths use escaped backslashes on Windows.

Security

  • Do not commit .env; it is ignored by default.
  • Revoke Application Passwords from wp-admin if a device is lost.
  • Prefer HTTPS for all remote WordPress instances so credentials never traverse plaintext.

Contributing & License

MIT License. Issues and pull requests are welcome—especially around new MCP workflows, additional test coverage, and documentation improvements.

Tested config on VS Code

{
  "servers": {
    "wordpress": {
      "command": "node",
      "args": [
        "C:\\Users\\<YourUser>\\Projects\\WordPress-MCP\\build\\index.js"
      ],
      "cwd": "C:\\Users\\<YourUser>\\Projects\\WordPress-MCP"
    }
  },
  "inputs": []
}

Replace <YourUser> with the Windows username or adjust the entire path if you keep the repository elsewhere.