Sample alert How it works Coverage PENTEST METHODOLOGY DOCS PRICING FAQ MCP CONTACT LOG IN SCAN MY APP →

WordPress MCP Adapter gives agents too much access: fix it

FIX / WORDPRESS MCP ADAPTER / 9 MIN READ

The WordPress MCP Adapter exposes every ability that you mark public to every agent that connects. List the public abilities. Connect each agent with its own low-role user and application password. Revoke passwords that you no longer use. An agent that connects with an admin password can do all that an admin can do.

This guide shows how to find what your site exposes and how to set up a safe account for an agent. It also shows how to test the result.

What does the MCP Adapter expose?

The MCP Adapter is an official WordPress project. It turns WordPress abilities into MCP tools, resources and prompts. An AI client, such as Claude, can then call them.

An ability is one unit of work that code registers with the Abilities API, for example “get site info” or “create a post”. The Abilities API documentation shows that each ability has an execute callback and a permission_callback. The permission callback decides who can run it.

The adapter documentation states these facts:

  • Abilities are private by default. To expose one, set meta.public or meta.mcp.public to true.
  • The default server has the HTTP path /wp-json/mcp/mcp-adapter-default-server.
  • The default server shows three meta-tools: mcp-adapter/discover-abilities, mcp-adapter/get-ability-info and mcp-adapter/execute-ability.
  • Without a custom permission callback, the server only checks that the user is logged in. The documentation calls this a secure default that requires authentication.
  • The adapter supports HTTP and STDIO transports.

The last two points matter most. A login is not the same as a right to act. If the server only checks the login, every logged-in user, even a subscriber, can reach the server. The permission_callback of each ability must then refuse users who must not run it.

AI agents add a second risk. An agent reads text from pages, posts and comments. A hostile text can tell the agent to call a tool. Any tool that the agent can call is a tool that a hostile text can call. The MCP server guide explains this risk for servers that you did not write.

Caution: The version of the adapter and the Abilities API changes the names of hooks and settings. Read the README of the version that you install. This guide uses only the behavior that the current documentation states.

How do I list the abilities that my site exposes?

List all abilities, then mark which ones are public. Core and plugins both register abilities.

  1. Open a shell in the WordPress folder on a test copy of the site.
  2. Run this WP-CLI command.
wp eval '
foreach ( wp_get_abilities() as $ability ) {
	$meta   = $ability->get_meta();
	$public = ! empty( $meta["public"] ) || ! empty( $meta["mcp"]["public"] );
	echo $ability->get_name(), " ", $public ? "PUBLIC" : "private", "\n";
}'
  1. Read the list. Write down each name that has the mark PUBLIC.
  2. For each public ability, find its code. Search the plugin folders for the ability name.
grep -rn "my-plugin/get-site-info" wp-content/plugins wp-content/mu-plugins wp-content/themes
  1. Read the permission_callback of each one. Use this table to rate it.
Callback Rating
current_user_can( 'manage_options' ) Strict. Only admins pass.
current_user_can( 'read' ) Weak. Every user passes.
is_user_logged_in() Weak. Every user passes.
__return_true Open. Every caller passes.
No callback Check the documentation for your version.
  1. Ask for each public ability: what does it read, and what does it change? An ability that deletes posts, edits users or runs a query is a high risk.

If the function wp_get_abilities() does not exist on your site, the Abilities API is not active. Then the adapter has nothing to expose from core. Plugins can still bring their own copy, so check the plugin list too.

You can also test from outside. Send a request with no login to the MCP path and expect a refusal.

curl -i -X POST https://your-site.example/wp-json/mcp/mcp-adapter-default-server \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

The correct answer is a 401 or 403 status. A list of tools means that the endpoint is open. Close it first. Then read the guide on MCP servers on the open internet.

How do I make an ability safe?

Make each public ability do the smallest job, and make its permission callback strict.

  1. Keep the ability private if an agent does not need it. Do not set the public flag.
  2. Use a capability that fits the action. Do not use read for a write action.
  3. Check the object. If the ability edits a post, check current_user_can( 'edit_post', $post_id ).
  4. Validate the input. Declare the input schema and the types of its fields.
  5. Return only what the agent needs. Do not return user emails, keys or settings that the task does not need.

This is an example of a read-only ability that is safe to expose:

add_action( 'wp_abilities_api_init', 'myplugin_register_abilities' );

function myplugin_register_abilities() {
	wp_register_ability(
		'myplugin/get-site-info',
		array(
			'label'               => 'Get site info',
			'description'         => 'Returns the site name and the site description.',
			'category'            => 'site-information',
			'execute_callback'    => 'myplugin_get_site_info',
			'permission_callback' => function () {
				return current_user_can( 'read' );
			},
			'meta'                => array(
				'show_in_rest' => true,
				'mcp'          => array( 'public' => true ),
			),
		)
	);
}

function myplugin_get_site_info() {
	return array(
		'name'        => get_bloginfo( 'name' ),
		'description' => get_bloginfo( 'description' ),
	);
}

The ability needs a registered category. The Abilities API documentation says to register categories on the wp_abilities_api_categories_init hook before you register abilities. The example above uses a category that you must register.

A write ability needs a stronger callback:

'permission_callback' => function () {
	return current_user_can( 'edit_posts' );
},

Use manage_options or delete_users only for abilities that must work for administrators. Better, do not expose such abilities to an agent at all.

You can also set a server-wide permission callback in the adapter. The transport permissions guide states that the callback returns true, false or a WP_Error. Its admin-only example is current_user_can( 'manage_options' ). If the callback throws an error, the server falls back to the login check. Use this server-wide gate to add a second layer. Do not use it as the only layer.

How do I create a safe account for an agent?

Make one dedicated user for each agent. Give the user the smallest role that works. Never use the application password of an admin.

An application password is a WordPress feature to give an app access through the REST API without the main password. The integration guide describes it. The password has the same capabilities as the user that owns it. It does not have its own scope. This is why the user must have a low role.

  1. Create the user. This example uses the subscriber role.
wp user create claude-reader claude-reader@example.com --role=subscriber --user_pass="$(openssl rand -base64 32)"
  1. Create an application password for the user. The --porcelain flag prints only the password.
wp user application-password create claude-reader "claude-code-laptop" --porcelain
  1. Save the password in a password manager. WordPress shows it one time.
  2. Test what the user can do. Do not trust the role name. Call each public ability with that user.
  3. Add the server to your client. This example is for Claude Code. It sends the user name and the password as HTTP Basic authentication.
claude mcp add --transport http wordpress \
  https://your-site.example/wp-json/mcp/mcp-adapter-default-server \
  --header "Authorization: Basic $(printf '%s' 'claude-reader:APPLICATION_PASSWORD' | base64)"

The syntax of other clients differs. The adapter documentation also describes a STDIO connection through WP-CLI. A STDIO connection runs on the machine that hosts the site, so it does not send a password over the network.

Warning: Do not paste an application password into a file that goes to Git. Keep it in an environment variable or in the secret store of your client.

Application passwords need HTTPS on a live site. Do not allow HTTP for them. If you do not use application passwords on a site, you can turn them off with the wp_is_application_passwords_available filter.

What about a role that does not exist yet?

If the subscriber role is too weak or too strong, make a custom role with only the needed capabilities.

add_action( 'init', function () {
	add_role(
		'ai_reader',
		'AI reader',
		array(
			'read'                 => true,
			'read_private_posts'   => false,
		)
	);
} );

Run add_role() one time, for example in a plugin activation hook. WordPress stores roles in the database. Then test again.

How do I use one account per agent?

Use a separate user for each agent and each machine. Name the user for the agent. This gives you three benefits.

  • Logs separate the agents. Each action has a user ID. You can see which agent did it.
  • You can revoke one agent. The other agents keep their access.
  • Each agent can have its own role. A reading agent and a writing agent do not share rights.

Use a separate application password for each device. The user profile screen shows the name, the creation date, the last use and the last IP address of each password. Name each password with the device and the date, for example claude-code-laptop-2026-11.

How do I revoke passwords that I do not use?

Review all application passwords on a schedule. Remove each one that you do not know or no longer need.

  1. List the passwords of a user.
wp user application-password list claude-reader --fields=uuid,name,created,last_used,last_ip
  1. Delete one password by its UUID.
wp user application-password delete claude-reader UUID_FROM_THE_LIST
  1. Delete all passwords of a user.
wp user application-password delete claude-reader --all
  1. List the users that have the administrator role. Remove each admin that is not a person.
wp user list --role=administrator --fields=ID,user_login,user_email
  1. Check passwords that have no last use date or a very old one. Delete them.

If an agent leaked a password, revoke it at once. Then read your logs. Look for requests to /wp-json/mcp/ and to /wp-json/wp/v2/ from the user, and for new posts, new users and changed settings.

How do I stop this problem in the future?

  1. Review each plugin that registers abilities. A plugin update can add a public ability.
  2. Keep a list of public abilities. Compare it with the output of the WP-CLI command after each update.
  3. Give each agent the smallest role. Increase the role only after a test shows a need.
  4. Use a test copy of the site for new agents. Do not connect a new agent to the live site first.
  5. Put the user ID in your logs. Use a log plugin or the logs of your host.
  6. Treat all text that an agent reads as hostile. Do not let one agent read comments and also edit settings. See the pattern guide on open MCP servers and tool injection.
  7. Scan the live site from outside after each release.

When should I get help?

Get help in these cases:

  • You connected an admin application password to an agent and you do not know what the agent did.
  • The MCP endpoint answered without a login.
  • You find a public ability that changes users, files or settings.
  • You find new admin users, new plugins or changed files that you did not make.

Revoke all application passwords first. Then ask a WordPress security engineer to review your abilities and your logs.

Common questions

Is an ability that I do not mark public safe?
Per the adapter documentation, abilities are private by default. The adapter does not expose them to MCP clients until you set the public flag. Check each ability in your plugins, because a plugin author can set the flag.
Can I connect an agent with my admin application password?
Do not do this. An application password has the same rights as its user. An agent with an admin password can do everything that an admin can do.
Which role must the agent user have?
Use the smallest role that works for the task. For read-only work, a subscriber or a custom role with read access is enough for many abilities. Test each ability with that user.
Does the MCP endpoint work without a login?
By default the adapter requires a logged-in user. A site owner can change the permission callback. Test the endpoint with curl and no credentials to confirm.
How do I stop an agent at once?
Revoke its application password in the user profile or with WP-CLI. The agent loses access on the next request. Then read the logs for what it did.

Test your wordpress API

A VibeEval scan tests the live site from outside. It checks whether the MCP endpoint and the REST API answer without a login, and which data they return.

14-day free trial · Cancel anytime

SCAN YOUR APP →