Skip to content

OAuth connections and plugin-registered skills (0.4.0) - #4

Merged
wpgaurav merged 4 commits into
mainfrom
oauth-and-plugin-skills
Oct 8, 2026
Merged

wpgaurav merged 4 commits into
mainfrom
oauth-and-plugin-skills

Conversation

@wpgaurav

@wpgaurav wpgaurav commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Opt-in OAuth 2.1 for the MCP endpoint per the MCP authorization spec: RFC 9728 protected resource metadata and RFC 8414 server metadata (REST and /.well-known), RFC 7591 registration for public clients, PKCE S256 codes approved on a wp-admin consent screen where the administrator picks tool groups, one-hour bearer tokens, rotating refresh tokens with reuse detection, RFC 7009 revocation, and a 401 WWW-Authenticate pointer to discovery.
  • Tokens are stored as HMAC hashes in the approving user's meta, authenticate only the MCP route, narrow tool groups like per-password limits, show as via: oauth with the client name in audit history, and are listed with revoke buttons in Tools > Site Agent. Uninstall removes clients and grants.
  • site_agent_skills filter: plugins add read-only skills to list-skills and get-skill without replacing bundled builder skills.
  • Version 0.4.0, companion 0.4.0, readme, README, companion connection notes and POT updated.

Verification

  • 81 PHPUnit tests (8 new OAuth tests, 1 new skills test). One existing WP-CLI test fails locally under PHP 8.5 because WP-CLI 2.12 prints deprecations; unrelated.
  • 18-step real-HTTP OAuth run on a disposable site: discovery, registration, consent (deny and allow), PKCE token exchange, MCP initialize/tools/list/execute-php with group limits, bearer refused on other routes, refresh rotation, reuse refusal, revocation, audit.
  • phpcs, composer lint, skill sync check, plugin and companion builds.

🤖 Generated with Claude Code

wpgaurav and others added 4 commits October 8, 2026 06:40
Opt-in OAuth 2.1 for the MCP endpoint, following the MCP authorization
specification: protected resource and authorization server metadata over
REST and /.well-known, RFC 7591 registration for public clients, PKCE S256
authorization codes approved on a wp-admin consent screen where the
administrator picks tool groups, one-hour bearer tokens and rotating
refresh tokens stored as HMAC hashes, refresh-token reuse detection,
RFC 7009 revocation, and a 401 WWW-Authenticate header that points
clients to discovery. Bearer tokens authenticate only the MCP route,
narrow tool groups like per-password limits, appear in audit history as
via oauth, and are listed with revoke buttons in Tools > Site Agent.

The site_agent_skills filter lets plugins add read-only skills to
list-skills and get-skill without replacing bundled builder skills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…other plugins

Rank Math's bundled MCP OAuth server serves the site-root
/.well-known/oauth-authorization-server and oauth-protected-resource
documents with the home URL as issuer. A site has one root issuer, so
Site Agent now uses .../wp-json/site-agent/v1/oauth and answers only the
path-inserted and OpenID Connect forms for its own issuer and resource.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Registration is an open endpoint, and every registration and code
exchange rewrote one shared clients option, so concurrent writes could
drop a client in the middle of its authorization. Each client is now its
own non-autoloaded option, added with add_option; stale clients are
pruned only when the registration limit is reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wpgaurav
wpgaurav merged commit a95c093 into main Oct 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant