Skip to content

feat: oauth config wizard#2200

Merged
walker-tx merged 35 commits intomainfrom
walker/age-1772-feat-improve-oauth-config-for-external-mcp-servers
Apr 16, 2026
Merged

feat: oauth config wizard#2200
walker-tx merged 35 commits intomainfrom
walker/age-1772-feat-improve-oauth-config-for-external-mcp-servers

Conversation

@walker-tx
Copy link
Copy Markdown
Member

@walker-tx walker-tx commented Apr 13, 2026

Changes the oauth config modal into a wizard.

This is part of a broader initiative to make OAuth configuration more intuitive for users. It also makes it possible to set client credentials for the oauth proxy config within the workflow itself instead of requiring users to add the vars manually to an env.

CleanShot 2026-04-14 at 14 27 02

walker-tx and others added 13 commits April 13, 2026 11:28
…1772-feat-improve-oauth-config-for-external-mcp-servers
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…1772-feat-improve-oauth-config-for-external-mcp-servers
…mcp-servers' of github.com:speakeasy-api/gram into walker/age-1772-feat-improve-oauth-config-for-external-mcp-servers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Apr 13, 2026

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

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

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Apr 16, 2026 4:05pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 13, 2026

🦋 Changeset detected

Latest commit: c89e1ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the preview Spawn a preview environment label Apr 13, 2026
@speakeasybot
Copy link
Copy Markdown
Collaborator

speakeasybot commented Apr 13, 2026

🚀 Preview Environment (PR #2200)

Preview URL: https://pr-2200.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Existing database reused 2026-04-16 16:11:34.
✅ Images Available Container images ready 2026-04-16 16:11:16.

Gram Preview Bot

Replace the 880-line OAuthTabModal (15+ useState hooks, implicit transitions)
with a discriminated-union state machine in a new OAuthWizard.tsx file.

- 4 explicit states: path_selection, external_oauth_server_metadata_form,
  oauth_proxy_server_metadata_form, oauth_proxy_client_credentials_form
- useReducer for single source of truth on transitions
- Each step is a focused component receiving its slice of state
- Deduplicate environment names on proxy create (e.g. "Notion OAuth 2")
- Warn when an existing environment will be detached
- Chain mutations sequentially to fix stale "NO ENV ATTACHED" after creation
- Invalidate environments list so new attachment shows immediately

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
walker-tx and others added 7 commits April 14, 2026 11:30
Stop attaching the OAuth environment as defaultEnvironmentId on MCP
metadata during proxy creation — the environment_slug in the secrets
column is sufficient for credential resolution at runtime. Update the
configured message copy to name the environment with a link to its
config page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…1772-feat-improve-oauth-config-for-external-mcp-servers
Extract getOAuthParadigm helper and OAuthStatusDisplay component,
inline descriptions instead of mixed-type PARADIGM_CONTENT map,
fix missing imports in MCPDetails, remove dead code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show an inline result step instead of a toast when OAuth configuration
succeeds or fails. Move wizard title into state so each step carries its
own title, replacing the deeply nested ternary. Delay state reset until
after the dialog close animation to prevent the path selection step from
flashing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@walker-tx walker-tx marked this pull request as ready for review April 14, 2026 21:31
@walker-tx walker-tx requested a review from a team as a code owner April 14, 2026 21:31
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 8 additional findings in Devin Review.

Open in Devin Review

Comment on lines +112 to +113
if (state.step === "oauth_proxy_client_credentials_form") {
return makeProxyState(state.proxyFormData);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 BACK from credentials form loses prefilled flag, re-showing the "Apply" button for already-applied discovered OAuth

extractProxyFormData at client/dashboard/src/pages/mcp/oauth-wizard/reducer.ts:62-74 captures all form fields but omits prefilled. When the BACK action fires from oauth_proxy_client_credentials_form, it calls makeProxyState(state.proxyFormData) at reducer.ts:113, which defaults prefilled to false (line 58). This means if the user applied discovered OAuth metadata (setting prefilled=true), navigated to the credentials step, then clicked Back, the proxy form re-renders with prefilled=false. In ProxyMetadataForm.tsx:47, the condition discoveredOAuth && !state.prefilled becomes true, showing the "Apply" button again even though the form already contains discovered values. Clicking "Apply" would overwrite any manual edits the user made.

Prompt for agents
The BACK action from oauth_proxy_client_credentials_form calls makeProxyState(state.proxyFormData), but proxyFormData (type ProxyFormData) doesn't include the prefilled flag. This causes the prefilled state to be lost when navigating back.

There are two reasonable approaches to fix this:

1. Store prefilled in proxyFormData: Add prefilled: boolean to the ProxyFormData interface in types.ts, capture it in extractProxyFormData (reducer.ts:62-74), and it will automatically flow through makeProxyState since makeProxyState already accepts prefilled in its overrides type.

2. Store prefilled separately in the credentials step state: Add a prefilled field to the oauth_proxy_client_credentials_form state variant in types.ts, set it in PROXY_NEXT from the current state.prefilled, and read it back in the BACK handler to pass to makeProxyState.

Approach 1 is simpler and keeps the data together.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread client/dashboard/src/pages/mcp/oauth-wizard/actions.ts
Consolidate environment creation and credential storage by populating
the entries array in the initial createEnvironment call. This
removes the need for a separate updateEnvironment request and
simplifies the asynchronous success chaining in the OAuth wizard.
Copy link
Copy Markdown
Member

@simplesagar simplesagar left a comment

Choose a reason for hiding this comment

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

Can we mark the "Oauth Proxy" as the Recommended option?

…entials form

The attached environment name lookup and warning banner were unnecessary complexity — the wizard already handles environment creation cleanly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…1772-feat-improve-oauth-config-for-external-mcp-servers
…ails

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@walker-tx
Copy link
Copy Markdown
Member Author

Can we mark the "Oauth Proxy" as the Recommended option?

CleanShot 2026-04-15 at 13 56 49@2x

Done!

devin-ai-integration[bot]

This comment was marked as resolved.

walker-tx and others added 2 commits April 16, 2026 08:56
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@walker-tx walker-tx merged commit 91f7e0d into main Apr 16, 2026
26 checks passed
@walker-tx walker-tx deleted the walker/age-1772-feat-improve-oauth-config-for-external-mcp-servers branch April 16, 2026 20:36
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants