Setup Guide for WebSamurai
Connect your WordPress site to your AI chatbots using the Model Context Protocol. Manage posts, pages, and custom content directly from Claude Desktop or other MCP-compatible clients. These instructions are only if you are using your own chatbot to access the site, if you have the premium, all you need to do is login on the WordPress admin (under “WebSamurai”) menu item.
๐ What You’ll Need
โ WebSamurai Plugin
The WebSamurai plugin installed and activated on your WordPress site. You can download the zip from here or download it from the plugin repository
โ API Key
Generate an API key from your WordPress admin panel (Settings โ WebSamurai)
โ MCP Client
Claude Desktop, Claude Code, or another MCP-compatible AI assistant
๐ Step 1: Generate Your API Key
- Navigate to Settings โ WebSamurai in your WordPress admin panel
- Click on the API Keys tab
- Enter a name for your key (e.g., “Claude Desktop” or “My Local Development”)
- Click Generate API Key
- Important: Copy the API key immediately – you won’t be able to see it again!
๐ก Pro Tip: Store your API key in a password manager or secure note. If you lose it, you’ll need to generate a new one.
โ๏ธ Step 2: Configure Your MCP Client
Choose your AI chatbot below for specific setup instructions:
Claude Desktop Setup
โน๏ธ As of the 1.0.5 version of the plugin, WebSamurai uses OAuth 2.1 โ there are no longer any configuration files to edit.
- Go to the Customize option.
- Click Add custom connector.
- Enter a name and the URL for the MCP connection:
https://yoursite.com/wp-json/websamurai/v1/mcp - Press Connect to authorize the connection via OAuth.
Claude Code (CLI) Setup
In the directory you’re coding from, execute the following at the command line:
claude mcp add -t http wordpress_site_name https://wp_site_url.com/wp-json/websamurai/v1/mcp --header "X-API-Key: <YOUR_API_KEY>"
If you are using a local install, and/or your certificate is invalid, you can add on an enviroment variable to allow it to connect:
claude mcp add -t http wordpress_site_name https://wp_site_url.com/wp-json/websamurai/v1/mcp --header "X-API-Key: <YOUR_API_KEY>" -e "NODE_TLS_REJECT_UNAUTHORIZED=0"
You may also need to add a enviroment variable for “NODE_TLS_REJECT_UNAUTHORIZED=0” at your command line using:
Linux or Mac OS:
export NODE_TLS_REJECT_UNAUTHORIZED=0
or windows:
set NODE_TLS_REJECT_UNAUTHORIZED=0
Restart Claude Code or reload the configuration.
ChatGPT Setup
Current Status: OpenAI ChatGPT does not natively support the Model Context Protocol (MCP) as of early 2025.
Alternative: Custom GPT Actions
You can create a Custom GPT with Actions that connect to your WordPress site’s REST API:
- Go to ChatGPT and create a new Custom GPT
- In the Actions section, add your WordPress REST API endpoint:
https://yoursite.com/wp-json/websamurai/v1/mcp - Configure authentication using your API key:
- Authentication Type: API Key
- Header Name:
X-API-Key - API Key: Your generated API key
- Define the available actions (create post, update page, etc.)
- Test the connection and save your Custom GPT
Note: This approach provides similar functionality to MCP but requires manual configuration of each action in the Custom GPT interface.
Cursor
1. Open Cursor
2. Open Cursor settings (gear icon in Cursor panel)
3. Navigate to MCP Servers section
4. Add the WebSamurai server configuration:
{
"mcpServers": {
"websamurai": {
"url": "https://www.Your.site/wp-json/websamurai/v1/mcp",
"headers": {
"API_KEY": "YOUR API KEY"
}
}
}
}
5. Save the settings and restart the Cursor extension
You should now see WebSamurai tools available in Cursor’s tool list.
Other MCP-Compatible Clients
Many AI tools are adding MCP support. The configuration is generally similar across all clients:
General Configuration Pattern
- Locate the MCP configuration file for your client
- Add a server configuration in JSON format
- Specify the command (
npx), package (@websamurai/mcp-wp-remote), and your site URL - Set the
WEBSAMURAI_API_KEYenvironment variable - Restart the application
Template Configuration
{
"mcpServers": {
"websamurai": {
"command": "npx",
"args": [
"-y",
"@websamurai/mcp-wp-remote",
"https://yoursite.com",
"your-api-key-here"
],
}
}
}
Known Compatible Clients
- Continue.dev – AI coding assistant with MCP support
- Zed Editor – Modern code editor with built-in AI
- Cursor – AI-first code editor
- LibreChat – Open source chat platform
Check your specific client’s documentation for exact configuration paths and formatting requirements.
