Claude Publisher Ability
A complete MCP (Model Context Protocol) integration for WordPress that enables AI assistants like Claude to publish blog posts directly through conversation.
by Lax Mariappan · github.com/laxmariappan/claude2blog · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/laxmariappan/claude2blog/archive/refs/heads/main.zipA complete MCP (Model Context Protocol) integration for WordPress that enables AI assistants like Claude to publish blog posts directly through conversation.
GitHub Repository: github.com/laxmariappan/claude2blog
Overview
This plugin allows Claude Code and Claude Desktop to publish and update WordPress posts using the MCP protocol, eliminating the need to copy-paste content between applications.
Read the full story: How I Added AI-Powered Content Creation to My WordPress Blog with MCP
Features
- ✅ Publish new posts with title, content, categories, tags, and more
- ✅ Update existing posts
- ✅ List recent posts
- ✅ Works with Claude Code (VS Code) and Claude Desktop
- ✅ Supports draft, publish, pending, and private post statuses
- ✅ Full category and tag support
- ✅ Custom excerpts
- ✅ Author assignment
Requirements
- WordPress 6.9 or newer (Abilities API)
- PHP 7.4 or higher
- MCP Adapter plugin installed and active
- Node.js (for the MCP bridge)
- Claude Code or Claude Desktop
Installation
1. Install the WordPress Plugin
Copy the claude-publisher-ability.php file to your WordPress plugins directory:
wp-content/plugins/claude-publisher-ability/claude-publisher-ability.php
Activate the plugin:
- Go to WordPress Admin → Plugins
- Find "Claude Publisher Ability"
- Click "Activate"
2. Install the MCP Adapter Plugin
Install via WordPress Admin or WP-CLI:
wp plugin install mcp-adapter --activate
3. Set Up the MCP Bridge
For Claude Code (VS Code):
- Copy
mcp-stdio-bridge.jsandmcp-bridge-wrapper.shto a directory on your system - Update
mcp-bridge-wrapper.shwith your credentials:
export WP_API_URL="https://yoursite.com"
export WP_API_USERNAME="your-username"
export WP_API_PASSWORD="your-application-password"
- Add the MCP server:
claude mcp add --transport stdio wordpress -- /path/to/mcp-bridge-wrapper.sh
For Claude Desktop:
Create or update ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": ["/path/to/mcp-stdio-bridge.js"],
"env": {
"WP_API_URL": "https://yoursite.com",
"WP_API_USERNAME": "your-username",
"WP_API_PASSWORD": "your-application-password"
}
}
}
}
4. Create a WordPress Application Password
- Go to WordPress Admin → Users → Profile
- Scroll down to "Application Passwords"
- Enter a name (e.g., "Claude MCP")
- Click "Add New Application Password"
- Copy the generated password (it will have spaces)
- Use this password in your MCP configuration
Usage
Once configured, you can simply chat with Claude in VS Code or Claude Desktop:
"Write a blog post about React hooks and publish it as a draft to my WordPress site"
Claude will:
- Generate the blog post content
- Call the
claude_publish_postability via MCP - Create the post on your WordPress site
- Provide you with the post URL and edit link
Available Abilities
claude_publish_post
Publishes a new blog post.
Parameters:
title(required): Post titlecontent(required): Post content (HTML allowed)status(optional): draft, publish, pending, or private (default: draft)categories(optional): Array of category IDstags(optional): Array of tag IDsexcerpt(optional): Post excerptauthor_id(optional): Author user ID
claude_update_post
Updates an existing blog post.
Parameters:
post_id(required): ID of post to update- All other parameters same as
claude_publish_post(all optional)
claude_list_posts
Lists recent posts.
Parameters:
limit(optional): Number of posts to return (max 50, default 10)status(optional): Filter by status (publish, draft, etc.)
Architecture
┌─────────────────┐
│ Claude Code │
│ Claude Desktop │
└────────┬────────┘
│
│ STDIO (JSON-RPC 2.0, MCP 2025-06-18)
│
┌────────▼────────┐
│ MCP Bridge │ ← Session ID persistence
│ (Node.js) │ ← Protocol translation
└────────┬────────┘
│
│ HTTP + Auth + Mcp-Session-Id header
│ (MCP 2024-11-05)
│
┌────────▼────────────────────┐
│ WordPress MCP Endpoint │
│ /wp-json/mcp/... │ ← Session validation
└────────┬────────────────────┘
│
│ Abilities API
│
┌────────▼────────────────────┐
│ Claude Publisher Plugin │
│ wp_register_ability() │
└────────┬────────────────────┘
│
│ WordPress Core
│
┌────────▼────────────────────┐
│ wp_insert_post() │
│ wp_update_post() │
└─────────────────────────────┘
Session Management
The WordPress MCP Adapter requires session management (WordPress-specific, not standard MCP):
- Client sends
initializerequest without session ID - WordPress creates session and returns
Mcp-Session-Idheader - Bridge captures and stores the session ID
- All subsequent requests include the same
Mcp-Session-Idheader - Sessions expire after 24 hours of inactivity
- Maximum 32 sessions per user (configurable)
Note: This session requirement is specific to WordPress MCP Adapter. Other MCP implementations may not require sessions.
Files
claude-publisher-ability.php- WordPress plugin that registers publishing abilitiesmcp-stdio-bridge.js- Node.js bridge connecting MCP protocol to WordPress HTTP endpointmcp-bridge-wrapper.sh- Shell wrapper with environment variables (for Claude Code)
Security
- Uses WordPress Application Passwords for authentication
- Requires
publish_postscapability - All inputs are sanitized using WordPress functions
- HTTPS recommended for production use
Troubleshooting
MCP server not connecting
- Verify the bridge script is executable:
chmod +x mcp-bridge-wrapper.sh - Check credentials are correct
- Ensure WordPress site is accessible
- Restart Claude Desktop/Code
"Invalid or expired session" errors
This is fixed in the current version. If you encounter this:
- Ensure you're using the latest
mcp-stdio-bridge.js - The bridge should automatically capture and reuse session IDs
- Sessions expire after 24 hours - restart the MCP server if inactive for long periods
Posts not publishing
- Verify MCP Adapter plugin is active
- Check user has
publish_postscapability - Check WordPress error logs
- Verify session is valid (check MCP server connection)
SSL certificate errors (local development)
The bridge includes rejectUnauthorized: false for local .test domains. Remove this for production.
Contributing
Contributions welcome! Please submit issues and pull requests on GitHub.
License
GPL v2 or later
Credits
Created by Lax Mariappan
Built with: