- Newest
- Most votes
- Most comments
AgentCore Gateway returns 401 if you try to connect without a valid token and follows the MCP standard. SSE is not supported by AgentCore Gateway, only http_streaming.
When connecting an AgentCore Gateway MCP server to Claude or ChatGPT, the 405 Method Not Allowed error you're encountering indicates there may be an issue with how authentication is being handled.
For Claude integration specifically, you need to use a different approach than relying on the MCP standard auth flow with autodiscovery. Based on the available documentation, Claude requires you to add the MCP server using a specific authentication method rather than depending on the OAuth flow you described.
For Claude, you would need to:
- Use the Claude CLI to add your MCP server
- Provide the authentication token directly in the headers
Here's how you would set it up with Claude:
claude mcp add "YOUR_SERVER_NAME" "YOUR_GATEWAY_MCP_SERVER_URL" \
--transport http \
--header "Authorization: Bearer YOUR_AUTH_TOKEN"
Alternatively, for Claude Desktop, you would need to edit the configuration file to include your MCP server with the appropriate authentication headers.
The issue appears to be that AgentCore Gateway may not support the autodiscovery flow you're trying to use. Instead, you need to provide the authentication token directly when configuring the connection to your MCP server.
When setting up your AgentCore Gateway, make sure you've properly configured the authorizer type (such as CUSTOM_JWT) and the appropriate authorizer configuration. This is essential for the authentication to work correctly.
Sources
Create an agent that uses your AgentCore gateway - Amazon Bedrock AgentCore
Integrating API-based AI agent products - AWS Marketplace
Encrypt your AgentCore gateway with a customer-managed KMS key - Amazon Bedrock AgentCore
answered a year ago
Relevant content
asked a year ago
asked 9 months ago

The AI generated answer is not relevant to the question. The question is specific to automatic MCP discovery and setup via URL as done by the Claude and ChatGPT web applications and as defined in the MCP authentication flow referenced, this is not about CLI or other setups where bearer tokens or client secrets are prepared in advance.