Supports deployment as a Docker container with options for using IAM Access Keys or AWS SSO authentication methods.
Retrieves information from the AWS Knowledge Base using Bedrock Agent Runtime, supporting RAG (Retrieval-Augmented Generation) with customizable result counts and providing both raw context and structured metadata from search queries.
AWS Knowledge Base Retrieval MCP Server
An MCP server implementation for retrieving information from the AWS Knowledge Base using the Bedrock Agent Runtime.
Features
- RAG (Retrieval-Augmented Generation): Retrieve context from the AWS Knowledge Base based on a query and a Knowledge Base ID.
- Supports multiple results retrieval: Option to retrieve a customizable number of results.
Tools
- retrieve_from_aws_kb
- Perform retrieval operations using the AWS Knowledge Base.
- Inputs:
query
(string): The search query for retrieval.knowledgeBaseId
(string): The ID of the AWS Knowledge Base.n
(number, optional): Number of results to retrieve (default: 3).
- Response format:
- The response now returns two separate content items:
- A text item containing the raw context from the knowledge base.
- A JSON item containing the structured RAG sources with metadata (id, fileName, snippet, and score).
- This separation allows for more flexible processing of the results.
- The response now returns two separate content items:
Configuration
Setting up AWS Credentials
You have two options for configuring AWS credentials:
Option 1: IAM Access Keys
- Obtain AWS access key ID, secret access key, and region from the AWS Management Console.
- Ensure these credentials have appropriate permissions for Bedrock Agent Runtime operations.
- Set the environment variables as shown in the configuration examples below.
- For temporary credentials, you can also provide a session token using the
AWS_SESSION_TOKEN
environment variable.
Option 2: AWS SSO (Single Sign-On)
The server now supports AWS SSO credentials:
- Configure AWS CLI with your SSO profile:
aws configure sso
- Set only the AWS_REGION environment variable in the MCP server configuration.
- The server will use the default credential provider chain, which includes SSO credentials.
Optional: Configure Default Knowledge Base IDs
You can optionally specify one or more knowledge base IDs to use by default:
- Create an array of knowledge base IDs in JSON format.
- Set this as the AWS_KB_IDS environment variable in your configuration.
- When this is configured, the
knowledgeBaseId
parameter becomes optional in the tool.
Usage with Claude Desktop
Add this to your claude_desktop_config.json
:
Docker with IAM Access Keys
Docker with AWS SSO
NPX with IAM Access Keys
NPX with AWS SSO
Local Repository (from cloned/built repo)
Building
Docker:
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
This README assumes that your server package is named @modelcontextprotocol/server-aws-kb-retrieval
. Adjust the package name and installation details if they differ in your setup. Also, ensure that your server script is correctly built and that all dependencies are properly managed in your package.json
.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
An MCP server that enables users to retrieve information from AWS Knowledge Bases using RAG (Retrieval-Augmented Generation) via Bedrock Agent Runtime.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server that enables AI models to retrieve information from Ragie's knowledge base through a simple 'retrieve' tool.Last updated -12956JavaScriptMIT License
- -securityFlicense-qualityAn advanced MCP server providing RAG-enabled memory through a knowledge graph with vector search capabilities, enabling intelligent information storage, semantic retrieval, and document processing.Last updated -3213TypeScript
- -securityAlicense-qualityA server that integrates Retrieval-Augmented Generation (RAG) with the Model Control Protocol (MCP) to provide web search capabilities and document analysis for AI assistants.Last updated -1PythonApache 2.0
- -securityFlicense-qualityAn MCP server that implements Retrieval-Augmented Generation to efficiently retrieve and process important information from various sources, providing accurate and contextually relevant responses.Last updated -Python