Skip to main content

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

  1. Install uv from Astral or the GitHub README
  2. Install Python using uv python install 3.10

AWS Requirements

  1. 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
  2. Amazon Bedrock Knowledge Base: You must have at least one Amazon Bedrock Knowledge Base with the tag key mcp-multirag-kb with a value of true
  3. 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:

  1. Your IAM role must have permissions for both bedrock:Rerank and bedrock:InvokeModel actions
  2. The Amazon Bedrock Knowledge Bases service role must also have these permissions
  3. Reranking is only available in specific regions. Please refer to the official documentation for an up to date list of supported regions.
  4. Enable model access for the available reranking models in the specified region.

For detailed instructions on setting up knowledge bases, see:

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",
        "KB_INCLUSION_TAG_KEY: "optional-tag-key-to-filter-kbs"
      },
      "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.

Project details


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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file awslabs_bedrock_kb_retrieval_mcp_server-0.1.7.tar.gz.

File metadata

File hashes

Hashes for awslabs_bedrock_kb_retrieval_mcp_server-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1b565d3ae46e7810dd26eaea053ea0d71875734a2cb56e63a2a39eea847c1bad
MD5 b2f92aa74d785682f286841141b40580
BLAKE2b-256 f5d34af4318962e4bdb0d4e7d6d0f37c12da63ec8ace174de0e422d3034a17b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_bedrock_kb_retrieval_mcp_server-0.1.7.tar.gz:

Publisher: release.yml on awslabs/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file awslabs_bedrock_kb_retrieval_mcp_server-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for awslabs_bedrock_kb_retrieval_mcp_server-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b785dab23560525805cc1ca495e1580c98002eb95c332328040a844c47a48c92
MD5 3fabf1d69627a8036578c42649abfbc9
BLAKE2b-256 e9e16a339b49855eaa9dab59cb18e45f6b2b105f995dd90c9c2a5a7714a5ace5

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_bedrock_kb_retrieval_mcp_server-0.1.7-py3-none-any.whl:

Publisher: release.yml on awslabs/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page