You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-hosted MCP: support OAuth 2.0 (external IdP) for /api/mcp #3399
Put the self-hosted MCP endpoint (/api/mcp) behind our org IdP (Okta) so users authenticate via SSO instead of Personal API
Access Keys. Today /api/mcp only accepts access keys (validateUserAccessKey in packages/api/src/mcp/app.ts). Keys are long-
lived, manually distributed, and outside IdP lifecycle (offboarding, MFA, session policy). MCP clients that attempt OAuth
discovery also fail against self-hosted (#2162).
Current behavior (main, 2.41.0):
401 without WWW-Authenticate
No /.well-known/oauth-protected-resource
No config/env vars for an authorization server
What would you like to see?
Opt-in OAuth resource-server mode via env vars; access-key auth stays the default:
MCP_OAUTH_ISSUER: authorization server issuer URL
MCP_OAUTH_AUDIENCE: expected aud
MCP_OAUTH_USER_CLAIM: claim mapped to a HyperDX user (default email)
When set:
Serve RFC 9728 protected-resource metadata pointing to the issuer.
Return 401 with WWW-Authenticate: Bearer resource_metadata="...".
Validate JWT (JWKS, iss, aud, exp) via the SDK's requireBearerAuth.
Resolve req.user from the claim; 403 if no matching user/team.
Out of scope: HyperDX acting as an authorization server; dynamic client registration.
Alternatives you've considered
Reverse proxy that validates IdP tokens and injects an access key. Works, but loses per-user identity unless tokens are manually
mapped to per-user keys.
Maintaining a fork with the change above. Works, but needs rebasing every release.
Anything else?
Area: API (packages/api/src/mcp/app.ts, packages/api/src/middleware/auth.ts)
New issues start as Needs Feedback so we can discuss scope before anyone
writes code. Once a maintainer swaps that for Accepting PR, the issue is ready
to be picked up — see CONTRIBUTING.md.
Thanks for explaining where the enterprise line is. That said, I would ask if you could reconsider a narrower version that stays clear of it:
HyperDX could act as its own MCP authorization server and sign users in with their existing HyperDX account, as hdx auth login already does (#2101).
Unlike this issue and #1306, this relies on no external identity: no IdP, SAML or RBAC. Clients get short-lived tokens bound to /api/mcp. The MCP spec (https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) says an HTTP server that authenticates "SHOULD" do it this way, and the SDK you already ship has the building blocks (mcpAuthRouter, requireBearerAuth).
Why it matters now:
feat(cli): add hdx mcp install to connect AI agents without pasting a key #3622 (merged Nov 11) made a long-lived plain-text key the standard way to connect agents. For an observability MCP that's a risky place for it: the agent reads log and trace content, which is often attacker-controlled (paths, headers, user input), and it can read the config file holding the key. That key isn't limited to MCP either: it also opens the REST API's write routes (alerts, webhooks, connections, sources, team). feat(cli): add hdx mcp install to connect AI agents without pasting a key #3622 itself notes that OAuth for self-hosted MCP "would remove the key prompt altogether".
Activity
brandon-pereira commentedon Oct 19, 2026
Hey there, this is a feature of our enterprise version and as such we will not be supporting this in our OSS version.
Apologies for the inconvenience.
ndeybach commentedon Nov 22, 2026
Hi @brandon-pereira ,
Thanks for explaining where the enterprise line is. That said, I would ask if you could reconsider a narrower version that stays clear of it:
HyperDX could act as its own MCP authorization server and sign users in with their existing HyperDX account, as hdx auth login already does (#2101).
Unlike this issue and #1306, this relies on no external identity: no IdP, SAML or RBAC. Clients get short-lived tokens bound to /api/mcp. The MCP spec (https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization#protocol-requirements) says an HTTP server that authenticates "SHOULD" do it this way, and the SDK you already ship has the building blocks (mcpAuthRouter, requireBearerAuth).
Why it matters now: