Labsco
emzimmer logo

WordPress MCP Server

β˜… 115

from emzimmer

Manage WordPress sites via the REST API. Enables AI assistants to handle content, posts, and site configurations.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

WordPress MCP Server

smithery badge

A Model Context Protocol (MCP) server that enables AI assistants to interact with WordPress sites through the WordPress REST API. Supports multiple WordPress sites with secure authentication, enabling content management, post operations, and site configuration through natural language.

Features

  • Multi-Site Support: Connect to multiple WordPress sites simultaneously
  • REST API Integration: Full access to WordPress REST API endpoints
  • Secure Authentication: Uses application passwords for secure API access
  • Dynamic Endpoint Discovery: Automatically maps available endpoints for each site
  • Flexible Operations: Support for GET, POST, PUT, DELETE, and PATCH methods
  • Error Handling: Graceful error handling with meaningful messages
  • Simple Configuration: Easy-to-maintain JSON configuration file

Tools Reference

wp_discover_endpoints

Maps all available REST API endpoints on a WordPress site.

Arguments:

{
	"site": {
		"type": "string",
		"description": "Site alias (as defined in configuration)",
		"required": true
	}
}

Returns: List of available endpoints with their methods and namespaces.

wp_call_endpoint

Executes REST API requests to WordPress sites.

Arguments:

{
	"site": {
		"type": "string",
		"description": "Site alias",
		"required": true
	},
	"endpoint": {
		"type": "string",
		"description": "API endpoint path",
		"required": true
	},
	"method": {
		"type": "string",
		"enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
		"description": "HTTP method",
		"default": "GET"
	},
	"params": {
		"type": "object",
		"description": "Request parameters or body data",
		"required": false
	}
}

Error Handling

The server handles common errors including:

  • Invalid configuration file path or format
  • Invalid site configurations
  • Authentication failures
  • Missing or invalid endpoints
  • API rate limiting
  • Network errors

All errors are returned with descriptive messages to help diagnose issues.

Security Considerations

  • Keep your wp-sites.json file secure and never commit it to version control
  • Consider using environment variables for sensitive data in production
  • Store the config file outside of public directories
  • Use HTTPS for all WordPress sites
  • Regularly rotate application passwords
  • Follow the principle of least privilege when assigning user roles

Dependencies

  • @modelcontextprotocol/sdk - MCP protocol implementation
  • axios - HTTP client for API requests