GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(desktop-commander): OAuth 2.1 front door for hosted MCP clients (#13404) by dezren39 · Pull Request #13488 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

For #13404: hosted MCP clients (Claude, ChatGPT) connect server-side and cannot pass the Cloudflare Access login at /mcp — they got a 302 to the Access login on every path and found no OAuth discovery. This PR gives the Worker an OAuth 2.1 authorization-server front (src/oauth.ts):

  • Discovery — /.well-known/oauth-protected-resource (both shapes) + /.well-known/oauth-authorization-server, public.
  • Registration — POST /register (RFC 7591), public clients, https / loopback-http redirect URIs, clients stored in the new OAUTH_KV namespace (desktop-commander-oauth, created in the account).
  • Authorize — GET/POST /authorize renders the owner's approval page. It stays behind Access (app re-scoped to /authorize in a separate recorded step) and the Worker verifies the Access JWT itself: RS256 against the team JWKS, audience of the authorize app, owner email. Approval is a CSRF-nonce form POST issuing a single-use, PKCE-bound code (10 min).
  • Token — POST /token: authorization-code exchange (PKCE S256; code consumed on any attempt) → opaque access token (1 h) + rotating refresh token (30 d); codes/tokens stored in KV under their SHA-256.
  • /mcp gate — live OAuth Bearer, or the new MACHINE_BEARER Worker secret (constant-time compare); otherwise 401 with the resource_metadata pointer. Bridge door + proxy core unchanged.
  • Pipeline — publish workflow stages MACHINE_BEARER (GitHub environment secret, set; canonical value in fleet secrets as desktop-commander.machine-bearer) alongside the bridge pair. wrangler.toml / cloudflare.config.ts gain the KV binding and ACCESS_AUD / ACCESS_TEAM_DOMAIN vars in step.

Verification: npm test 21/21 (proxy contract re-pointed at the new gate; OAuth suite uses a real in-test RSA keypair as the Access team key — discovery, DCR validation, assertion rejection, plain-PKCE rejection, full approve→exchange→call flow, code single-use, wrong-verifier burn, refresh rotation, deny redirect) and npm run typecheck clean, both on the laptop.


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dezren39
feat(desktop-commander): OAuth 2.1 front door for hosted MCP clients (#…
e1444ca
…13404)

Claude and ChatGPT connect to the MCP endpoint from their own
servers and cannot pass a Cloudflare Access login at /mcp — every
path on commander.security.cab answered them with a 302 to the
Access login, and there was no OAuth discovery to find. The Worker
now runs an OAuth 2.1 authorization server (src/oauth.ts):

- Public discovery: /.well-known/oauth-protected-resource (both
  shapes) and /.well-known/oauth-authorization-server.
- POST /register: dynamic client registration, public clients,
  https / loopback-http redirect URIs, stored in the new OAUTH_KV
  namespace (desktop-commander-oauth).
- GET/POST /authorize: the approval page — the one path that stays
  behind Access (the app is re-scoped to /authorize separately).
  The Worker verifies the Access JWT itself (RS256 vs the team
  JWKS, audience, owner email) before rendering; approval is a
  CSRF-nonce form POST issuing a single-use PKCE-bound code.
- POST /token: authorization-code exchange (PKCE S256; the code is
  consumed on any exchange attempt) plus rotating refresh tokens.
  Codes and tokens are stored in KV under their SHA-256.
- /mcp takes a live OAuth Bearer or the new MACHINE_BEARER secret;
  anything else gets a 401 with the resource_metadata pointer.
  The bridge door and the proxy core are unchanged.

The publish workflow now also stages MACHINE_BEARER (GitHub
environment secret; canonical value in fleet secrets as
desktop-commander.machine-bearer) into the version secrets file.
wrangler.toml and cloudflare.config.ts gain the OAUTH_KV binding
and the ACCESS_AUD / ACCESS_TEAM_DOMAIN vars, kept in step.

Tests: 21 green (proxy contract re-pointed at the new gate, plus an
OAuth suite with a real in-test RSA keypair standing in for the
Access team key: discovery, DCR validation, assertion rejection,
plain-PKCE rejection, full approve-exchange-call flow, code
single-use, wrong-verifier burn, refresh rotation, deny redirect).
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62ff140d-57a0-4249-8bd6-4ef1fbc17f8f
Commits

Reviewing files that changed from the base of the PR and between 2d65edd and e1444ca.

Files selected for processing: 9

  • .github/workflows/desktop-commander-worker-publish.yml
  • pkgs/desktop-commander/worker/README.md
  • pkgs/desktop-commander/worker/cloudflare.config.ts
  • pkgs/desktop-commander/worker/src/index.ts
  • pkgs/desktop-commander/worker/src/oauth.ts
  • pkgs/desktop-commander/worker/test/memory-kv.ts
  • pkgs/desktop-commander/worker/test/oauth.test.ts
  • pkgs/desktop-commander/worker/test/proxy.test.ts
  • pkgs/desktop-commander/worker/wrangler.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:09:33.888463Z e1444ca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit 4421467 into main Nov 23, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the feat/dc-oauth-13404 branch November 23, 2026 17:08
This was referenced Nov 23, 2026
Self-hosted Desktop Commander MCP endpoint (OAuth 2.1 front door, laptop bridge) #13404
Open
mcpx: public endpoint at mcpx.security.cab with OAuth/Google-SSO front door and machine bearer #13657
Open
story: our own OIDC/SAML/SSO identity provider #13658
Open
Project Management book — fifth house book, coverage audit, sidelines, Space #13900
Closed
Fleet book disagreement register (PM book programme #13900) #13964
Closed
@dezren39 dezren39 added the audit:partial PR partially implemented; gap filed label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:partial PR partially implemented; gap filed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.