AgentCore Runtime #
Hosting an MCP Server #
Configure Cognito User Pool (AgentCore Agents and MCP Servers need to be authenticated). Users in the pool need permission to invoke, which is configured in the Agent Configuration itself (See below)

Once Agent or MCP server is configured, generate the BEARER TOKEN using the approach: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-mcp.html
export BEARER_TOKEN=$(aws cognito-idp initiate-auth \
--client-id "$CLIENT_ID" \
--auth-flow USER_PASSWORD_AUTH \
--auth-parameters USERNAME='testuser',PASSWORD='PERMANENT_PASSWORD' \
--region us-east-1 | jq -r '.AuthenticationResult.AccessToken')