WP Astro MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/vapvarun/wp-astro-mcp.git
cd wp-astro-mcp
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add wp-astro-mcp -- node "<FULL_PATH_TO_WP_ASTRO_MCP>/dist/index.js"

Replace <FULL_PATH_TO_WP_ASTRO_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Migrate any WordPress site to Astro fully automated via Claude Code.

WP Astro MCP

Migrate any WordPress site to Astro — from a single blog to a network of 12 sites with 6,000+ posts. Fully automated via Claude Code.

WP Astro MCP is a Model Context Protocol server that turns WordPress sites into production-ready Astro projects. It connects to your WordPress REST API, extracts everything (posts, pages, CPTs, SEO, ACF, menus, media), converts HTML to clean Markdown, scaffolds a complete Astro project, and pushes to GitHub — all through conversational commands in Claude Code.


Why This Exists

Migrating WordPress to Astro involves dozens of tedious steps: fetching content via API, cleaning up page builder markup, resolving shortcodes, building frontmatter, setting up content collections, handling media URLs, generating redirects, deploying. Each site has its own plugins, page builders, and content patterns.

This MCP server handles all of it. Tell Claude to migrate your site, and it orchestrates 55 specialized tools to get it done.


Quick Start

1. Install

git clone https://github.com/vapvarun/wp-astro-mcp.git
cd wp-astro-mcp
npm install
npm run build

2. Add to Claude Code

Add to your MCP config (~/.claude.json or project .mcp.json):

{
  "mcpServers": {
    "wp-astro-mcp": {
      "command": "node",
      "args": ["/path/to/wp-astro-mcp/dist/index.js"]
    }
  }
}

3. Generate a WordPress Application Password

Go to your WordPress admin → Users → Profile → Application Passwords. Enter a name, click "Add New", and copy the password.

4. Start Migrating

In Claude Code, just say:

Add my WordPress site example.com with username admin
and app password "xxxx xxxx xxxx xxxx xxxx xxxx"

Claude will register the site, auto-detect its capabilities (SEO plugin, page builder, ACF, post types), and guide you through the migration.


How It Works

WordPress Site                    WP Astro MCP                      Astro Project
┌─────────────┐     REST API     ┌──────────────┐     Files        ┌─────────────┐
│ Posts        │────────────────►│ Extract      │───────────────►│ content/    │
│ Pages       │                  │ Transform    │                │ blog/       │
│ CPTs        │                  │ Scaffold     │                │ pages/      │
│ Media       │                  │ Write        │                │ layouts/    │
│ SEO         │                  │              │                │ pages/      │
│ ACF         │                  │ SQLite state │                │ astro.config│
│ Menus       │                  │ for resume   │                │ package.json│
└─────────────┘                  └──────────────┘                └─────────────┘
                                       │                               │
                                       │ GitHub API                    │
                                       ▼                               ▼
                                 ┌──────────────┐              ┌─────────────┐
                                 │ git init     │              │ Vercel      │
                                 │ create repo  │──────────────│ Netlify     │
                                 │ push         │              │ Cloudflare  │
                                 └──────────────┘              └─────────────┘

The Conversion Pipeline

Every post goes through a 13-step conversion:

  1. Sanitize — DOMPurify removes XSS vectors while preserving content
  2. Resolve shortcodes — 20+ built-in handlers (gallery, video, WPBakery, Divi, CF7) + custom per-site rules
  3. Clean page builders — Strip Elementor/WPBakery/Divi wrapper divs, keep content
  4. Process Gutenberg — Remove block comments (``), preserve content
  5. Normalize HTML — Decode entities, remove empty paragraphs, clean inline styles
  6. Convert to Markdown — Turndown with 12 WordPress-specific rules (captions, galleries, code blocks, embeds)
  7. Rewrite links — Internal WordPress URLs → Astro paths using URL map
  8. Rewrite media — Swap domains for media URLs (e.g., example.comapp.example.com)
  9. Clean artifacts — Remove conversion leftovers, fix double-encoded entities
  10. Process embeds — YouTube/Vime

Configuration

claude_desktop_config.json
{"mcpServers": {"wp-astro-mcp": {"command": "node", "args": ["/path/to/wp-astro-mcp/dist/index.js"]}}}

Try it

Add my WordPress site example.com with username admin and app password "xxxx xxxx xxxx xxxx xxxx xxxx"
Migrate the content from my WordPress site to a new Astro project structure.
Detect the SEO plugin and ACF fields on my WordPress site and prepare them for Astro migration.

Frequently Asked Questions

What are the key features of WP Astro MCP?

Extracts posts, pages, CPTs, SEO, ACF, menus, and media from WordPress REST API. Converts HTML content to clean Markdown with WordPress-specific rules. Scaffolds complete Astro project structures including content collections. Handles complex page builder markup cleanup for Elementor, WPBakery, and Divi. Automates GitHub repository creation and deployment configuration.

What can I use WP Astro MCP for?

Migrating a single WordPress blog to a high-performance Astro site. Converting a network of WordPress sites into a unified Astro project. Automating the cleanup of legacy page builder markup during site migration. Syncing WordPress content into Astro content collections for static site generation.

How do I install WP Astro MCP?

Install WP Astro MCP by running: git clone https://github.com/vapvarun/wp-astro-mcp.git && cd wp-astro-mcp && npm install && npm run build

What MCP clients work with WP Astro MCP?

WP Astro MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep WP Astro MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare