Model Context Protocol (MCP) is the open standard that lets an AI assistant like Claude, ChatGPT, or Cursor use tools: read a file, query a database, or, in this case, publish a post to your WordPress site. Set it up once and you can say “draft a post about our new spring menu and save it as a draft” and have it appear in your WordPress admin. This guide explains what MCP is, how to connect it to WordPress safely, and where the line is.
What MCP actually is
MCP has three parts:
- The client is the AI app you talk to (Claude Desktop, ChatGPT, Cursor, and others).
- The MCP server is a small program that exposes a set of tools, each with a name, a description, and the inputs it accepts. For WordPress, tools look like
list_posts,create_post,update_product,upload_media. - The transport is how they talk: a local process on your computer (stdio) or an HTTP endpoint on a server.
The AI never touches WordPress directly. It asks the MCP server to run a tool; the server makes the real REST API call with credentials you gave it; the result comes back as text. That indirection is what lets you limit what the AI can do.
How a WordPress MCP server talks to your site
Almost every WordPress MCP server uses two things WordPress already ships with:
The REST API. Every WordPress site exposes https://yoursite.com/wp-json/wp/v2/ with endpoints for posts, pages, media, users, categories, and, with WooCommerce installed, wc/v3/ for products and orders.
Application passwords. Since WordPress 5.6, any user can generate a separate password for API access from Users > Profile > Application Passwords. It is a 24-character token tied to that user, revocable without changing the user’s real password. Requests authenticate with HTTP Basic auth over HTTPS.
The capabilities of the MCP connection are therefore exactly the capabilities of the WordPress user whose application password you use. That is the lever for safe scoping.
Step 1: Create a dedicated WordPress user
Do not use your administrator account. Create a new user whose role matches the narrowest set of tasks you want the AI to perform:
| Task | Role to use |
|---|---|
| Draft posts for human review | Contributor (cannot publish) |
| Draft and publish posts, upload images | Author |
| Edit any post or page | Editor |
| Update WooCommerce products | Shop Manager |
| Anything touching plugins, themes, users, settings | Do not do this through MCP |
Name the user something obvious like mcp-claude so it is easy to find in the activity log and easy to revoke.
Step 2: Generate an application password
- Confirm the site runs over HTTPS. Application passwords are disabled on plain HTTP.
- Log in as the new user (or edit it as admin), scroll to Application Passwords, enter a name like “Claude Desktop”, and click Add New.
- Copy the password now; WordPress shows it once.
- Test it from a terminal before involving any AI:
curl -u "mcp-claude:xxxx xxxx xxxx xxxx xxxx xxxx" \
https://yoursite.com/wp-json/wp/v2/users/me
A JSON object with the user’s name means authentication works. A 401 usually means a security plugin or host is stripping the Authorization header; most have a setting to allow it.
Step 3: Install and configure the MCP server
Several open-source WordPress MCP servers exist. Pick one that is actively maintained, read its tool list, and prefer one that lets you disable tools you do not need.
For a locally run server with Claude Desktop, the configuration lives in claude_desktop_config.json. Cursor and other clients use a similar mcp.json. A typical entry:
{
"mcpServers": {
"wordpress": {
"command": "npx",
"args": ["-y", "wordpress-mcp-server"],
"env": {
"WP_URL": "https://yoursite.com",
"WP_USERNAME": "mcp-claude",
"WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
"WP_ALLOWED_TOOLS": "list_posts,get_post,create_post,update_post,upload_media"
}
}
}
}
The package name and environment variable names vary by server; use the ones from your server’s README. The pattern is the same: site URL, dedicated user, application password, and if the server supports it, an explicit allowlist of tools.
Restart the client. You should see the WordPress tools listed in the client’s tool picker. Ask it something read-only first: “List my five most recent posts.” If that works, the connection is live.
What it is good for
- Publishing drafts. “Turn these meeting notes into a 600-word post about our new hours and save it as a draft.” The post appears in your admin for a human to review before it goes live.
- Bulk content edits. “Find every post that mentions our old address and update it to the new one.” Review the list it proposes before saying yes.
- Product updates. With a Shop Manager user and the WooCommerce endpoints: “Set the sale price on all items in the Winter category to 20 percent off through January 31.”
- Content audits. “Which pages have no featured image?” “Which posts have not been updated in two years?”
What it is not good for is anything structural: installing plugins, changing settings, managing users. Keep those on your own keyboard.
Security cautions
- Treat the application password like a real password. It lives in a plain-text config file on your machine. Anyone with access to that file has that user’s access to your site.
- Least privilege, always. A Contributor token cannot publish. An Author token cannot edit someone else’s post. Use the smallest role that does the job, and never an Administrator.
- Prompt injection is real. If the AI reads content from your site (comments, form submissions, imported text) that content can contain instructions aimed at the AI. A server with write access makes that dangerous. Keep read and write users separate if your workflow involves reading untrusted content.
- Audit the trail. Install an activity log plugin so every change made by
mcp-claudeis recorded with a timestamp. Review it weekly at first. - Revoke when idle. Application passwords can be revoked individually from the user’s profile. If you stop using the integration, remove it.
- Keep it off production until you trust it. Point it at a staging copy first. Watch what it does for a week. Then switch the URL.
Next step
If what you really want is for AI to build and reshape the site, not just post to it, look at AI builders that output a whole site, such as Spacefast, a Seahawk partner that drafts and hosts Astro sites from a brief. Our AI website builders list compares the rest. And if your existing site needs a safe REST API setup, a staging environment, or a security review before you hand an AI the keys, WP Services handles that as a fixed-price service.