Bridge between stdio-based MCP clients and HTTP-based WordPress MCP server
npm install wordpress-mcp-bridgecurl installed (for URL-based method)
%APPDATA%\.codeium\windsurf\mcp_config.json
~/.codeium/windsurf/mcp_config.json
json
{
"mcpServers": {
"wordpress": {
"command": "cmd",
"args": [
"/c",
"curl -k -s https://yoursite.com/wp-json/cws-mcp/v1/bridge | node - https://yoursite.com/wp-json/cws-mcp/v1/messages your-username \"your-app-password\""
],
"disabled": false,
"env": {}
}
}
}
`
macOS/Linux Configuration:
`json
{
"mcpServers": {
"wordpress": {
"command": "bash",
"args": [
"-c",
"curl -k -s https://yoursite.com/wp-json/cws-mcp/v1/bridge | node - https://yoursite.com/wp-json/cws-mcp/v1/messages your-username \"your-app-password\""
],
"disabled": false,
"env": {}
}
}
}
`
#### For Cursor (URL-based)
Edit your MCP config file at:
- Windows: %USERPROFILE%\.cursor\mcp.json
- macOS/Linux: ~/.cursor/mcp.json
Use the same configuration format as Windsurf above.
---
$3
This method uses an absolute file path to the bridge script. Use this if you prefer not to download the script on each connection.
#### For Windsurf (File-based)
Edit your MCP config file at:
- Windows: %APPDATA%\.codeium\windsurf\mcp_config.json
- macOS/Linux: ~/.codeium/windsurf/mcp_config.json
Configuration:
`json
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": [
"/absolute/path/to/wordpress-mcp-bridge.js",
"https://yoursite.com/wp-json/cws-mcp/v1/messages",
"your-username",
"your-app-password"
],
"disabled": false,
"env": {}
}
}
}
`
Windows Example:
`json
{
"mcpServers": {
"wordpress": {
"command": "node",
"args": [
"D:\\Projects\\WordPress\\mcp-test\\app\\public\\wp-content\\plugins\\cws-mcp\\bridge\\wordpress-mcp-bridge.js",
"https://mcp-test.local/wp-json/cws-mcp/v1/messages",
"admin",
"aR0d Kg8v iVfp ZgFP 0e36 ntCB"
],
"disabled": false,
"env": {}
}
}
}
`
#### For Cursor (File-based)
Edit your MCP config file at:
- Windows: %USERPROFILE%\.cursor\mcp.json
- macOS/Linux: ~/.cursor/mcp.json
Use the same configuration format as Windsurf above.
#### For Zed
Edit your Zed settings:
- macOS: ~/.config/zed/settings.json
- Linux: ~/.config/zed/settings.json
- Windows: %APPDATA%\Zed\settings.json
Add:
`json
{
"context_servers": {
"wordpress": {
"command": {
"path": "node",
"args": [
"/absolute/path/to/wordpress-mcp-bridge.js",
"https://yoursite.com/wp-json/cws-mcp/v1/messages",
"your-username",
"your-app-password"
]
}
}
}
}
`
Testing the Bridge
$3
`bash
Navigate to the bridge directory
cd /path/to/wp-content/plugins/cws-mcp/bridge
Run the bridge manually
node wordpress-mcp-bridge.js https://yoursite.com/wp-json/cws-mcp/v1/messages admin "your-app-password"
Type a JSON-RPC request (press Enter after):
{"jsonrpc":"2.0","method":"tools/list","id":1}
You should see a response with available tools
`
$3
`bash
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node wordpress-mcp-bridge.js https://yoursite.com/wp-json/cws-mcp/v1/messages admin "your-app-password"
`
Troubleshooting
$3
Solution: Make sure Node.js is installed and in your PATH.
`bash
node --version
`
$3
Solutions:
1. Verify WordPress site is accessible
2. Check the endpoint URL is correct
3. Test the endpoint directly:
`bash
curl -X POST https://yoursite.com/wp-json/cws-mcp/v1/messages \
-H "Content-Type: application/json" \
-u "username:password" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
`
$3
Solutions:
1. Verify Application Password is correct
2. Check username is correct
3. Ensure Application Passwords are enabled in WordPress
4. Try creating a new Application Password
$3
The bridge automatically accepts self-signed certificates for local development. If you need to disable this in production:
Edit wordpress-mcp-bridge.js and remove this line:
`javascript
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
`
$3
Solutions:
1. Restart your code editor completely
2. Check the MCP config file syntax is valid JSON
3. Verify the absolute path to the bridge script is correct
4. Check editor logs for MCP errors
$3
The bridge logs to stderr (not stdout, to avoid interfering with MCP communication).
To see logs:
`bash
node wordpress-mcp-bridge.js https://yoursite.com/wp-json/cws-mcp/v1/messages admin "password" 2> bridge.log
`
Then check bridge.log for error messages.
How It Works
1. Editor sends JSON-RPC request via stdin
2. Bridge receives request from stdin
3. Bridge forwards request to WordPress via HTTP POST
4. WordPress processes request and returns JSON-RPC response
5. Bridge sends response back to editor via stdout
`
┌─────────┐ stdio ┌────────┐ HTTP ┌───────────┐
│ Editor │ ←────────────→ │ Bridge │ ←───────────→ │ WordPress │
│(Cursor) │ JSON-RPC │(Node.js)│ JSON-RPC │ MCP │
└─────────┘ └────────┘ └───────────┘
`
Security Notes
1. Never commit your Application Password to version control
2. Use environment variables for sensitive data in production
3. The bridge accepts self-signed certificates for local development only
4. Application Passwords can be revoked at any time in WordPress
Alternative: Use Claude Desktop
If you prefer not to use the bridge, Claude Desktop natively supports HTTP-based MCP servers and works directly with the WordPress plugin without any bridge:
Claude Desktop config (~/.config/claude/config.json):
`json
{
"mcpServers": {
"wordpress": {
"url": "https://yoursite.com/wp-json/cws-mcp/v1/messages",
"auth": {
"type": "basic",
"username": "your-username",
"password": "your-app-password"
}
}
}
}
``