AI / MCP Setup
Events Manager 7.3 onwards can be controlled by an AI assistant. You can ask Claude, ChatGPT, Cursor, VS Code, Codex, or any other AI client that supports the Model Context Protocol (MCP) to list your events, check booking availability, create or update an event, manage bookings, and more β all in plain language, while WordPress keeps its normal permissions in place.
This page walks you through it. The first half is written for site owners who just want to point an AI app at their site. The second half goes into the technical details for developers who want to script, embed, or customise the connection.
See it in actionβ
What is MCP, and why does Events Manager use it?β
MCP is an open protocol that lets AI assistants talk to other tools. Events Manager publishes a set of "abilities" (list events, create an event, list bookings, etc.) through the WordPress Abilities API. A small WordPress plugin called the MCP Adapter turns those abilities into MCP tools that any compatible AI client can discover and use.
A few things worth knowing up front:
- You stay in control. Every request the AI makes runs through WordPress's normal capability checks. If the connected WordPress user can't delete events, the AI can't either.
- No passwords in URLs. Modern AI clients connect through your browser using OAuth, the same way you'd "Sign in with Google". Older clients can still use a WordPress Application Password as a fallback.
- You can turn it off. The AI / MCP setup box is opt-in. Nothing is exposed until you install and activate the MCP Adapter plugin.
Before you startβ
You need:
- WordPress 7.0 or later. WordPress 6.9 included an early version of the Abilities API, but 7.0 is the supported target. The setup box checks this for you.
- Events Manager with its REST and Abilities API active (this is the default).
- The WordPress MCP Adapter plugin. The setup box can install and activate this for you, or you can download the latest release from github.com/WordPress/mcp-adapter/releases.
- An AI client that supports MCP β for example Claude Desktop, Claude Code, Cursor, VS Code (with the agent extension), or ChatGPT custom connectors.
The simple flow: one URL, browser approvalβ
If you're using a modern AI client like Claude Desktop, this is the easiest path.
- In WordPress, open Events > Settings > General and find the AI / MCP Setup box.
- Follow the three steps in the box:
- WordPress 7.0+ β ready as long as you're on WP 7.0 or newer.
- MCP Adapter β click Install MCP Adapter, then Activate MCP Adapter.
- MCP Server URL β once steps 1 and 2 are ready, a URL like this appears:
https://your-site.com/wp-json/mcp/events-manager
- Copy that URL.
- In your AI client, add a new MCP server and paste the URL. The client will open a browser tab, send you to your WordPress site, and ask you to approve the connection while logged in as the WordPress user you want the AI to act as.
- Approve the connection. The AI client will now be able to call Events Manager.
That's it. There's no need to copy passwords or fiddle with JSON. You can revoke the connection at any time from WordPress by removing the OAuth grant.
Live sites need HTTPS. Most AI clients refuse to connect to plain
http://for anything other than a clearly local site (.lan,.local,.test, orlocalhost). If your live site doesn't have HTTPS, set that up first.
Choosing the right WordPress user for the AIβ
The AI acts as a specific WordPress user. We strongly recommend you create a dedicated user for each AI client instead of connecting your administrator account.
The setup box suggests several "recipes" depending on what you want the AI to do:
| What the AI should do | Capabilities to grant |
|---|---|
| Answer questions about public events, locations, categories, tags, and availability | read |
| Create and update events and locations | read, edit_events, edit_locations, publish_events |
| Approve, reject, or change bookings | read, manage_bookings, optionally manage_others_bookings |
| Delete or trash events and locations | read, plus the matching delete_* capabilities β only for trusted internal agents |
You can assign these with a role editor plugin, custom code, or WP-CLI. The smallest set of capabilities that lets the AI do its job is always the safest choice.
Connecting common AI clientsβ
The simple flow above works for any client that supports remote MCP server URLs and OAuth. The instructions below show what that looks like in each app.
Claude Desktop, Claude Code, Cursor, VS Codeβ
Open the app's MCP settings panel and add a new server. Choose "remote URL" (the exact label varies by app), paste the MCP Server URL from the Events Manager setup box, and approve the connection in your browser when prompted.
After it's connected, ask the assistant something like "List my upcoming events" or "What's the booking availability for the next workshop?". The client will discover the Events Manager abilities and use them as tools.
ChatGPT custom connectorsβ
ChatGPT needs a publicly reachable HTTPS URL β a local .lan site won't work. Use the same MCP Server URL from the setup box on a live HTTPS site. Workspace admins may need to enable custom apps/connectors before users can add them.
Older clients without OAuth supportβ
Some AI clients (and command-line tools) don't yet support browser OAuth. In that case, use the Advanced configuration below with a WordPress Application Password.
A note on local developmentβ
If you're running Events Manager on a .lan, .local, .test, or localhost site, two things are different:
- Application Passwords are normally HTTPS-only. To enable them on a local HTTP site, add this to
wp-config.php:define( 'WP_ENVIRONMENT_TYPE', 'local' ); - HTTPS tunnels. If you need a reachable HTTPS URL for an AI client that can't reach your machine, define
EM_OAUTH_TUNNELinwp-config.phpwith your tunnel URL (for example an ngrok URL). Events Manager will use that tunnel URL in the OAuth and MCP metadata it publishes.
For local CLI work, the WP-CLI STDIO transport documented below avoids HTTP entirely.
Advanced configuration
The rest of this page is aimed at developers, integrators, and anyone using an AI client that needs explicit MCP server JSON.
Application Passwords (fallback authentication)β
If your AI client doesn't support OAuth, create an Application Password for it.
- In WordPress admin, go to Users > Profile > Application Passwords.
- Add a new password named something like
MCP Agentand copy the generated value. - Use that password (along with the username) in the JSON examples below.
Treat Application Passwords like passwords. Copy them once into the AI client's secure credential store and revoke them when no longer needed.
Client configuration examplesβ
These examples use the Automattic MCP WordPress Remote bridge, which connects an AI client over STDIO to a remote WordPress MCP Adapter endpoint over HTTP.
Claude Desktopβ
{
"mcpServers": {
"events-manager-local": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "http://wp.lan/wp-json/mcp/events-manager",
"WP_API_USERNAME": "mcp-agent",
"WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
Restart Claude Desktop after editing the config. You can check connected tools from the connectors/tools UI.
Codex CLI and Codex IDEβ
Add this to ~/.codex/config.toml:
[mcp_servers.events-manager-local]
command = "npx"
args = ["-y", "@automattic/mcp-wordpress-remote@latest"]
env = { WP_API_URL = "http://wp.lan/wp-json/mcp/events-manager", WP_API_USERNAME = "mcp-agent", WP_API_PASSWORD = "xxxx xxxx xxxx xxxx xxxx xxxx" }
Then verify:
codex mcp list
Cursorβ
Add this to ~/.cursor/mcp.json for a global server:
{
"mcpServers": {
"events-manager-local": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "http://wp.lan/wp-json/mcp/events-manager",
"WP_API_USERNAME": "mcp-agent",
"WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
Restart Cursor and confirm the server in the MCP tools view.
VS Codeβ
VS Code uses a top-level servers object. Add this to .vscode/mcp.json inside the project:
{
"servers": {
"events-manager-local": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "http://wp.lan/wp-json/mcp/events-manager",
"WP_API_USERNAME": "mcp-agent",
"WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
Enable the server in the tools picker when using agent mode.
Live site (HTTPS)β
The shape is the same as the localhost examples β just use an HTTPS URL:
{
"mcpServers": {
"events-manager": {
"command": "npx",
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
"env": {
"WP_API_URL": "https://example.com/wp-json/mcp/events-manager",
"WP_API_USERNAME": "mcp-agent",
"WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
}
}
}
}
Application Passwords should be used only over HTTPS on live sites.
Local WP-CLI STDIO transportβ
For local development, the WP-CLI STDIO transport avoids Application Passwords and HTTP issues entirely. Events Manager registers a dedicated MCP server named events-manager:
{
"mcpServers": {
"events-manager-local": {
"command": "wp",
"args": [
"--path=/path/to/wordpress",
"mcp-adapter",
"serve",
"--server=events-manager",
"--user=admin"
]
}
}
}
You can test discovery from the terminal β every events-manager/* ability is registered as a first-class MCP tool, so you can call them directly:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| wp --path=/path/to/wordpress mcp-adapter serve --user=admin --server=events-manager
Ability referenceβ
Every ability is registered with meta.show_in_rest: true and meta.mcp.public: true. Each ability enforces the same WordPress capability checks as its corresponding REST endpoint.
Eventsβ
events-manager/list-eventsβ list eventsevents-manager/get-eventβ get one eventevents-manager/get-event-availabilityβ get booking availability for one eventevents-manager/get-booking-requirementsβ describe the exact fields, payload locations, payment options, and a ready-to-submit example payload needed to create a booking for one eventevents-manager/list-event-ticketsβ list tickets for one eventevents-manager/create-eventβ create an eventevents-manager/update-eventβ update an eventevents-manager/delete-eventβ delete or trash an eventevents-manager/create-event-ticketβ create a ticket on an eventevents-manager/update-ticketβ update a ticketevents-manager/delete-ticketβ delete a ticket (only if it has no bookings)
Locationsβ
events-manager/list-locationsβ list locationsevents-manager/get-locationβ get one locationevents-manager/list-location-countriesβ list countries (full ISO list by default;only_available: truenarrows to countries with at least one stored location)events-manager/list-location-regionsβ list distinct region names (optionally filtered bycountry)events-manager/list-location-statesβ list distinct state/province names (optionally filtered bycountryand/orregion)events-manager/list-location-townsβ list distinct town/city names (optionally filtered bycountry,region, and/orstate)events-manager/create-locationβ create a locationevents-manager/update-locationβ update a locationevents-manager/delete-locationβ delete or trash a location
Bookings and taxonomyβ
events-manager/list-bookingsβ list visible bookingsevents-manager/get-bookingβ get one bookingevents-manager/create-bookingβ create a bookingevents-manager/update-bookingβ update a bookingevents-manager/set-booking-statusβ approve, reject, or cancel a bookingevents-manager/delete-bookingβ delete a bookingevents-manager/list-categoriesβ list event categoriesevents-manager/get-category/create-category/update-category/delete-categoryevents-manager/list-tagsβ list event tagsevents-manager/get-tag/create-tag/update-tag/delete-tag
Mediaβ
events-manager/upload-mediaβ upload an image to the WordPress media library. Polymorphic input: passsource_urlto sideload a public image,content_base64+filenamefor inline upload, oridto look up an existing attachment. Returns{ id, url, mime_type, title, alt_text, width, height }. The returnedidcan be passed straight tofeatured_imageon events or locations, or toimageon categories or tags.
Built-in OAuth serverβ
Events Manager bundles the wp-oauth-app-passwords library (under classes/lib/) to provide OAuth 2.0 Authorization Code + PKCE. The same library powers the bbPress API plugin, so any site running both renders one identical AI / MCP setup screen and shares one auth implementation.
The design has one twist worth knowing about: the access token an OAuth client receives IS a WordPress Application Password, encoded as base64("login:application_password"). That means:
- No custom token storage. WordPress core's existing Application Password validator runs on every request.
- Visible and revocable. Each connected client appears in Users β Profile β Application Passwords with the name the user chose ("Claude", "Cursor", β¦), with last-used / IP tracking. Revoke it there and the OAuth grant goes with it.
- Persistent. Refresh rotates the Application Password β deletes the old one, creates a new one under the same display name. No 1-hour TTL reconnect loop.
Published endpoints:
| Path | Purpose |
|---|---|
GET /.well-known/oauth-authorization-server | RFC 8414 server metadata |
GET /.well-known/oauth-protected-resource | RFC 9728 resource metadata |
GET / POST /wp-json/oauth/v1/authorize | Authorization code + branded consent screen |
POST /wp-json/oauth/v1/token | authorization_code and refresh_token grants |
POST /wp-json/oauth/v1/revoke | RFC 7009 token revocation |
POST /wp-json/oauth/v1/register | RFC 7591 dynamic client registration |
Local-dev tunnels: set MCP_OAUTH_TUNNEL (or the legacy EM_OAUTH_TUNNEL β kept for backwards compatibility) in wp-config.php to the public HTTPS URL of an ngrok-style tunnel, and the library rewrites every advertised OAuth/MCP URL to use it.
Lifetimes are filterable:
add_filter( 'pixelite_oauth_access_token_ttl', fn() => 8 * HOUR_IN_SECONDS ); // default 8 hours
add_filter( 'pixelite_oauth_refresh_token_ttl', fn() => 30 * DAY_IN_SECONDS ); // default 30 days
Filtersβ
Site owners and developers can fine-tune what's exposed:
em_api_ability_mcp_publicβ disable MCP exposure for all Events Manager abilities, or filter destructive ones out:add_filter( 'em_api_ability_mcp_public', function( $public, $name, $annotations ) {return empty( $annotations['destructive'] );}, 10, 3 );pixelite_oauth_access_token_ttl/pixelite_oauth_refresh_token_ttlβ adjust OAuth token lifetimes (default 8 hours / 30 days).pixelite_oauth_mcp_public_urlβ rewrite the MCP URL advertised to clients. Handy when a reverse proxy presents a different hostname than WordPress sees internally.pixelite_oauth_mcp_adapter_zipβ override where the MCP Adapter ZIP is fetched from when an admin installs it via the setup box (default: GitHub releases).pixelite_oauth_default_scopeβ change the default OAuth scope label (defaultwp:api).pixelite_oauth_consent_account_noteβ render a per-host note above the granted scopes on the consent screen.
Readiness diagnosticsβ
To verify the setup by hand:
| Check | What it verifies |
|---|---|
| Abilities API | function_exists( 'wp_register_ability' ) β WordPress 7.0+ exposes the Abilities API. |
| MCP Adapter | The WordPress/mcp-adapter plugin is installed AND active. |
| OAuth server | class_exists( '\Pixelite\OAuth_App_Passwords\Server' ) β bundled library loaded successfully. |
| Application Passwords | wp_is_application_passwords_available() β gated by HTTPS or WP_ENVIRONMENT_TYPE=local. |
| Site transport | HTTPS or a local .lan / .local / .test host. Remote AI clients usually require HTTPS. |
| REST API base | rest_url() returns the site's REST root. |
| Discovery probe | GET /.well-known/oauth-authorization-server returns 200 and JSON metadata. The setup box self-diagnoses common subdirectory-install rewrite issues. |
Security checklistβ
- Use a dedicated MCP user, not a shared administrator account.
- Grant the smallest set of Events Manager capabilities needed for the workflow.
- Keep delete abilities enabled only for trusted clients and users.
- Revoke connections from Users β Profile β Application Passwords when access is no longer needed β the OAuth refresh grant is cleaned up automatically.
- Review server logs for MCP activity after enabling write operations.
Useful endpointsβ
- Abilities REST discovery:
/wp-json/wp-abilities/v1 - Events Manager MCP server:
/wp-json/mcp/events-manager - Events Manager REST API:
/wp-json/events-manager/v1 - OAuth metadata:
/.well-known/oauth-authorization-server