The `awslabs-bedrock-kb-retrieval-mcp-server` library provides an AWS Labs Model Context Protocol (MCP) server specifically designed for integrating with Amazon Bedrock Knowledge Bases. It allows other MCP-compliant applications to retrieve information from a Bedrock Knowledge Base via a standard HTTP API. As part of the AWS Labs ecosystem, it typically receives updates driven by Bedrock feature enhancements and MCP protocol evolution, currently at version 1.0.19.
pip install awslabs-bedrock-kb-retrieval-mcp-serverVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate and run the `BedrockKBRetrievalMCPServer` using Uvicorn. It requires AWS credentials configured in the environment or AWS shared credentials file, and a valid Amazon Bedrock Knowledge Base ID. The server will expose an HTTP endpoint for MCP retrieval requests.
Ensure the AWS principal (user/role) running the server has `bedrock:Retrieve`, `bedrock:InvokeModel` (if using custom models), and `s3:GetObject` (for any S3 buckets used by the knowledge base) permissions for the relevant resources.
Verify that the `knowledge_base_id` and `region_name` provided to `BedrockKBRetrievalMCPServer` constructor are correct and correspond to an accessible Bedrock Knowledge Base in the specified region. Check the Bedrock console for the exact ID and region.
Ensure AWS credentials (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`) are correctly set as environment variables, or configured in `~/.aws/credentials` or IAM instance profiles/roles for EC2/ECS/EKS deployments.