Skip to content

Instantly share code, notes, and snippets.

@amiradbrains
Forked from hi0001234d/wordpress_ai.md
Created May 16, 2026 11:11
Show Gist options
  • Select an option

  • Save amiradbrains/db22de966bc1312348a224d6cc612b8e to your computer and use it in GitHub Desktop.

Select an option

Save amiradbrains/db22de966bc1312348a224d6cc612b8e to your computer and use it in GitHub Desktop.
wordpress-ai

MCP Adapter Plugin

Note: Official MCP Adapter Plugin releases — download the latest .zip from here.

Plugin Repo: https://github.com/WordPress/mcp-adapter/releases/tag/v0.5.0

Note: Custom plugins used along with MCP Adapter (WooProduct Abilities).

AI Post Generator & WooProduct Abilities Plugin: https://drive.google.com/drive/folders/1gvnv-50XukW4Pny6xXyF0fjer5IW4-li?usp=drive_link


Create Application Password To Connect AI

Note: Steps below enable Application Passwords on a local WordPress site so Claude / AI clients can authenticate.

F1 -- Set Environment Type (Quickest)

Note: Add these two constants in wp-config.php so WordPress treats the site as a local/dev environment. Application Passwords are disabled on non-HTTPS sites by default — these constants unlock them on localhost.

Jo Create Password ma error ave to config file ma aa niche apeli 2 line add karvi

Add to wp-config.php:

define( 'WP_ENVIRONMENT_TYPE', 'local' );
define( 'WP_DEVELOPMENT_MODE', 'all' );

IMPORTANT: Place these lines ABOVE the "stop editing" comment, otherwise WP will not pick them up.

Place them ABOVE this line:

/* That's all, stop editing! Happy publishing. */

F2 -- Then Add This FILTER (Important)

Note: This filter force-enables the Application Passwords feature even when WP thinks it shouldn't be available. File path: wp-content/themes/your-active-theme/functions.php

In wp-content/themes/your-active-theme/functions.php add:

add_filter( 'wp_is_application_passwords_available', '__return_true' );

F3 -- Refresh Your Profile Page

Note: After adding the filter in F2, simply refresh your User Profile page in WordPress admin.

Go to: WordPress Admin > Users > Your Profile

Refresh the page — you should now see the Application Passwords section at the bottom of the profile page. From here you can generate a new Application Password to use with Claude / AI clients.

Note: Generate the password, then copy it and save it in a temporary file. You will need it later.


Connect AI To WordPress

Note: After creating the Application Password in WP admin (Users > Profile > Application Passwords), encode username:application-password to Base64 and pass it as a Basic Auth header to Claude.

Step 1 — Generate Base64 token

For Mac & Windows (Git Bash):

echo -n "admin:PASSWORD-HERE" | base64

For Windows (PowerShell):

[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("admin:PASSWORD-HERE"))

Tip: Replace PASSWORD-HERE with the Application Password generated from WP admin (keep the spaces or remove them — both work).


Step 2 — Register MCP Server with AI Tool

Note: Replace [YOUR_SITE_URL] and [YOUR_BASE_64_CODE_HERE] with your actual values.


1. Claude Code

claude mcp add --transport http wordpress-ai [YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server --header "Authorization: Basic [YOUR_BASE_64_CODE_HERE]"

Verify: claude mcp list Launch: claude


2. Gemini CLI

gemini mcp add --transport http -H "Authorization: Basic [YOUR_BASE_64_CODE_HERE]" wordpress-ai [YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server

Verify: gemini mcp list Launch: gemini


3. Codex CLI

Prerequisite:

npm install -g mcp-remote

Windows PowerShell (one-liner):

codex mcp remove wordpress-ai; @("[mcp_servers.wordpress-ai]", 'command = "npx"', 'args = ["mcp-remote", "[YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server", "--header", "Authorization: Basic [YOUR_BASE_64_CODE_HERE]"]') | Add-Content "$env:USERPROFILE\.codex\config.toml"; codex

Config file: ~/.codex/config.toml (Windows: C:\Users\<USERNAME>\.codex\config.toml)

Verify: codex mcp list Launch: codex


4. Antigravity

Config file: C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json

{
  "mcpServers": {
    "wordpress-ai": {
      "serverUrl": "http://[YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server",
      "headers": {
        "Authorization": "Basic [YOUR_BASE_64_CODE_HERE]"
      }
    }
  }
}

Note: Key name is serverUrl (not url, not httpUrl). After save: Close & Reopen Antigravity.


5. VS Code — Copilot Agent Mode

Config file: .vscode/mcp.json (project folder)

{
  "servers": {
    "wordpress-ai": {
      "type": "http",
      "url": "[YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server",
      "headers": {
        "Authorization": "Basic [YOUR_BASE_64_CODE_HERE]"
      }
    }
  }
}

6. Cursor

Config file: .cursor/mcp.json

{
  "mcpServers": {
    "wordpress-ai": {
      "url": "[YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server",
      "headers": {
        "Authorization": "Basic [YOUR_BASE_64_CODE_HERE]"
      }
    }
  }
}

7. Windsurf

Config file: ~/.codeium/windsurf/mcp_config.json (Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json)

{
  "mcpServers": {
    "wordpress-ai": {
      "serverUrl": "http://[YOUR_SITE_URL]/wp-json/mcp/mcp-adapter-default-server",
      "headers": {
        "Authorization": "Basic [YOUR_BASE_64_CODE_HERE]"
      }
    }
  }
}

Note: After save: Fully quit & reopen Windsurf.


Test Prompt

After connecting any AI tool, try this prompt:

What abilities does this WordPress site have? List all of them.

For Debugging

Note: If the connection fails, hit the endpoint manually with curl to inspect the response/headers.

curl.exe -v -H "Authorization: Basic BASE64-HERE" "http://localhost/wordpress-ai/wp-json/mcp/mcp-adapter-default-server"

Remove a broken/old MCP server registration from the local scope:

claude mcp remove wordpress -s local

YouTube

Session 1 — How to Generate AI Blog Posts Directly Inside WordPress 7.1 | wordpress ai automation https://youtu.be/f_iz1GlbrJ4

Session 2 — I Controlled WordPress With Just Text Commands | WordPress AI Automation https://youtu.be/QduuMc4cUt4

Session 3 — How to Automate a WordPress Blog Using ChatGPT and Make.com | Wordpress AI Automation https://youtu.be/VrJ6Z0zRDS0


New Section

Note: Add new notes / commands / troubleshooting steps here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment