- Newest
- Most votes
- Most comments
When working with MCP servers in Amazon Bedrock AgentCore Runtime, long-running tools can get interrupted after a timeout period. For tools that take longer than 60 seconds to complete (like your 125-second tool), you need to implement ping handlers with a HEALTHY_BUSY status for asynchronous tasks.
The issue you're experiencing is likely related to the default timeout behavior in AgentCore Runtime. While you've set MCP_TIMEOUT and READ_TIMEOUT environment variables, these may not be affecting the underlying timeout mechanism in the AgentCore Runtime service.
For long-running tools in AgentCore Runtime, you should:
- Implement ping handlers in your FastMCP server that return a HEALTHY_BUSY status for tasks that are still processing
- Verify that your MCP server is correctly listening on
0.0.0.0:8000/mcp/, which is the default path expected by AgentCore Runtime - Check that your container is properly exposing the required ports and endpoints
The fact that your tool works locally but times out in AgentCore Runtime suggests there might be a configuration difference between your local environment and the deployed environment. The AgentCore Runtime service may have stricter timeout policies than your local setup.
Consider reviewing your CloudWatch logs for any additional error information and ensure your MCP server implementation follows the stateless streamable-HTTP server requirements of AgentCore Runtime.
Sources
Troubleshoot AgentCore Runtime - Amazon Bedrock AgentCore
Deploy MCP servers in AgentCore Runtime - Amazon Bedrock AgentCore
answered 10 months ago
Relevant content
asked a year ago
asked 3 months ago
