MCP Connector

Retrieve AWS Knowledge Base Data

MCP server retrieving RAG context from an AWS Knowledge Base via Bedrock Agent Runtime.

Works with aws

Maintainer of this project? Claim this page to edit the listing.


76
Spark score
out of 100
Updated May 2025
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Leverage AWS Knowledge Base for RAG to retrieve relevant information. This asset enables context retrieval from your AWS KB based on user queries.

Outcomes

What it gets done

01

Connect to AWS Knowledge Base

02

Retrieve context using RAG

03

Customize number of results

04

Search AWS KB with provided query

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-aws-kb-retrieval | bash

Capabilities

Tools your agent gets

retrieve_from_aws_kb

Perform retrieval operations using the AWS Knowledge Base with customizable result count.

Overview

AWS KB Retrieval MCP Server

An MCP server that retrieves RAG context from an AWS Bedrock Knowledge Base given a query and Knowledge Base ID, installable via Docker or npx. Use when an AI assistant needs to ground answers in an existing AWS Knowledge Base via Bedrock Agent Runtime rather than a custom retrieval pipeline.

What it does

This is an MCP server implementation for retrieving information from an AWS Knowledge Base using the Bedrock Agent Runtime. It supports retrieval-augmented generation (RAG) - pulling context from an AWS Knowledge Base based on a query and a Knowledge Base ID - with a configurable number of results to retrieve.

When to use - and when NOT to

Use this connector when your AI assistant needs to ground its answers in documents already indexed in an AWS Knowledge Base, retrieved through Bedrock Agent Runtime rather than a custom retrieval pipeline. It is not a knowledge-base creation tool - it assumes the Knowledge Base and its ID already exist in AWS and only handles the retrieval side.

Capabilities

Exposes one tool, retrieve_from_aws_kb, which performs retrieval operations against the AWS Knowledge Base. Inputs: query (string, the search query), knowledgeBaseId (string, the ID of the AWS Knowledge Base), and n (number, optional, the number of results to retrieve, default 3).

How to install

Obtain an AWS access key ID, secret access key, and region from the AWS Management Console, ensuring the credentials have permissions for Bedrock Agent Runtime operations. For Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "aws-kb-retrieval": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "AWS_ACCESS_KEY_ID",
        "-e",
        "AWS_SECRET_ACCESS_KEY",
        "-e",
        "AWS_REGION",
        "mcp/aws-kb-retrieval-server"
      ],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE"
      }
    }
  }
}

An npx-based config (command: npx, args: ["-y", "@modelcontextprotocol/server-aws-kb-retrieval"]) is also supported with the same environment variables. For VS Code, one-click install buttons are provided for both NPX and Docker (stable and Insiders), or manual installation via User Settings (JSON) or a shared .vscode/mcp.json file (which omits the outer mcp key), using promptString inputs for the access key, secret key, and region so credentials aren't hardcoded. The Docker image can be built locally with docker build -t mcp/aws-kb-retrieval -f src/aws-kb-retrieval-server/Dockerfile .. This MCP server is MIT-licensed.

Who it's for

Teams already using AWS Bedrock Knowledge Bases who want their AI assistant (Claude Desktop, VS Code, or any MCP-compatible client) to retrieve grounded context from that existing knowledge base via a standard MCP tool call, without building a custom Bedrock Agent Runtime integration. Because credentials are passed as environment variables rather than baked into the server itself, the same Docker image or npx package can be pointed at different AWS accounts, regions, or Knowledge Base IDs simply by changing the config block - useful for teams running separate knowledge bases per project or environment (development vs. production) without maintaining separate server builds for each.

Source README

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).

Configuration

Setting up AWS Credentials

  1. Obtain AWS access key ID, secret access key, and region from the AWS Management Console.
  2. Ensure these credentials have appropriate permissions for Bedrock Agent Runtime operations.

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Docker
{
  "mcpServers": {
    "aws-kb-retrieval": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "AWS_ACCESS_KEY_ID",
        "-e",
        "AWS_SECRET_ACCESS_KEY",
        "-e",
        "AWS_REGION",
        "mcp/aws-kb-retrieval-server"
      ],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE"
      }
    }
  }
}
{
  "mcpServers": {
    "aws-kb-retrieval": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-aws-kb-retrieval"],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE"
      }
    }
  }
}

Usage with VS Code

For quick installation, use one of the one-click install buttons below...

Install with NPX in VS Code Install with NPX in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

Manual Installation

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is not needed in the .vscode/mcp.json file.

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "aws_access_key",
        "description": "AWS Access Key ID",
        "password": true
      },
      {
        "type": "promptString",
        "id": "aws_secret_key",
        "description": "AWS Secret Access Key",
        "password": true
      },
      {
        "type": "promptString",
        "id": "aws_region",
        "description": "AWS Region"
      }
    ],
    "servers": {
      "aws-kb-retrieval": {
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-aws-kb-retrieval"],
        "env": {
          "AWS_ACCESS_KEY_ID": "${input:aws_access_key}",
          "AWS_SECRET_ACCESS_KEY": "${input:aws_secret_key}",
          "AWS_REGION": "${input:aws_region}"
        }
      }
    }
  }
}

For Docker installation:

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "aws_access_key",
        "description": "AWS Access Key ID",
        "password": true
      },
      {
        "type": "promptString",
        "id": "aws_secret_key",
        "description": "AWS Secret Access Key",
        "password": true
      },
      {
        "type": "promptString",
        "id": "aws_region",
        "description": "AWS Region"
      }
    ],
    "servers": {
      "aws-kb-retrieval": {
        "command": "docker",
        "args": ["run", "-i", "--rm", "mcp/aws-kb-retrieval-server"],
        "env": {
          "AWS_ACCESS_KEY_ID": "${input:aws_access_key}",
          "AWS_SECRET_ACCESS_KEY": "${input:aws_secret_key}",
          "AWS_REGION": "${input:aws_region}"
        }
      }
    }
  }
}

Building

Docker:

docker build -t mcp/aws-kb-retrieval -f src/aws-kb-retrieval-server/Dockerfile .

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.