fix(ui): expose the authorization MCP auth type in the create and edit forms - #34765
fix(ui): expose the authorization MCP auth type in the create and edit forms#34765devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryAdds raw Authorization-header authentication to MCP server management forms
Confidence Score: 4/5The blank-value transition into Authorization needs to be fixed before merging because it saves the new auth type without a usable credential The edit form allows a server to switch to Authorization without entering an auth value; its payload then omits credentials and the backend clears them during the auth-class change, leaving authenticated upstream calls without the required header value Files Needing Attention: ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/create_mcp_server.tsx | Exposes the authorization option and includes its raw header value in create payload credentials |
| ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx | Adds raw Authorization editing, but permits switching into the mode without supplying the required credential |
| ui/litellm-dashboard/src/components/mcp_tools/types.tsx | Adds the backend-supported authorization value to the shared frontend auth-type constants |
| ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/create_mcp_server.test.tsx | Verifies create-form selection, value entry, and payload serialization for raw Authorization |
| ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.test.tsx | Verifies saving a supplied raw Authorization credential but does not cover switching with a blank value |
Reviews (1): Last reviewed commit: "fix(ui): expose the authorization MCP au..." | Re-trigger Greptile
| AUTH_TYPE.BEARER_TOKEN, | ||
| AUTH_TYPE.TOKEN, | ||
| AUTH_TYPE.BASIC, | ||
| AUTH_TYPE.AUTHORIZATION, |
There was a problem hiding this comment.
Authorization saves without credentials
When an admin switches an existing server to Authorization and leaves the newly displayed value blank, the form omits credentials while saving the new auth type; the backend clears credentials on that auth-class change, leaving the server configured for Authorization without an auth_value and causing authenticated upstream requests to fail. Require a value when switching into this mode while retaining the blank-means-keep-existing behavior for servers already using it
TLDR
Problem this solves:
auth_type: authorizationMCP serversAuthorization: ApiKey <key>return 401 viaapi_keyHow it solves it:
Relevant issues
Fixes #34763
Linear ticket
Pre-Submission checklist
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
I don't have UI screenshots to attach; the change is dropdown-only, so here is the click path to capture before/after at
153b17e98bpython litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml --detailed_debug --reload --use_v2_migration_resolver 2>&1 | tee litellm.log, and the dashboard dev server:npm run devinui/litellm-dashboardApiKey <upstream key>in Authentication Value, point the URL at an upstream that wants a non-preset scheme (the reporter's case is an Elastic Kibana Agent Builder MCP at/api/agent_builder/mcp), and hit "Add MCP Server"auth_type: authorizationand that listing tools succeeds where theapi_keyoption previously returned 401, e.g.curl -sS -X POST http://localhost:4000/v1/mcp/server -H "Authorization: Bearer sk-1234" ...returns the same shape the form now sendsType
🐛 Bug Fix
Changes
AUTH_TYPEinui/litellm-dashboard/src/components/mcp_tools/types.tsxgainsAUTHORIZATION: "authorization", mirroringMCPAuth.authorization, which the client already turns into a verbatimheaders["Authorization"]. Bothcreate_mcp_server.tsxandmcp_server_edit.tsxadd the option to the auth-type Select and addAUTH_TYPE.AUTHORIZATIONtoAUTH_TYPES_REQUIRING_AUTH_VALUE, which also pulls it intoAUTH_TYPES_REQUIRING_CREDENTIALSso the entered value is collected intocredentials.auth_value. The BYOK hint in the create form already described this mode (Authorization: {key}), so it now matches what the dropdown offersBoth auth Selects also get
virtual={false}. antd virtualizes the option list at roughly a 256px window, so the eleventh option pushed OAuth Delegate out of the rendered DOM and the existing tests that select it started failing; with a fixed list of eleven static options the virtual list buys nothing and costs reachabilityRegression coverage:
create_mcp_server.test.tsxpicks the new option and asserts the create payload carriesauth_type: "authorization"pluscredentials.auth_value, andmcp_server_edit.test.tsxdoes the same for a save that switches an existingapi_keyserver over. Both fail without the dropdown entry (the option can't be selected) and without the auth-value wiring (no value field to type into)Final Attestation
Link to Devin session: https://app.devin.ai/sessions/0f93b8ddb8aa4b6785f272645153e5d6