fix: show all env vars for basic auth in mcp details and install page#1337
fix: show all env vars for basic auth in mcp details and install page#1337simplesagar merged 6 commits intomainfrom
Conversation
Fixes two issues with basic auth security variables that have multiple environment variables (e.g., username and password): 1. Frontend (MCPDetails.tsx): The Authorization Headers section now iterates over each environment variable instead of each security variable. This shows separate editable entries for username and password. 2. Backend (mcpmetadata/impl.go): The install page now uses the headerDisplayNames map from MCP metadata to get per-env-var display names, fixing the issue where both username and password showed the same display name. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: d90e6e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 #1337)Preview URL: https://pr-1337.test.getgram.ai
Gram Preview Bot |
…ersSection The component was setting displayName: undefined for all entries instead of fetching and using the saved headerDisplayNames from mcpMetadata. Now we: 1. Use useGetMcpMetadata hook to fetch saved display names 2. Look up display names from headerDisplayNames map for each env var 3. Invalidate metadata cache after successful display name update Addresses Devin's pre-review feedback on PR #1337. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🔴 1 issue in files not directly in the diff
🔴 Key mismatch between frontend saving display names and backend reading them for toolset security variables (server/internal/mv/toolset.go:1011)
There is an inconsistency in how header display names are keyed when saving vs. reading:
-
Frontend saves (
MCPDetails.tsx:698, 707): Usesentry.envVar(environment variable name likeX_API_KEY) as thesecurityKeywhen callinghandleEditSave(entry.envVar) -
Server
mcpmetadata/impl.go:656correctly looks up display names byenvVar:
if customName, ok := headerDisplayNames[envVar]; ok && customName != "" {- Server
mv/toolset.go:1011incorrectly looks up display names byentry.Name.String(the header name, NOT the env var):
if dn, ok := headerDisplayNames[entry.Name.String]; ok && dn != "" {The mv/toolset.go code populates securityVariables in the toolset API response, which is used by useMcpConfigs (MCPDetails.tsx:845) to generate MCP config JSON via secVar.displayName. Since the lookup uses the wrong key, custom display names will NOT appear in the generated MCP configuration JSON that users copy to set up their MCP clients.
Impact: Custom display names work correctly on the hosted install page (which uses collectEnvironmentVariables), but fail to appear in the MCP JSON configuration shown in the dashboard and used by useMcpConfigs.
Recommendation: Change line 1011 in mv/toolset.go to look up display names by environment variable names instead of entry.Name.String. Iterate through entry.EnvVariables to find matching display names, similar to how collectEnvironmentVariables in mcpmetadata/impl.go does it.
View issue and 10 additional flags in Devin Review.
…matting
The invalidateGetMcpMetadata function expects a tuple [{ params }] as the
second argument, not just the params object directly. Also fixed prettier
formatting.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The headerDisplayNames map is keyed by environment variable names (e.g., X_API_KEY, USERNAME), not header names (e.g., Authorization). Updated the lookup to iterate through entry.EnvVariables to find matching display names. Addresses Devin's review feedback about key mismatch between frontend saving and backend reading display names. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ction Add throwOnError: false to useGetMcpMetadata hook since metadata may not exist for all toolsets. This prevents 404 responses from crashing the component via React Query's error boundary propagation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Changes
Frontend (client/dashboard/src/pages/mcp/MCPDetails.tsx)
AuthorizationHeadersSectionnow flattens security variables to create one row per environment variableBackend (server/internal/mcpmetadata/impl.go)
collectEnvironmentVariablesnow accepts aheaderDisplayNamesmap parameterTest plan
🤖 Generated with Claude Code