home / mcp / kk-bedrock-agent-hub mcp server

kk-bedrock-agent-hub MCP Server

Provides a Bedrock knowledge base search tool via the Retrieve API for AI assistants.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kawanishi0117-kk-mcp": {
      "command": "python",
      "args": [
        "/path/to/mcp-bedrock-kb/kb_mcp_server.py"
      ],
      "env": {
        "AWS_REGION": "ap-northeast-1",
        "AWS_PROFILE": "default",
        "BEDROCK_KB_ID": "your-kb-id"
      }
    }
  }
}

You run a small MCP server that lets AI assistants query an Amazon Bedrock Knowledge Base using the Retrieve API. It returns relevant knowledge base chunks, including content, their location, and a relevance score, so you can surface precise information to users without generating answers itself.

How to use

You run the server locally or in your environment and connect client applications (Claude Desktop, Cursor, Kiro, or your own MCP client) to request knowledge base results. Use the kb_answer tool through your MCP client to submit queries and receive structured results that include the chunk text, where it came from, and a score indicating relevance. Keep in mind this server performs pure search and does not generate responses.

How to install

Prerequisites you need before installation: Python 3.8+ and Git. You should have pip available to install Python dependencies.

# Linux/macOS
sudo apt-get update
sudo apt-get install -y python3 python3-venv git

# Optional: create a virtual environment
python3 -m venv venv
source venv/bin/activate
```
```bash
# Clone the project
git clone https://github.com/kawanishi0117/mcp-bedrock-kb.git
cd mcp-bedrock-kb

# Install dependencies in editable mode
pip install -e .
```
```bash
# Direct pip install from the repository (alternative)
pip install git+https://github.com/kawanishi0117/mcp-bedrock-kb.git

Additional setup and configuration

Set up environment variables that the server relies on to identify the knowledge base and AWS region. At minimum you must provide BEDROCK_KB_ID. You may also configure AWS_REGION and AWS_PROFILE if you operate within AWS contexts.

# Linux/macOS
export BEDROCK_KB_ID="your-knowledge-base-id"
export AWS_REGION="ap-northeast-1"  # optional, defaults to ap-northeast-1 if not set
export AWS_PROFILE="default"        # optional

# Windows PowerShell
$env:BEDROCK_KB_ID = "your-knowledge-base-id"
$env:AWS_REGION = "ap-northeast-1"
$env:AWS_PROFILE = "default"

Client configuration example (MCP)

Configure your MCP client to launch the server and supply the necessary environment variable. Each client may store the MCP server configuration in its own JSON-like settings file.

{
  "mcpServers": {
    "kk-bedrock-agent-hub-mcp": {
      "command": "python",
      "args": ["kb_mcp_server.py"],
      "env": {
        "BEDROCK_KB_ID": "your-kb-id",
        "AWS_REGION": "ap-northeast-1",
        "AWS_PROFILE": "your-profile-name"
      }
    }
  }
}

Running the server

You can run the server directly from source or via the installed entry point. Choose the approach that matches how you installed the software.

# Direct from source
python kb_mcp_server.py
```
```bash
# After installation via pip, use the CLI entry point
bedrock-kb-mcp

Available tools

kb_answer

Retrieves knowledge base content by querying Bedrock using the Retrieve API and returns content chunks with their location and score for downstream processing.