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(mcp): add OpenWork-managed local OAuth gateway by reachjalil · Pull Request #3652 · different-ai/openwork

Conversation

@reachjalil

@reachjalil reachjalil commented Aug 10, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Summary

  • add an opt-in OpenWork-managed OAuth path for custom remote MCPs in local desktop workspaces
  • reuse the provider-neutral enterprise MCP client for discovery, DCR or pre-registered clients, PKCE, token exchange, refresh, and authenticated tool verification
  • expose provider tools to the bundled OpenCode engine through a scoped loopback MCP gateway with oauth: false, so OpenCode never receives provider OAuth credentials
  • persist OAuth state in an AES-256-GCM encrypted local vault whose key is held by desktop OS secure storage or an explicitly configured standalone-server secret
  • handle reconnect, logout, enable/disable, and removal through the existing MCP settings surface
  • guard managed-provider egress with public-HTTPS checks, private/reserved and unsafe IANA special-use address blocking, DNS answers bound to the socket connection, and redirect revalidation
  • restrict Electron external navigation to HTTP(S) URLs before opening provider authorization pages

Why

Some MCP providers can complete OAuth through OpenWork's enterprise MCP client but still fail when the bundled OpenCode client owns the direct connection. This adds a compatibility path entirely on the OpenWork side: OpenWork owns OAuth and token lifecycle, while OpenCode continues to consume a normal MCP tool surface.

The path is opt-in per connection and desktop-local only. Existing direct remote MCPs and local command MCPs are unchanged.

Security boundary

Provider access tokens, refresh tokens, OAuth client secrets, registrations, discovery state, and PKCE transactions stay in the encrypted OpenWork vault. OpenWork Desktop lazily protects the random vault key with the operating system's secure-storage service and persists only the protected key blob, separately from the vault. The standalone server requires OPENWORK_ENCRYPTION_KEY and has no plaintext key-file fallback; that server-only value is removed from the managed OpenCode child environment.

The runtime OpenCode config contains only the loopback gateway URL and a connection-scoped bearer derived from a process-only secret. That bearer rotates on restart.

Outside explicit local development, provider URLs must use HTTPS and resolve only to public addresses; private, reserved, documentation, and other unsafe special-use blocks are rejected. DNS validation runs inside the outbound socket connector, and the exact validated answer is passed to TCP/TLS so a hostname cannot rebind between validation and connection. Redirects use the same protected transport, HTTPS downgrade is blocked, credential-bearing request bodies cannot cross origins, and provider authorization pages cannot invoke custom external protocols.

Verification

  • pnpm -C apps/server test src/local-managed-mcp-url-guard.test.ts src/local-managed-mcp.e2e.test.ts src/embedded-lifecycle.test.ts — 16 tests passed, 96 assertions
  • pnpm -C apps/desktop test — 185 passed, 1 skipped
  • pnpm -C apps/app exec bun test tests/desktop-web-url.test.ts — 2 tests passed, 5 assertions
  • pnpm -C apps/server typecheck
  • pnpm -C apps/desktop typecheck:electron
  • pnpm -C apps/app typecheck
  • pnpm -C apps/server build
  • pnpm install --frozen-lockfile
  • compiled embedded server import verified with the desktop production dependency links

The focused end-to-end test covers discovery/DCR, PKCE callback, encrypted persistence without a colocated plaintext key, OS-protected desktop key restoration, fail-closed secure-storage behavior, OpenCode runtime registration, unauthorized gateway rejection, tool listing and calls, provider tool errors without false reauthentication, silent token refresh, terminal revocation, restart reconciliation with bearer rotation, disconnect, and reconnect.

An opt-in testkit tape and voiceover were added. The repository-wide eval TypeScript check is currently blocked by the pre-existing connectors-quick-add.slow.test.ts MockMcpHandle.handshakes type error.

Sorry, something went wrong.

Uh oh!

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

All reactions
@vercel

vercel Bot commented Aug 10, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 10, 2026 10:29am
openwork-den Ready Ready Preview Aug 10, 2026 10:29am
openwork-den-worker-proxy Ready Ready Preview Aug 10, 2026 10:29am
openwork-diagnostics Ready Ready Preview Aug 10, 2026 10:29am
openwork-landing Ready Ready Preview, v0 Aug 10, 2026 10:29am
All reactions

Sorry, something went wrong.

Uh oh!

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

@vercel
vercel Bot deployed to Preview – openwork-diagnostics August 10, 2026 09:06
View deployment
@vercel
vercel Bot deployed to Preview – openwork-app August 10, 2026 09:06
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den August 10, 2026 09:06
View deployment
@vercel
vercel Bot deployed to Preview – openwork-landing August 10, 2026 09:06
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den-worker-proxy August 10, 2026 09:06
View deployment
github-actions[bot]
github-actions Bot reviewed Aug 10, 2026
View reviewed changes
Comment thread apps/app/src/react-app/domains/connections/store.ts Resolved

Uh oh!

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

Comment thread apps/server/src/local-managed-mcp-url-guard.ts Resolved

Uh oh!

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

@reachjalil
reachjalil force-pushed the codex/local-mcp-oauth-gateway branch from 17431fc to a106cb6 Compare August 10, 2026 09:57
@vercel
vercel Bot deployed to Preview – openwork-app August 10, 2026 09:58
View deployment
@vercel
vercel Bot deployed to Preview – openwork-diagnostics August 10, 2026 09:58
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den August 10, 2026 09:58
View deployment
@vercel
vercel Bot deployed to Preview – openwork-landing August 10, 2026 09:58
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den-worker-proxy August 10, 2026 09:58
View deployment
@reachjalil
reachjalil force-pushed the codex/local-mcp-oauth-gateway branch from a106cb6 to 2dfb6ab Compare August 10, 2026 09:59
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics August 10, 2026 09:59 Inactive
@vercel
vercel Bot deployed to Preview – openwork-app August 10, 2026 09:59
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den August 10, 2026 10:00
View deployment
@vercel
vercel Bot deployed to Preview – openwork-landing August 10, 2026 10:00
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den-worker-proxy August 10, 2026 10:00
View deployment
github-actions[bot]
github-actions Bot reviewed Aug 10, 2026
View reviewed changes
Comment thread apps/server/src/local-managed-mcp-url-guard.ts Resolved

Uh oh!

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

@reachjalil
reachjalil enabled auto-merge (squash) August 10, 2026 10:06
reachjalil added 3 commits August 10, 2026 11:08
@reachjalil
feat(mcp): add OpenWork-managed OAuth gateway
6c5bee8
@reachjalil
fix(mcp): harden managed OAuth egress
2645049
@reachjalil
fix(mcp): block special-use IPv4 egress
47c0668
@reachjalil
reachjalil force-pushed the codex/local-mcp-oauth-gateway branch from 2dfb6ab to 47c0668 Compare August 10, 2026 10:10
@vercel
vercel Bot deployed to Preview – openwork-diagnostics August 10, 2026 10:11
View deployment
@vercel
vercel Bot deployed to Preview – openwork-app August 10, 2026 10:11
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den August 10, 2026 10:11
View deployment
@vercel
vercel Bot deployed to Preview – openwork-landing August 10, 2026 10:11
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den-worker-proxy August 10, 2026 10:11
View deployment
github-actions[bot]
github-actions Bot reviewed Aug 10, 2026
View reviewed changes
Comment thread apps/server/src/local-managed-mcp.ts Resolved

Uh oh!

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

@reachjalil
fix(mcp): protect managed OAuth vault key
712ef8d
@vercel
vercel Bot deployed to Preview – openwork-diagnostics August 10, 2026 10:28
View deployment
@vercel
vercel Bot deployed to Preview – openwork-app August 10, 2026 10:28
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den August 10, 2026 10:29
View deployment
@vercel
vercel Bot deployed to Preview – openwork-landing August 10, 2026 10:29
View deployment
@vercel
vercel Bot deployed to Preview – openwork-den-worker-proxy August 10, 2026 10:29
View deployment
diff-warden[bot]
diff-warden Bot approved these changes Aug 10, 2026
View reviewed changes

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (712ef8ddbe1818a39a6c705834d52ed2183c7932). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

Sorry, something went wrong.

Uh oh!

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

All reactions
@reachjalil
reachjalil merged commit 1755085 into dev Aug 10, 2026
20 of 22 checks passed

Uh oh!

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

This was referenced Aug 10, 2026
fix(desktop): mirror undici so the packaged embedded server boots #3659
Merged
fix(server): keep non-managed MCP delete and toggle off the credential vault #3663
Closed
@reachjalil reachjalil mentioned this pull request Aug 10, 2026
fix(mcp): preserve ordinary MCP updates without a vault key #3676
Merged
@benjaminshafii benjaminshafii mentioned this pull request Oct 7, 2026
[Connector] Meta Ads MCP https://mcp.facebook.com/ads fails with SSE 405 + UnknownError — needs Streamable HTTP transport + OAuth Client ID field #5472
Open

This branch was successfully deployed

5 active deployments
Preview – openwork-den-worker-proxy — 712ef8dd Deployed Aug 10, 2026 by vercel[bot]
View deployment
Preview – openwork-landing — 712ef8dd Deployed Aug 10, 2026 by vercel[bot]
View deployment
Preview – openwork-den — 712ef8dd Deployed Aug 10, 2026 by vercel[bot]
View deployment
Preview – openwork-app — 712ef8dd Deployed Aug 10, 2026 by vercel[bot]
View deployment
Preview – openwork-diagnostics — 712ef8dd Deployed Aug 10, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@github-actions github-actions[bot] github-actions[bot] left review comments
@diff-warden diff-warden[bot] diff-warden[bot] approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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

@reachjalil
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 01402792 — 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.