By Fahad Murtaza · Published
MCP authentication methods compared: how to choose
MCP authentication methods compared: how to choose
MCP authentication is the part of connecting an AI client to a server that answers one question: who is calling, and what may they do? There is more than one way to answer it, and the right one depends on the client you use, who else connects, and how much damage a leaked credential could do.
Other pages explain the mechanics. MCP OAuth explained walks through the OAuth flow step by step, and MCP security for WordPress covers the risks. This page is the choice between them: a decision matrix for picking an MCP authentication method, with WordPress and WP MCP as the worked example.
The five options
Before comparing, here is what each option is.
- No network authentication (stdio). The client starts the server as a local process. The spec says stdio implementations should not follow the HTTP authorization flow and should take credentials from the environment instead.
- A static credential in a header. An API key, a bearer string or, for WordPress, an application password sent as
Authorization: Basic. The same secret goes with every request. - OAuth 2.1 with a pre-registered client. You create the client ID on the server side first, then paste it into the client. The user still approves in a browser.
- OAuth 2.1 with a client ID metadata document. The client’s ID is an
httpsURL that points to a small JSON file describing the client. No prior relationship is needed. - OAuth 2.1 with dynamic client registration. The client registers itself by calling the server’s registration endpoint, then continues as normal.
On top of any of these sits a sixth layer that is not an authentication method but changes the decision: limits on what an authenticated caller can do, such as read-only access, a scoped identity or an IP allowlist.
What the specification actually says
Three facts from the MCP authorization page (revision 2025-11-25) shape the matrix.
- Authorization is optional. When an HTTP server supports it, the spec says implementations should follow its OAuth-based flow.
- On registration, the spec says clients and authorization servers should support client ID metadata documents, may support dynamic client registration, and describes pre-registration as an option clients should support. It lists a priority order for clients: pre-registered details first, then metadata documents, then dynamic registration, then asking the user.
- Tokens go in the
Authorization: Bearerheader on every HTTP request, never in the URL query string, and a server must only accept tokens issued for itself.
The same page says dynamic registration is kept for backwards compatibility with earlier revisions. That matters if you read an older tutorial: the registration style it recommends may not be the one a current client tries first. Whatever the registration style, the user sign-in and the token work the same way.
The decision matrix
Read across the row that matches your situation.
| Your situation | Best fit | Why | Watch out for |
|---|---|---|---|
| One developer, Claude Code or Cursor, one site | Header credential (application password) | Works on a default install, no setup on the server | The secret lives in a config file |
| Local machine with WP-CLI and the site files | stdio bridge | No HTTP credential at all | It acts as the user you name, with that user’s full role |
| Claude custom connector | OAuth | The connector signs in with OAuth and cannot send a header | OAuth is off by default in WP MCP until the owner enables it |
| ChatGPT | OAuth | It cannot send an application password | Not fully tested with WP MCP, so start read-only |
| Several people or several agents on one site | OAuth plus per-client limits | Each client can be reviewed, lowered or blocked on its own | Needs an owner who reviews new clients |
| An agent that should only read | OAuth read-only, or a read-only scoped identity | Refused anything that changes the site | A header credential acts as the whole user |
You cannot edit wp-config.php or add a plugin |
Header credential | OAuth needs one line of config | The tradeoff is a standing secret |
| Agents run from fixed addresses | Any method plus an IP allowlist on the identity | A request from another address is refused before any tool runs | Weak for hosted clients whose addresses vary |
The pattern: pick the method your client can speak first. Then pick the narrowest access that still gets the work done. Only then compare security properties, because a method your client cannot use is not a real option.
Comparing the methods on the things that matter
| stdio | Header credential | OAuth | |
|---|---|---|---|
| Setup effort | Low, needs local WP-CLI | Lowest | Highest, one line of server config |
| Secret in a config file | No | Yes | No, tokens are issued after sign-in |
| Lifetime | Process lifetime | Until you revoke it | Short-lived access token plus refresh token |
| Limit access without changing the user | Not by method | No, it acts as the whole user | Yes, scope or read-only at approval |
| Revoke one client | Stop the process | Delete that password | Block or lower that client |
| Works from hosted apps | No | Only if the client can send a header | Yes, if the URL is public |
| Client support | Clients that run local commands | Clients that can set a header | Required by ChatGPT and the Claude custom connector |
Two rows deserve a note.
Limiting access. A header credential gives the caller whatever the WordPress user can do. If that user is an administrator, so is the agent. You can create a dedicated user with a lower role, which is the standard fix and works with any method. OAuth adds a second dial on top of the role: at approval you choose full access or read-only.
Hosted clients. A client that runs on the provider’s servers cannot start a process on your laptop and cannot reach localhost. That rules out stdio and, for clients that cannot send a header, leaves OAuth. This is why remote MCP servers and OAuth tend to appear together.
How this looks on a WordPress site
WP MCP serves its endpoint at https://your-site.com/wp-json/mcp/wpmcp-server, through the official WordPress MCP adapter that the plugin bundles. It supports each option above.
Application password. Create one on the plugin’s Connection screen or on your WordPress profile, then send it as a Basic header. The WordPress application passwords guide shows the steps, and the base64 of username:application-password goes after Basic:
POST /wp-json/mcp/wpmcp-server HTTP/1.1
Host: your-site.com
Authorization: Basic dXNlcjphYmNkIGVmZ2g=
Content-Type: application/json
stdio bridge. On a machine with WP-CLI and the site files, the client can run the server as a local process. --user is required, so you always name who it acts as:
wp mcp-stdio serve --user=editor-bot
OAuth. It ships with the plugin and is off by default. Turn it on in wp-config.php:
define( 'WPMCP_OAUTH_ENABLED', true );
or with the wpmcp_oauth_enabled filter from a plugin or mu-plugin. Once on, the dynamic registration and client metadata document styles both work. The approval screen offers full access or read-only, and a site owner can require approval for new clients, then approve or block each one. The Claude custom connectors guide uses this route end to end.
Limits on top. Scoped identities let you create a named agent with its own permissions and, with allowed_ips, pin it to the addresses it runs from. A request from anywhere else is refused before any tool runs. Prefer this for server-side agents with a fixed address and treat it as a second line of defence, not a replacement for a sign-in.
For which clients take which route, see which MCP clients work with WordPress, and the pages for Claude Code, Claude, Cursor and ChatGPT.
A short worked decision
Say you run a content team of four on one WordPress site. Two editors use Claude Code, one uses Cursor, and the managing editor wants to try ChatGPT.
- Claude Code and Cursor can send a header. Give each person their own WordPress user with the Editor role and their own application password, so a leak is one revoke away and the audit log shows who did what.
- ChatGPT needs OAuth, so the site owner enables it, approves the client, and connects it read-only first. The route is not fully tested with WP MCP yet, so the managing editor checks what it can see before widening anything.
- Nobody gets an administrator account for an agent. Page edits go through tools that take a snapshot before every supported write, so a bad edit is a rollback, not a restore from backup.
That is two methods on one site, chosen per client, and it is a normal outcome. You do not have to pick one for the whole team.
What authentication does not solve
Signing in tells the server who is calling. It does not tell it whether the request is wise.
- A signed-in agent can still be steered by text it reads, such as a comment or a form entry. That is prompt injection, covered in MCP security for WordPress.
- A narrow scope limits the damage but does not make an agent’s decisions correct.
- Every method fails the same way if the credential is stored carelessly: a token in a shared chat log is as bad as a password in a public repo.
So pair whichever method you choose with a dedicated low-privilege user, read-only access until you need more, a request log, and an undo path. WP MCP’s Audit Log records each call, and rollback-operation and rollback-session undo a single write or a whole agent session.
Checklist
- Name the client first and check which methods it supports.
- Use a dedicated WordPress user for every agent, with the lowest role that works.
- Prefer OAuth where the client supports it and you can edit
wp-config.php, and keep header credentials for single-developer tools. - Start read-only, then widen on purpose.
- Review and name every credential and client so you can revoke one without touching the rest.
- Use HTTPS only.
- Try the undo once on a draft before you trust it.
To see what the plugin offers, read the WordPress MCP server page. Pro adds deep page builder editing and more, and plans are on the pricing page.
Common questions
What authentication does MCP use?
The MCP specification makes authorization optional. For servers reached over HTTP it describes an OAuth 2.1 based flow. For local stdio servers it says to take credentials from the environment instead. In practice many HTTP servers also accept a static credential in a header, such as an API key or a WordPress application password.
Which MCP authentication method is the most secure?
OAuth with short-lived tokens, a narrow scope and a revocable client is stronger than a long-lived secret in a config file. It is not automatically safer in every setup: a misconfigured authorization server or an over-broad scope can undo the benefit. Pair any method with a low-privilege user and an undo path for writes.
Can I use an API key for MCP?
Yes, where the client can send a custom header and the server accepts one. The spec's OAuth flow is the standard route for HTTP, but static credentials are common. WP MCP accepts a WordPress application password as a Basic Authorization header.
Do I need OAuth to connect Claude to my WordPress site?
It depends on the route. Claude Code and the Claude Desktop config or bundle route can use an application password. The Claude custom connector signs in with OAuth, so it needs OAuth switched on at the site. With WP MCP that is off by default until you set WPMCP_OAUTH_ENABLED or the wpmcp_oauth_enabled filter.
Does ChatGPT work with an application password?
No. ChatGPT signs in to a custom MCP server with OAuth and cannot send an application password. With WP MCP it needs OAuth enabled first, and that route is not fully tested yet, so connect read-only and check it yourself.
Does a local stdio MCP server need authentication?
No network request crosses the boundary, so there is nothing to authenticate. The server runs with the access of the local process. For WP MCP's stdio bridge, wp mcp-stdio serve --user=<login>, you name the WordPress user the process acts as.