Title: [BUG] MCP server "discover" step ignores configured static Authorization header, always requires OAuth · Issue #5665 · simstudioai/sim · GitHub
Open Graph Title: [BUG] MCP server "discover" step ignores configured static Authorization header, always requires OAuth · Issue #5665 · simstudioai/sim
X Title: [BUG] MCP server "discover" step ignores configured static Authorization header, always requires OAuth · Issue #5665 · simstudioai/sim
Description: When adding a new MCP server in Workspace Settings → MCP Tools, if the target server supports both a static Bearer-token header AND OAuth 2.1 discovery (per the MCP Authorization spec — i.e. it returns 401 + a WWW-Authenticate: Bearer re...
Open Graph Description: When adding a new MCP server in Workspace Settings → MCP Tools, if the target server supports both a static Bearer-token header AND OAuth 2.1 discovery (per the MCP Authorization spec — i.e. it ret...
X Description: When adding a new MCP server in Workspace Settings → MCP Tools, if the target server supports both a static Bearer-token header AND OAuth 2.1 discovery (per the MCP Authorization spec — i.e. it ret...
Opengraph URL: https://github.com/simstudioai/sim/issues/5665
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] MCP server \"discover\" step ignores configured static Authorization header, always requires OAuth","articleBody":"\nWhen adding a new MCP server in Workspace Settings → MCP Tools, if the target server supports both a static Bearer-token header AND OAuth 2.1 discovery (per the MCP Authorization spec — i.e. it returns 401 + a `WWW-Authenticate: Bearer resource_metadata=\"...\"` header when called with no credentials), the \"Add New MCP Server\" flow fails with **\"OAuth re-authorization required\"** — even when a valid `Authorization: Bearer \u003ctoken\u003e` header has been explicitly configured in the form's \"Headers\" section.\n\nIt looks like the discovery/connection-test step probes the target server without attaching the configured headers, sees the server's OAuth-discovery response, and immediately concludes OAuth is mandatory — without ever retrying with the header the user configured.\n\n**To Reproduce**\n1. Go to Workspace Settings → MCP Tools → Add server.\n2. Enter a Server Name and Server URL for an MCP server that requires auth on every request and also supports OAuth 2.1 discovery (RFC 9728 protected resource metadata).\n3. In \"Headers\", add `Authorization` = `Bearer \u003ca token confirmed working directly against that server via curl/Postman\u003e`.\n4. Submit.\n5. The modal sticks on \"Adding…\" then fails; the MCP Tools page shows a red \"OAuth re-authorization required\" banner.\n6. In DevTools → Network, the request to `.../discover?workspaceId=...` returns `401` with body `{\"success\":false,\"error\":\"OAuth re-authorization required\"}`.\n\n**Expected behavior**\nIf a valid static Authorization header is explicitly configured for a connection, the discovery step should use it (or at least retry with it) instead of unconditionally requiring an interactive OAuth flow just because the target server also happens to support OAuth for clients that prefer it.\n\n**Additional context**\nConfirmed via direct testing (curl/Postman) that the exact same `Authorization: Bearer \u003ctoken\u003e` used in the Headers field authenticates successfully and returns valid tool results directly against the server — ruling out an invalid/expired token as the cause. The server tested against was `https://valta.co/api/mcp`, which supports both a static API-key Bearer token and full OAuth 2.1 (for clients like Claude.ai's connector) on the same endpoint. Happy to provide more detail or a test credential if useful for reproducing.","author":{"url":"https://github.com/Billionaire664","@type":"Person","name":"Billionaire664"},"datePublished":"2026-07-14T02:24:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":45},"url":"https://github.com/5665/sim/issues/5665"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1ce014b8-2b6c-cf54-6176-be659b3a7496 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA62:1C8D97:23BF22:30E639:6A62678B |
| html-safe-nonce | 73b3652004bb61527468cef5d47acc8ec23b6ca71cec79ae51a0256779e39455 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTYyOjFDOEQ5NzoyM0JGMjI6MzBFNjM5OjZBNjI2NzhCIiwidmlzaXRvcl9pZCI6IjMyOTQ3NjM5MDgxMjE5MTMyMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 47af750e646b60adcefe4fcb8660a7b95496452f26fde149b2cfa8289f806165 |
| hovercard-subject-tag | issue:4879269934 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/simstudioai/sim/5665/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8851c685f9e99fff4f6d48a34d5007bb11f72f1cb1eaeb5cea21e2bef9b6e9bf/simstudioai/sim/issues/5665 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8851c685f9e99fff4f6d48a34d5007bb11f72f1cb1eaeb5cea21e2bef9b6e9bf/simstudioai/sim/issues/5665 |
| og:image:alt | When adding a new MCP server in Workspace Settings → MCP Tools, if the target server supports both a static Bearer-token header AND OAuth 2.1 discovery (per the MCP Authorization spec — i.e. it ret... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Billionaire664 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 194bddaed53c0eb07047629c520853f4208e77a17ff57428346485cc202e39f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c2862cf2db52f0c7f6cba3de21ffeeafe7c5456e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width