Skip to content

AgentCore Gateway discovery not working as expected

0

I'm unsuccessful in adding my AgentCore Gateway front ended MCP servers (w/ Cognito for OAuth) to Claude or ChatGPT. Both use autodiscovery of services and auth per the MCP standard auth flow described here

The first steps are:

  1. Client sends MCP request without token
  2. Server replies HTTP 401 Unauthorized with WWW-Authenticate header which includes the resource metadata to start the OAuth flow.

My AgentCore Gateway MCPs all return 405 Service Not Allowed - not sure if this is the problem, but I see other mcp servers that work (e.g. https://mcp.atlassian.com/v1/sse) returning 401.

Has anyone been able to get a AgentCore Gateway MCP server to authenticate and connect with Claude or ChatGPT?

2 Answers
0

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.

AWS
EXPERT

answered a year ago

-1

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:

  1. Use the Claude CLI to add your MCP server
  2. 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

  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.