S
Simple Wp MCP Adapter Oauth
作者 @IronLady
Adds OAuth 2.1 authorization server support for WordPress MCP Adapter
创建于 3/1/2026
更新于 about 7 hours ago
README
Repository documentation and setup instructions
Simple WP MCP Adapter OAuth
Adds OAuth 2.1 authorization server support for WordPress MCP Adapter.
Motivation
WordPress MCP Adapter does not natively cover AI clients that require strict OAuth 2.1 flows.
This plugin fills that gap by turning the existing WordPress site into the OAuth authorization server for MCP access, reusing:
- the existing WordPress login (
wp-login.php) for authentication - a WordPress-hosted consent flow for authorization decisions
Requirements
- WordPress 6.8+
- PHP 7.4+
- OpenSSL extension
- WordPress MCP Adapter plugin
Features
- OAuth authorize endpoint with consent flow
- OAuth token endpoint
- PKCE support for Authorization Code flow (
S256) - Dynamic client registration endpoint
- OAuth discovery endpoint
- JWKS endpoint
Install (development)
- Run
composer install. - Activate the plugin in WordPress Admin.
How OAuthTransport is used
By default, this plugin registers SimpleWpMcpAdapterOAuth\OAuthTransport as the MCP transport by filtering mcp_adapter_default_server_config.
If you want to register a server with OAuthTransport explicitly, you can do:
add_action(
'mcp_adapter_init',
function ( $adapter ) {
$adapter->create_server(
'alpha-server',
'alpha',
'mcp',
'Alpha MCP Server',
'Central MCP server for Alpha',
'1.0.0',
array( \SimpleWpMcpAdapterOAuth\OAuthTransport::class ),
null,
null,
array( 'alpha/get-posts' ),
array(),
array()
);
}
);
After activation, your MCP server exposes:
- OAuth protected resource metadata:
/.well-known/oauth-protected-resource - OAuth authorization server metadata:
/.well-known/oauth-authorization-server - OAuth token endpoint:
/token
All OAuth endpoints
Assuming:
- Namespace:
{namespace} - MCP route:
{server_route} - REST prefix:
/wp-json
Endpoints:
GET /wp-json/{namespace}/{server_route}(MCP server endpoint)GET /wp-json/{namespace}/{server_route}/.well-known/oauth-protected-resourceGET /wp-json/{namespace}/{server_route}/.well-known/oauth-authorization-serverGET /wp-json/{namespace}/{server_route}/.well-known/jwks.jsonPOST /wp-json/{namespace}/{server_route}/tokenPOST /wp-json/{namespace}/{server_route}/registerGET /wp-json/{namespace}/{server_route}/register/{client_id}PUT /wp-json/{namespace}/{server_route}/register/{client_id}DELETE /wp-json/{namespace}/{server_route}/register/{client_id}GET|POST /wp-admin/admin-post.php?action=simple_mcp_oauth_authorize
快速设置
此服务器的安装指南
安装命令 (包未发布)
git clone https://github.com/IronLady/simple-wp-mcp-adapter-oauth
手动安装: 请查看 README 获取详细的设置说明和所需的其他依赖项。
Cursor 配置 (mcp.json)
{
"mcpServers": {
"ironlady-simple-wp-mcp-adapter-oauth": {
"command": "git",
"args": [
"clone",
"https://github.com/IronLady/simple-wp-mcp-adapter-oauth"
]
}
}
}