MW
Tutorial 13 min read

Local development setup

Run a WordPress MCP server locally — Docker, native, and Cloudflare Tunnel — for fast, agent-connected iteration.

WordPress Docker Cloudflare Tunnel Local
Auto-cycle
1. Your AI client connects to a tunnel URL or local socket.

Click a node to step through

1. Overview

A reliable local loop has three pieces: a WordPress instance, an MCP server pointing at it, and a way to reach the server from your AI client of choice. Docker handles the first; the SDK runs the second; Cloudflare Tunnel solves the third.

2. Prerequisites

Node.js 20+

MCP TypeScript SDK + dev tooling.

npm

Docker

WordPress + MariaDB compose stack.

compose

cloudflared

Free public tunnel for stdio/HTTP exposure.

tunnel

3. Local architecture

Docker boots WordPress at localhost:8080. The MCP server runs as a Node process that calls the REST API of that container. Optionally, Cloudflare Tunnel publishes the MCP server at a stable URL so Claude Desktop can reach it from anywhere.

4. Option 1 — Docker (recommended)

docker-compose.yml yaml
services:
  wp:
    image: wordpress:latest
    ports: ['8080:80']
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wp
      WORDPRESS_DB_PASSWORD: wp
      WORDPRESS_DB_NAME: wp
  db:
    image: mariadb:11
    environment:
      MYSQL_DATABASE: wp
      MYSQL_USER: wp
      MYSQL_PASSWORD: wp
      MYSQL_ROOT_PASSWORD: rootpw
terminal bash
docker compose up -d
# WordPress is now at http://localhost:8080
# Visit it once and finish the install wizard.

5. Option 2 — Native (without Docker)

Prefer a native stack? Use Local by Flywheel or any LAMP setup. The MCP server doesn't care how WordPress runs — it only needs a reachable REST endpoint and an application password.

6. Cloudflare Tunnel — expose to the internet

terminal bash
cloudflared tunnel --url http://localhost:8080
# A trycloudflare.com URL prints. Use it as WP_URL in your MCP server.

Local loop, production-bound

Docker compose. Tunnel. MCP server.

The same shape will run on the edge in chapter 18.

  • Containerised
  • Reachable
  • Iterable