AWS Bedrock KB Retrieval
Query Amazon Bedrock Knowledge Bases using natural language to retrieve relevant information from your data sources.
Amazon Bedrock Knowledge Base Retrieval MCP Server
MCP server for accessing Amazon Bedrock Knowledge Bases
Features
Discover knowledge bases and their data sources
- Find and explore all available knowledge bases
- Search for knowledge bases by name or tag
- List data sources associated with each knowledge base
Query knowledge bases with natural language
- Retrieve information using conversational queries
- Get relevant passages from your knowledge bases
- Access citation information for all results
Filter results by data source
- Focus your queries on specific data sources
- Include or exclude specific data sources
- Prioritize results from specific data sources
Rerank results
- Improve relevance of retrieval results
- Use Amazon Bedrock reranking capabilities
- Sort results by relevance to your query
Prerequisites
Installation Requirements
- Install
uvfrom Astral or the GitHub README - Install Python using
uv python install 3.10
AWS Requirements
- AWS CLI Configuration: You must have the AWS CLI configured with credentials and an AWS_PROFILE that has access to Amazon Bedrock and Knowledge Bases
- Amazon Bedrock Knowledge Base: You must have at least one Amazon Bedrock Knowledge Base with the tag key
mcp-multirag-kbwith a value oftrue - IAM Permissions: Your IAM role/user must have appropriate permissions to:
- List and describe knowledge bases
- Access data sources
- Query knowledge bases
Reranking Requirements
If you intend to use reranking functionality, your Bedrock Knowledge Base needs additional permissions:
- Your IAM role must have permissions for both
bedrock:Rerankandbedrock:InvokeModelactions - The Amazon Bedrock Knowledge Bases service role must also have these permissions
- Reranking is only available in specific regions. Please refer to the official documentation for an up to date list of supported regions.
- Enable model access for the available reranking models in the specified region.
Controlling Reranking
Reranking can be globally enabled or disabled using the BEDROCK_KB_RERANKING_ENABLED environment variable:
- Set to
false(default): Disables reranking for all queries unless explicitly enabled - Set to
true: Enables reranking for all queries unless explicitly disabled
The environment variable accepts various formats:
- For enabling: 'true', '1', 'yes', or 'on' (case-insensitive)
- For disabling: any other value or not set (default behavior)
This setting provides a global default, while individual API calls can still override it by explicitly setting the reranking parameter.
For detailed instructions on setting up knowledge bases, see:
- Create a knowledge base
- Managing permissions for Amazon Bedrock knowledge bases
- Permissions for reranking in Amazon Bedrock
Installation
| Kiro | Cursor | VS Code |
|---|---|---|
Configure the MCP server in your MCP client configuration (e.g., for Kiro, edit ~/.kiro/settings/mcp.json):
{
"mcpServers": {
"awslabs.bedrock-kb-retrieval-mcp-server": {
"command": "uvx",
"args": ["awslabs.bedrock-kb-retrieval-mcp-server@latest"],
"env": {
"AWS_PROFILE": "your-profile-name",
"AWS_REGION": "us-east-1",
"FASTMCP_LOG_LEVEL": "ERROR",
"KB_INCLUSION_TAG_KEY": "optional-tag-key-to-filter-kbs",
"BEDROCK_KB_RERANKING_ENABLED": "false"
},
"disabled": false,
"autoApprove": []
}
}
}
Windows Installation
For Windows users, the MCP server configuration format is slightly different:
{
"mcpServers": {
"awslabs.bedrock-kb-retrieval-mcp-server": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"tool",
"run",
"--from",
"awslabs.bedrock-kb-retrieval-mcp-server@latest",
"awslabs.bedrock-kb-retrieval-mcp-server.exe"
],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1"
}
}
}
}
or docker after a successful docker build -t awslabs/bedrock-kb-retrieval-mcp-server .:
# fictitious `.env` file with AWS temporary credentials
AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
{
"mcpServers": {
"awslabs.bedrock-kb-retrieval-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"--env",
"KB_INCLUSION_TAG_KEY=optional-tag-key-to-filter-kbs",
"--env",
"BEDROCK_KB_RERANKING_ENABLED=false",
"--env",
"AWS_REGION=us-east-1",
"--env-file",
"/full/path/to/file/above/.env",
"awslabs/bedrock-kb-retrieval-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
NOTE: Your credentials will need to be kept refreshed from your host
Limitations
- Results with
IMAGEcontent type are not included in the KB query response. - The
rerankingparameter requires additional permissions, Amazon Bedrock model access, and is only available in specific regions.
Related Servers
Aiven
Manage Aiven cloud services like Kafka, PostgreSQL, and Redis via its API.
OKX MCP Server
Provides real-time cryptocurrency price data from the OKX exchange.
Earthdata MCP Server
Interact with NASA Earth Data for efficient dataset discovery and retrieval for geospatial analysis.
Remote MCP Server
A production-ready MCP server on Cloudflare Workers with GitHub OAuth and Fantasy Premier League integration.
Bitpin Exchange
Interact with the Bitpin cryptocurrency exchange API to manage wallets, view market data, and execute orders.
Giant Swarm App Platform
A server for managing Giant Swarm App Platform deployments using Kubernetes credentials.
BICScan
Provides risk scoring and asset information for blockchain addresses, domains, and dApps using the BICScan API.
Kubectl MCP Server
Enables AI assistants to interact with Kubernetes clusters using natural language.
Honeycomb MCP
Interact with Honeycomb observability data, including datasets, SLOs, and triggers.
Ntropy MCP server
Enrich banking data using the Ntropy API.