Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c89e1ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
🚀 Preview Environment (PR #2200)Preview URL: https://pr-2200.dev.getgram.ai
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>
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>
| if (state.step === "oauth_proxy_client_credentials_form") { | ||
| return makeProxyState(state.proxyFormData); |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
simplesagar
left a comment
There was a problem hiding this comment.
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>
…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>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

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.