Sponsored by Deepsite.site

WP Engine MCP Server

Created By
jpollock7 months ago
Sample MCP server for WP Engine API
Content

WP Engine MCP Server

This is a TypeScript implementation of an MCP server for the WP Engine API. It provides tools and resources for interacting with WP Engine accounts, sites, installs, and backups. The server supports both local (stdio) and remote (HTTP) transports.

Features

  • Get account information
  • Get site information
  • Get install information
  • Get and create backups
  • Support for both local and remote MCP connections
  • HTTP transport with authentication
  • Comprehensive logging and error handling

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the server:
    npm run build
    

Configuration

The server requires WP Engine API credentials to authenticate with the WP Engine API. You can obtain these credentials from the WP Engine Portal's API Access page: https://my.wpengine.com/api_access

Set the following environment variables:

  • WP_ENGINE_API_USERNAME: Your WP Engine API username
  • WP_ENGINE_API_PASSWORD: Your WP Engine API password

Usage

Local MCP Server (stdio transport)

For use with local MCP clients like Claude Desktop:

npm run start:stdio

Or with environment variables:

WP_ENGINE_API_USERNAME="your-username" WP_ENGINE_API_PASSWORD="your-password" npm run start:stdio

Remote MCP Server (HTTP transport)

For remote access via HTTP with environment variables:

WP_ENGINE_API_USERNAME=my-api-username WP_ENGINE_API_PASSWORD=my-api-password npm run start

This runs the default server (build/index.js) which supports remote transport. You can also run with custom options:

WP_ENGINE_API_USERNAME="your-username" WP_ENGINE_API_PASSWORD="your-password" node build/main.js --transport=http --port=8080 --auth-token=my-secure-token

Command Line Options

node build/main.js [options]

Options:
  -h, --help                 Show help message
  -v, --version              Show version information
  -t, --transport <type>     Transport type (stdio, http) [default: stdio]
  -p, --port <port>          Port for HTTP transport [default: 3000]
  -a, --auth-token <token>   Authentication token for HTTP transport [default: wpengine-mcp-token]

MCP Settings

Local Configuration (stdio transport)

Add the following configuration to your MCP settings file:

{
  "mcpServers": {
    "wpengine": {
      "command": "node",
      "args": [
        "/path/to/wpengine-mcp-ts/build/main.js"
      ],
      "env": {
        "WP_ENGINE_API_USERNAME": "your-api-username",
        "WP_ENGINE_API_PASSWORD": "your-api-password"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Remote Configuration (HTTP transport)

For remote MCP connections, you'll need to implement an HTTP MCP client or use the server as a remote service. The server exposes an HTTP endpoint at /mcp that accepts MCP protocol messages.

Example HTTP request:

curl -X POST http://localhost:3000/mcp \
  -H "Authorization: Bearer wpengine-mcp-token" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/list",
    "params": {}
  }'

Available Tools

The server provides comprehensive tools for managing your WP Engine infrastructure:

Account Management

  • get_accounts - Get all WP Engine accounts
  • get_current_user - Get the current authenticated user

Site Management

  • get_sites - Get all sites for a WP Engine account
  • create_site - Create a new site
  • update_site - Change a site name
  • delete_site - Delete a site and any installs associated with it (permanent)

Install Management

  • get_installs - Get all installs for a WP Engine site
  • create_install - Create a new WordPress installation
  • update_install - Update a WordPress installation
  • delete_install - Delete an install by ID (permanent)

Backup Management

  • get_backups - Get all backups for a WP Engine install
  • create_backup - Create a new backup for a WP Engine install

Domain Management

  • get_domains - Get the domains for an install
  • create_domain - Add a new domain to an existing install
  • update_domain - Set an existing domain as primary or configure redirects
  • delete_domain - Delete a specific domain for an install

Cache Management

  • purge_cache - Purge an install's cache (object, page, cdn, or all)

SSH Key Management

  • get_ssh_keys - Get your SSH keys
  • create_ssh_key - Add a new SSH key
  • delete_ssh_key - Delete an existing SSH key

Example Tool Usage

Get all accounts

{
  "name": "get_accounts",
  "arguments": {}
}

Create a new site

{
  "name": "create_site",
  "arguments": {
    "name": "My New Site",
    "account_id": "account-uuid"
  }
}

Create a new install

{
  "name": "create_install",
  "arguments": {
    "name": "mysite",
    "account_id": "account-uuid",
    "site_id": "site-uuid",
    "environment": "staging"
  }
}

Create a backup

{
  "name": "create_backup",
  "arguments": {
    "install_id": "install-uuid",
    "description": "Pre-deployment backup",
    "notification_emails": ["admin@example.com"]
  }
}

Add a domain

{
  "name": "create_domain",
  "arguments": {
    "install_id": "install-uuid",
    "name": "example.com",
    "primary": true
  }
}

Purge cache

{
  "name": "purge_cache",
  "arguments": {
    "install_id": "install-uuid",
    "type": "all"
  }
}

Available Resources

Account Information

wpengine://account/{accountId}

Account Sites

wpengine://account/{accountId}/sites

Site Information

wpengine://site/{siteId}

Site Installs

wpengine://site/{siteId}/installs

Install Information

wpengine://install/{installId}

Install Backups

wpengine://install/{installId}/backups

Testing

Local Testing (stdio transport)

You can test the server using the MCP inspector:

WP_ENGINE_API_USERNAME="your-api-username" WP_ENGINE_API_PASSWORD="your-api-password" npx @modelcontextprotocol/inspector build/main.js

Remote Testing (HTTP transport)

  1. Start the server in HTTP mode:

    WP_ENGINE_API_USERNAME="your-username" WP_ENGINE_API_PASSWORD="your-password" npm run start:http
    
  2. In another terminal, run the test client:

    node test-http-client.js
    

The test client will verify that the HTTP transport is working correctly and test various MCP operations.

Security Considerations

When using the HTTP transport:

  1. Authentication: The server uses Bearer token authentication. Change the default token in production.
  2. HTTPS: Consider using HTTPS in production environments.
  3. Firewall: Restrict access to the HTTP port to trusted networks only.
  4. Environment Variables: Store API credentials securely and never commit them to version control.

Development

Building

npm run build

Watching for changes

npm run watch

Project Structure

wpengine-mcp-ts/
├── src/
│   ├── main.ts              # Main entry point with transport selection
│   ├── index.ts             # Original stdio-only implementation
│   └── transport/
│       └── http.ts          # HTTP transport implementation
├── build/                   # Compiled JavaScript output
├── test-http-client.js      # HTTP transport test client
└── package.json

License

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
DeepChatYour AI Partner on Desktop
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"