-
Notifications
You must be signed in to change notification settings - Fork 143
Description
Before opening, please confirm:
Operating System
macOS
Kiro Version
Kiro CLI (latest)
Bug Description
Kiro is not properly implementing OAuth 2.0 Protected Resource discovery (RFC 9728) when connecting to MCP servers with OAuth authentication. Instead of following the discovery flow to find the authorization server and endpoints, Kiro hardcodes assumptions about the URL structure.
What Kiro is doing (incorrect):
- Takes the MCP server URL (e.g.,
https://mcp.honeycomb.io) - Appends
/authorizeto create:https://mcp.honeycomb.io/authorize - Opens this URL in the browser → 404 error
What Kiro should do (per RFC 9728):
- Fetch
https://mcp.honeycomb.io/.well-known/oauth-protected-resource - Extract
authorization_servers[0]→https://ui.honeycomb.io - Fetch
https://ui.honeycomb.io/.well-known/oauth-authorization-server - Extract
authorization_endpoint→https://ui.honeycomb.io/oauth/authorize - Open the correct authorization URL
Steps to Reproduce
- Configure Honeycomb's MCP server in
~/.kiro/settings/mcp.json:
{
"mcpServers": {
"honeycomb": {
"url": "https://mcp.honeycomb.io",
"type": "http"
}
}
}- Attempt to connect to the Honeycomb MCP server in Kiro
- When prompted to authenticate, click "Open" to authorize
- Browser opens to:
https://mcp.honeycomb.io/authorize?...→ 404 Not Found
Expected Behavior
Browser should open to the correct authorization endpoint discovered via OAuth metadata:
https://ui.honeycomb.io/oauth/authorize?response_type=code&client_id=...
Server Metadata (Verified Correct)
Protected Resource Metadata (https://mcp.honeycomb.io/.well-known/oauth-protected-resource):
{
"resource": "https://mcp.honeycomb.io/mcp",
"authorization_servers": ["https://ui.honeycomb.io"],
"scopes_supported": ["mcp:read", "mcp:write"],
"bearer_methods_supported": ["header"]
}Authorization Server Metadata (https://ui.honeycomb.io/.well-known/oauth-authorization-server):
{
"issuer": "https://ui.honeycomb.io",
"authorization_endpoint": "https://ui.honeycomb.io/oauth/authorize",
"token_endpoint": "https://ui.honeycomb.io/oauth/token",
"registration_endpoint": "https://ui.honeycomb.io/oauth/register",
...
}Root Cause
Kiro appears to be hardcoding the authorization URL construction instead of implementing the OAuth 2.0 discovery flow. This breaks when:
- The authorization server is on a different domain than the MCP server
- The authorization endpoint is not at
/authorize(e.g.,/oauth/authorize)
Conversation ID
No response
Additional Context
References:
Related Issues:
- MCP: Unable to authenticate with servers that contain query parameters #3681 - Similar issue with query parameter encoding in OAuth URLs
- Streamable HTTP / DCR not supported? Error: Failed to connect to MCP server "semilattice": token_endpoint_auth_method: Input should be 'none' or 'client_secret_post' #3908 - OAuth validation errors with MCP servers
This bug affects any MCP server that:
- Hosts the authorization server on a different domain than the resource server
- Uses a non-standard authorization endpoint path