An AWS Labs Model Context Protocol (MCP) server for Bedrock Knowledge Base Retrieval
Project description
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: us-west-2, us-east-1, ap-northeast-1, and ca-central-1
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
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004.tar.gz.
File metadata
- Download URL: awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004.tar.gz
- Upload date:
- Size: 44.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71aa4cb48eea83330b7ac06597affbc0502d2252bae2cd40aa43fb2fcd07ab10
|
|
| MD5 |
3f9360fd270d6662b728cc7ba589a370
|
|
| BLAKE2b-256 |
b9d31a227a990154074a28de87b26fc2abbd085d27cc49b57adad58f638db772
|
Provenance
The following attestation bundles were made for awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004.tar.gz:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004.tar.gz -
Subject digest:
71aa4cb48eea83330b7ac06597affbc0502d2252bae2cd40aa43fb2fcd07ab10 - Sigstore transparency entry: 191854270
- Sigstore integration time:
-
Permalink:
awslabs/mcp@9f9c71c2fc082c91f30415d90aa5699b06ec3e43 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9f9c71c2fc082c91f30415d90aa5699b06ec3e43 -
Trigger Event:
schedule
-
Statement type:
File details
Details for the file awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004-py3-none-any.whl.
File metadata
- Download URL: awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e34c1b1432f13549ea7acbba7ac8eb3589b6f64987417923624a8755779c4594
|
|
| MD5 |
4e584efe2ec58d60012e38debb8d0067
|
|
| BLAKE2b-256 |
0b2aec714d14089e2be9a72969ffa9b26352216955a572a9ad6ed7b36120de57
|
Provenance
The following attestation bundles were made for awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004-py3-none-any.whl:
Publisher:
release.yml on awslabs/mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
awslabs_bedrock_kb_retrieval_mcp_server-0.0.31004-py3-none-any.whl -
Subject digest:
e34c1b1432f13549ea7acbba7ac8eb3589b6f64987417923624a8755779c4594 - Sigstore transparency entry: 191854272
- Sigstore integration time:
-
Permalink:
awslabs/mcp@9f9c71c2fc082c91f30415d90aa5699b06ec3e43 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/awslabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9f9c71c2fc082c91f30415d90aa5699b06ec3e43 -
Trigger Event:
schedule
-
Statement type: