mcp-wp-remote
A STDIO bridge for connecting to WordPress sites via the Model Context Protocol (MCP), enabling communication between MCP clients and WordPress installations running the websamurai plugin.
README
@websamurai/mcp-wp-remote
A STDIO bridge for connecting to WordPress sites via the Model Context Protocol (MCP). This package enables communication between MCP clients and WordPress installations running the websamurai plugin.
Overview
mcp-wp-remote acts as a bridge between MCP clients and WordPress REST API endpoints. It reads JSON-RPC requests from STDIN, forwards them to a WordPress site's MCP endpoint, and returns responses via STDOUT.
Installation
npm install -g @websamurai/mcp-wp-remote
Or use directly with npx:
npx @websamurai/mcp-wp-remote <url> <api-key>
Requirements
- Node.js (ES modules support required)
- WordPress site with websamurai plugin installed
- Valid API key from your WordPress installation
Usage
Command Line
mcp-wp-remote <url> <api-key>
Parameters:
<url>- Your WordPress site URL (e.g.,https://example.com)<api-key>- API key for authentication (Bearer token)
The endpoint path /wp-json/websamurai/v1/mcp is automatically appended to the URL if not present.
Example
mcp-wp-remote https://mysite.com my-secret-api-key
Or with the full endpoint:
mcp-wp-remote https://mysite.com/wp-json/websamurai/v1/mcp my-secret-api-key
As MCP Server Configuration
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"wordpress": {
"command": "mcp-wp-remote",
"args": ["https://yoursite.com", "your-api-key"]
}
}
}
How It Works
- Accepts JSON-RPC 2.0 formatted messages via STDIN
- Authenticates with WordPress using Bearer token authorization
- Forwards requests to the WordPress MCP endpoint
- Returns responses via STDOUT in JSON-RPC 2.0 format
Communication Flow
MCP Client → STDIN → mcp-wp-remote → WordPress REST API
← STDOUT ← ←
JSON-RPC Protocol
The bridge expects and returns JSON-RPC 2.0 formatted messages:
Request:
{
"jsonrpc": "2.0",
"method": "method_name",
"params": {},
"id": 1
}
Response (Success):
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}
Response (Error):
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Error description"
},
"id": 1
}
Error Handling
The bridge handles various error scenarios:
- Invalid URL: Exits with code 1 if URL is malformed
- HTTP Errors: Returns JSON-RPC error with HTTP status code
- Network Errors: Returns JSON-RPC error with code -32000
- Invalid Arguments: Shows usage message and exits
Features
- Automatic endpoint path normalization
- Bearer token authentication
- Multi-line JSON input support
- Graceful shutdown handling (SIGINT, SIGTERM)
- JSON-RPC 2.0 compliant error responses
WordPress Setup
- Install the websamurai plugin on your WordPress site
- Generate an API key in the plugin settings
- Ensure the REST API endpoint is accessible at
/wp-json/websamurai/v1/mcp
Development
# Clone repository
git clone <repository-url>
# Install dependencies (if any)
npm install
# Run locally
node index.js https://example.com your-api-key
License
MIT
Keywords
- MCP (Model Context Protocol)
- WordPress
- JSON-RPC
- STDIO Bridge
- REST API
Author
websamurai Team
Support
For issues and questions:
- WordPress Plugin: WebSamurai
- GitHub Issues: Report issues in the repository
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.