Connect self-hosted MCP clients with optional OAuth - #203
Merged
Merged
Conversation
officialsuyogdixit
enabled auto-merge (squash)
October 2, 2026 02:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Self-hosted installations currently require a manually issued key for HTTP MCP. This adds optional OAuth at the installation's own
/mcp: a signed-in member chooses projects, approves read access and optionally replies, then returns to the client. Local stdio plugins and manual keys keep working;MCP_OAUTH_ENABLEDdefaults to false.The flow uses public-client registration, S256 PKCE, exact callbacks, issuer identification, resource-bound one-hour access tokens and rotating refresh credentials. Replayed codes/refresh credentials revoke their grant. Account revocation and password replacement invalidate connections. Existing server operation authorization still enforces current project permissions; OAuth cannot delegate owner administration, resolution, uploads or external GitHub writes. Migration 29 is additive and must be preserved during rollback.
Setup documentation includes discovery checks, Compose commands, client connection commands and a consent illustration. The consent screen shows the client-provided name and registered callback, with explicit callback recovery after an answer.
Validation: Node 24 full suite (520 passed, 39 environment-dependent skips, zero failures); four native PostgreSQL checks including concurrent code exchange and refresh replay; formatting, types, harness/docs, all builds, isolated application smoke and release checks. Actual Codex CLI OAuth login succeeded against a disposable loopback installation; the real MCP SDK read permitted feedback and denied extra project/write/admin access. Desktop/mobile consent inspected. HTTPS deployment and directory acceptance are separate, unverified gates; required CI remains the integration gate.
Closes #201.