Open source
Documentation
v1.0.2Practical guide to getting real work through the connector, and the failure modes that actually happen. Installation and the security model are on the plugin page.
01
Connect a client
Endpoint: https://example.com/wp-json/mcp/v1/mcp
Claude Code
claude mcp add --scope user --transport http wordpress \
https://example.com/wp-json/mcp/v1/mcp \
--header "Authorization: Basic $(printf '%s' 'USERNAME:APPPASSWORD' | base64)"
To keep the credential out of shell history, read it without echo first:
read -rs -p 'App password: ' APW
claude mcp add --scope user --transport http wordpress \
https://example.com/wp-json/mcp/v1/mcp \
--header "Authorization: Basic $(printf '%s' "USERNAME:$APW" | base64)"
unset APW
This is a partial measure — the credential still lands in ~/.claude.json in plaintext. The keychain route below removes it entirely.
Claude Desktop
Settings → Connectors → Add custom connector, then give it the endpoint URL. This path needs no local Node install. If the connector dialog offers nowhere to set an Authorization header, use the stdio bridge instead — it attaches credentials for you.
Cursor
~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):
{
"mcpServers": {
"wordpress": {
"url": "https://example.com/wp-json/mcp/v1/mcp",
"headers": {
"Authorization": "Basic BASE64_OF_USERNAME_COLON_APPPASSWORD"
}
}
}
}
Grok, and hosted clients generally
Add it as a custom connector and supply the endpoint URL. If the client answers with an OAuth credentials dialog, that is the expected path: enable OAuth 2.1 in settings and it will either discover everything itself or take the values from Settings → MCP Connector → OAuth clients. Never invent values for that dialog — without OAuth enabled there is no authorization server to describe, and the connection will fail.
If the client accepts a header instead, use a Bearer token, not an Application Password. If it only speaks the older SSE style, enable the legacy SSE transport and point it at /wp-json/mcp/v1/sse. HTTPS is mandatory for any hosted client.
Never give a hosted client an Application Password. A hosted connector is a different trust decision from a local one: the credential has to be stored on a third party’s servers, where you cannot revoke it from your own machine or see how it is held. Bearer tokens are built for this case — they can carry an expiry and a scope, and they are refused on every WordPress route except this plugin’s.
02
Credential storage
Ordinary MCP client setup writes the credential to disk in plaintext — ~/.claude.json, .mcp.json (easy to commit by accident), claude_desktop_config.json, ~/.cursor/mcp.json.
On macOS the stdio bridge can keep the secret in the login keychain instead. Store it once:
node bridge/dist/index.js --save-credential \
--url https://example.com/wp-json/mcp/v1/mcp \
--user YOUR_USERNAME
security is spawned with the terminal attached and does its own no-echo, type-it-twice prompt, so the secret never passes through argv (where ps could see it), the environment, a Node string, or your shell history. From then on the client config holds only the URL and the username. Credentials are stored under the service name wp-mcp-bridge, keyed by username@host, and are visible and revocable in Keychain Access.
03
Publishing: the one call that does everything
wp_publish_article creates a finished post in a single call: body, featured image, in-article images at named paragraphs, categories, tags and SEO metadata.
{
"title": "What a Full Roof Replacement Actually Costs",
"status": "draft",
"content": "<!-- wp:paragraph --><p>...</p><!-- /wp:paragraph -->",
"excerpt": "One sentence for the card and the meta description.",
"categories": ["Guides"],
"seo": {
"seo_title": "Under 60 characters",
"meta_description": "120 to 155 characters."
},
"featured_image": {
"url": "https://example.com/photo.jpg",
"alt": "What is actually in the frame, not the post title",
"credit": "Photographer via Unsplash",
"license": "Unsplash License"
},
"images": [
{
"url": "https://example.com/second.jpg",
"alt": "Describe this frame too",
"after_paragraph": 3
}
]
}
Prefer this over separate create, upload, insert and SEO calls. If an image fails, the article is still created and the response names the failure, so nothing is lost. Filenames are derived from alt when you omit one — usually correct, since a descriptive filename is the one SEO field that cannot be fixed later without breaking URLs.
04
Images: the part that decides whether this works
| # | Method | When | Calls |
|---|---|---|---|
| 1 | url | Image exists at any fetchable URL | 1 |
| 2 | attachment_id | Already in the media library | 1 |
| 3 | upload_id | Finishing a chunked transfer | n + 2 |
| 4 | base64 | Small file, inline | 1 |
Always pass url when you can. The server does the download, so large payloads never pass through the model’s output. This is the single most common way an image upload fails, and the failure is silent from the model’s side: a modest 83 KB photograph base64-encodes to roughly 111 KB of text, which is about 28,000 tokens the client has to emit inside one tool call. Hosted clients cap tool arguments far below that, so the call dies mid-argument and the model tends to blame whatever it can see — typically the site being unreachable.
The server is not the bottleneck. Measured server-side limits are 32 MB max_upload_bytes, a 10 MB PHP upload_max_filesize, and a negotiable chunk size. The real limit is the client’s tool-calling layer truncating outbound arguments, and it varies enormously between clients: one observed client sent roughly 773–2,600 characters per call while the server accepted 50,000, meaning a 112 KB image could take about 180 round-trips. Another moved 123 KB in ten calls over the identical protocol. That cannot be fixed on the server.
Staging pattern for generated images
When the model generates an image and only holds the bytes in its sandbox, connect a file-storage connector to the same client (Drive, Dropbox, S3 — anything that yields a direct-download URL), have the model write the image there, and pass that URL. Measured on one run: five generated cards of 330–383 KB each landed in twenty seconds, after pure chunking had failed for hours.
Google Drive URL shape matters. Use https://drive.google.com/uc?export=download&id=FILE_ID; the /file/d/FILE_ID/view form returns HTML. The file must be shared so anyone with the link can read it, or the fetch returns 403.
Chunked upload
Only when you truly have no URL. Three tools split the transfer at the call boundary, where the limit actually lives:
wp_begin_media_upload → upload_id wp_append_media_chunk → repeat using next_offset wp_finish_media_upload → attachment_id
Chunk size is negotiable rather than fixed: a client that knows it truncates above 8,000 characters asks for 8,000 and becomes reliable, while one that can emit 100,000 does the same file in two calls. Transfers resume by character offset, not by chunk: every reply carries next_offset, the exact base64 character the server expects next, so a call cut short in transit keeps whatever arrived and the client continues from there. A slice already held in full is acknowledged as a duplicate, so a lost response is not a failure. wp_media_upload_status returns next_offset and the bytes already stored, so an interrupted client resumes rather than restarting. Supply sha256 at the start and the assembled file is verified before anything is stored. Sizes run from 500 to 400,000 characters per chunk, and an upload expires after 6 hours of inactivity.
Verified on a real 123 KB photograph at a client-requested 8,000-character chunk size: 21 chunks, a deliberately truncated call rejected immediately as wpmcp_chunk_corrupt, a resent chunk accepted as a duplicate without corrupting the stream, a status query resuming correctly, and the assembled file byte-identical to the source by SHA-256.
Record provenance at upload time
Every image accepts credit and license. Set them on the way in — reconstructing later which of forty-five attachments were generated versus photographed is painful, and a staging URL is not provenance: it records where the bytes passed through, not what the image is, and those links rot when the file moves. For generated images, "license": "AI generated" is cheap and permanent.
05
Troubleshooting
401 Unauthorized
The credential did not resolve to a user. Check you are using the username, not the email address, and that the Application Password was copied in full. Test with curl -u 'user:pass' .../health.
403 “Browser cookie sessions cannot be used for MCP”
The request carried a WordPress cookie but no Authorization header. Send the credential as a header.
The Application Passwords section is missing
WordPress hides it when the request is not over HTTPS and the environment type is not local. Fix HTTPS, or set WP_ENVIRONMENT_TYPE to local in wp-config.php for local development.
The Authorization header never arrives (Apache with CGI/FastCGI)
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
The plugin already reads REDIRECT_HTTP_AUTHORIZATION and apache_request_headers(), so this is only needed on stubborn setups.
A tool is missing from tools/list
Two possible reasons, both intentional: the profile does not expose it, or the connected user lacks its capability. The health endpoint lists exactly what that user can currently see. A third possibility after an upgrade is that tool definitions are read once at connection time — reconnect the client rather than assuming discovery.
“That option is restricted”
Almost always a guessed option name rather than a real permission wall. A true refusal names the allowlist; a null or false value means the option does not exist. Some options are refused even with * or an exact entry: the site address, admin email, user roles and registration, active plugins and themes, cron, upload paths, the plugin’s own settings, and anything whose name looks like a secret, token, password, salt or key.
The connector keeps going down and needs re-authorization
Usually credentials stored in transients on a site with a persistent object cache, where cache flushes during deploys destroy them. This plugin stores OAuth tokens in a real option instead. Prefer deleting page-cache files over running a full object-cache purge during deploys.
Published changes are not visible on the site
Work outward, cheapest first: PHP opcache, then the disk page cache (which can serve stale HTML even when the plugin looks inactive), then Varnish, then the edge or CDN cache — usually only purgeable from the host’s control panel. Quick diagnostic: request the same page with a query string. If that is fresh and the clean URL is stale, the cache is keyed on the exact URL.
Note that wp_flush_caches clears the object cache and expired transients only. Page cache plugins, CDNs and PHP opcache are untouched and need their own purge.
SEO fields write but nothing shows
Check which backend was detected — Yoast, Rank Math and SEOPress are automatic, and wp_get_site_info reports the result. For a custom SEO implementation, point the plugin at your own meta prefix with the wpmcp_seo_backend and wpmcp_seo_meta_prefix filters, or use wpmcp_seo_key_map when the keys do not share one prefix.
06
Give the model its house rules
The connector is transport only. It does not know your editorial standards, and should not, so the plugin stays reusable. Publish your authoring rules as a readable option and instruct the model to call wp_get_option before writing anything. Generate that option from live data so the rules cannot drift from what the code enforces.
07
Extending
Add tools without forking, via the wpmcp_tool_providers filter. A tool registered this way is automatically exposed over both transports, mirrored into the Abilities API, rate limited, capability checked, schema validated and logged.
Configuration can be pinned in an mu-plugin through wpmcp_settings so it cannot be loosened from the admin screen, and individual tools can be denied through wpmcp_is_tool_enabled.
Writing good tool descriptions
The description field is what the model reasons over when deciding whether to call a tool. Three rules worth keeping if you add your own: say when to use it and when not to; warn about consequences in the description, not just the annotation; and point at the tool that should have come first. Error messages follow the same principle — they say what went wrong, what is allowed instead, and whether retrying is worth it.