Registry / aws / awslabs-bedrock-kb-retrieval-mcp-server

awslabs-bedrock-kb-retrieval-mcp-server

JSON →
library1.0.19pypypiunverified

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.

awsdatabasellm-agentshttp-networkingai-ml
Install & Compatibility
Where this runs
tested against v1.0.22 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 11.05s
py 3.11
✓ —
✓ 9.75s
py 3.12
✓ —
✓ 8.55s
py 3.13
✓ —
✓ 8.2s
py 3.9
✕ build_error
✕ build_error
104MB installed
● package 104MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from awslabs.bedrock_kb_retrieval_mcp_server.server import BedrockKBRetrievalMCPServer

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.

import os import uvicorn from bedrock_kb_retrieval_mcp_server.server import BedrockKBRetrievalMCPServer # --- Configuration --- # # Ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION are set in your environment # or via ~/.aws/credentials. You also need a Bedrock Knowledge Base ID. KNOWLEDGE_BASE_ID = os.environ.get("BEDROCK_KB_ID", "YOUR_KNOWLEDGE_BASE_ID") REGION_NAME = os.environ.get("AWS_REGION", "us-east-1") # e.g., 'us-east-1', 'us-west-2' if KNOWLEDGE_BASE_ID == "YOUR_KNOWLEDGE_BASE_ID": print("WARNING: BEDROCK_KB_ID environment variable not set. Using placeholder.") print("Please set BEDROCK_KB_ID to a valid Amazon Bedrock Knowledge Base ID.") exit(1) print(f"Initializing Bedrock KB Retrieval MCP Server for KB ID: {KNOWLEDGE_BASE_ID}") print(f"In AWS Region: {REGION_NAME}") # Initialize the server instance try: server = BedrockKBRetrievalMCPServer( knowledge_base_id=KNOWLEDGE_BASE_ID, region_name=REGION_NAME ) # Get the FastAPI application instance fastapi_app = server.get_fastapi_app() # Run the server using Uvicorn # The server will be accessible at http://127.0.0.1:8000 if __name__ == "__main__": print("Starting Uvicorn server on http://127.0.0.1:8000") uvicorn.run(fastapi_app, host="127.0.0.1", port=8000) except Exception as e: print(f"Error initializing or running server: {e}") print("Ensure AWS credentials, region, and Bedrock Knowledge Base ID are correctly configured.")
Debug
Known footguns
gotchaIncorrect AWS IAM Permissions: The server requires appropriate IAM permissions to interact with Bedrock Knowledge Bases and associated resources (e.g., S3 buckets for data sources).
gotchaInvalid or Mismatched Knowledge Base ID/Region: Providing a Knowledge Base ID that does not exist, is in a different region, or is not accessible can lead to `ResourceNotFoundException` errors.
gotchaAWS Credentials Not Found or Expired: The `boto3` library used internally relies on standard AWS credential provider chain. If credentials are missing, malformed, or expired, the server will fail to connect to AWS services.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
15 hits · last 30 days
bytedance
5
gptbot
4
ahrefsbot
4
script
1
Resources