Summary
Mux fails OAuth authentication against GitLab MCP and Jira MCP servers because it validates the OAuth issuer against the MCP endpoint URL instead of the OAuth Authorization Server issuer.
This results in errors similar to:
OAuth authorization server metadata issuer https://gitlab.example.com
does not match expected issuer https://gitlab.example.com/api/v4/mcp
The OAuth metadata returned by GitLab is correct according to RFC 8414.
The failure appears to originate from Mux's OAuth discovery flow.
Environment
- Mux: latest
main
- GitLab MCP
- Jira MCP
- OAuth Authorization Server Metadata (RFC 8414)
Reproduction
Configure an MCP server:
https://gitlab.example.com/api/v4/mcp
During OAuth authentication Mux reports:
OAuth authorization server metadata issuer https://gitlab.example.com
does not match expected issuer https://gitlab.example.com/api/v4/mcp
GitLab Metadata
GitLab exposes the following OAuth metadata:
{
"issuer": "https://gitlab.example.com",
"authorization_endpoint": "https://gitlab.example.com/oauth/authorize",
"token_endpoint": "https://gitlab.example.com/oauth/token"
}
which is exactly what GitLab should expose.
The OAuth Authorization Server is
https://gitlab.example.com
while the MCP Protected Resource is
https://gitlab.example.com/api/v4/mcp
These are intentionally different resources.
Expected behaviour
Mux should discover the Authorization Server from the MCP Protected Resource metadata and validate against
using the Authorization Server URL.
Expected issuer:
https://gitlab.example.com
Actual behaviour
Mux appears to derive the expected issuer from the MCP endpoint:
expectedIssuer =
https://gitlab.example.com/api/v4/mcp
instead of
https://gitlab.example.com
Result:
issuer=https://gitlab.example.com
!=
expectedIssuer=https://gitlab.example.com/api/v4/mcp
which causes authentication to fail.
Affected servers
Confirmed:
Likely any MCP server where
Authorization Server URL
≠
Protected Resource URL
Summary
Mux fails OAuth authentication against GitLab MCP and Jira MCP servers because it validates the OAuth
issueragainst the MCP endpoint URL instead of the OAuth Authorization Server issuer.This results in errors similar to:
The OAuth metadata returned by GitLab is correct according to RFC 8414.
The failure appears to originate from Mux's OAuth discovery flow.
Environment
mainReproduction
Configure an MCP server:
During OAuth authentication Mux reports:
GitLab Metadata
GitLab exposes the following OAuth metadata:
{ "issuer": "https://gitlab.example.com", "authorization_endpoint": "https://gitlab.example.com/oauth/authorize", "token_endpoint": "https://gitlab.example.com/oauth/token" }which is exactly what GitLab should expose.
The OAuth Authorization Server is
while the MCP Protected Resource is
These are intentionally different resources.
Expected behaviour
Mux should discover the Authorization Server from the MCP Protected Resource metadata and validate against
using the Authorization Server URL.
Expected issuer:
Actual behaviour
Mux appears to derive the expected issuer from the MCP endpoint:
instead of
Result:
which causes authentication to fail.
Affected servers
Confirmed:
Likely any MCP server where