Skip to content

Generate an API Key

import { Tabs, TabItem } from ‘@astrojs/starlight/components’;

API keys authenticate AI agents to your site. Each key can be scoped to a role (admin, editor, designer, author) to limit what agents can do.

  1. Go to WP Admin → MCPWP → Setup
  2. Click Generate API Key
  3. Copy the key — it’s shown once
Terminal window
docker exec wp-test-wordpress-1 bash -c 'php -r "
require_once \"/var/www/html/wp-load.php\";
\$key = \"mcpwp_\" . bin2hex(random_bytes(24));
update_option(\"mcpwp_api_key\", wp_hash_password(\$key));
echo \$key;
"'

Or on a standard install:

Terminal window
wp eval '
$key = "mcpwp_" . bin2hex(random_bytes(24));
update_option("mcpwp_api_key", wp_hash_password($key));
echo $key;
'
RoleWhat agents can do
adminEverything — full site control
editorContent + Elementor + media + SEO (~99 tools)
designerElementor + Gutenberg + media + site CSS (~82 tools)
authorContent + media + taxonomy (~40 tools)

Use editor or designer for agency client installs. Reserve admin for your own AI sessions.

Terminal window
curl -s https://YOUR-SITE.com/wp-json/mcpwp/v1/site-info \
-H "X-API-Key: mcpwp_YOUR_KEY" | jq .name

→ Next: Connect your AI client