Amazon Bedrock Knowledge Base Retrieval MCP Server
by awslabs
The MCP server provides access to Amazon Bedrock Knowledge Bases, allowing users to discover, query, and filter information stored within. It enables natural language queries and retrieval of relevant passages with citation information.
View on GitHub
Last updated: N/A
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
uv
from 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-kb
with 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:Rerank
andbedrock:InvokeModel
actions - 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.
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
Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, ~/.aws/amazonq/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"
},
"disabled": false,
"autoApprove": []
}
}
}
Limitations
- Results with
IMAGE
content type are not included in the KB query response. - The
reranking
parameter requires additional permissions, Amazon Bedrock model access, and is only available in specific regions.