kk-bedrock-agent-hub-mcp
Provides tools for querying Amazon Bedrock Knowledge Base using the Retrieve API, enabling search and retrieval of document chunks with content, location, and relevance scores.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kk-bedrock-agent-hub-mcp find our company's data retention policy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kk-bedrock-agent-hub-mcp
Amazon Bedrock Knowledge Base にクエリを送信する MCP (Model Context Protocol) サーバーです。
概要
kk-bedrock-agent-hub-mcp は、AI アシスタント(Claude Desktop、Cursor、Kiro)が Amazon Bedrock Knowledge Base から情報を取得できるようにする kb_answer ツールを提供します。
注意: このサーバーは Retrieve API を使用し、純粋な検索機能のみを提供します。回答生成(RetrieveAndGenerate)は行わず、基盤モデル ARN は不要です。
Related MCP server: rag-retrieval-mcp
機能
Bedrock Retrieve API を使用した Knowledge Base 検索
環境変数ベースの設定管理
検索結果(コンテンツ、ロケーション、スコア)の抽出と返却
入力バリデーション
環境変数
変数名 | 必須 | デフォルト | 説明 |
| いいえ |
| AWS リージョン |
| はい | - | Knowledge Base ID |
| いいえ | - | AWS 認証プロファイル |
環境変数の設定例
# Linux/macOS
export AWS_REGION="ap-northeast-1"
export BEDROCK_KB_ID="your-knowledge-base-id"
# Windows (PowerShell)
$env:AWS_REGION = "ap-northeast-1"
$env:BEDROCK_KB_ID = "your-knowledge-base-id"インストール
方法1: Git Clone(推奨)
# リポジトリをクローン
git clone https://github.com/kawanishi0117/mcp-bedrock-kb.git
cd mcp-bedrock-kb
# 依存関係をインストール
pip install -e .方法2: pip で直接インストール
pip install git+https://github.com/kawanishi0117/mcp-bedrock-kb.git使用方法
直接実行
python kb_mcp_server.pyコマンドラインから実行(pip インストール後)
bedrock-kb-mcpMCP クライアント設定
クローンしたディレクトリの絶対パスを指定してください。
Claude Desktop
claude_desktop_config.json に以下を追加:
{
"mcpServers": {
"kk-bedrock-agent-hub-mcp": {
"command": "python",
"args": ["/path/to/mcp-bedrock-kb/kb_mcp_server.py"],
"env": {
"BEDROCK_KB_ID": "your-kb-id"
}
}
}
}Cursor
.cursor/mcp.json に以下を追加:
{
"mcpServers": {
"kk-bedrock-agent-hub-mcp": {
"command": "python",
"args": ["/path/to/mcp-bedrock-kb/kb_mcp_server.py"],
"env": {
"BEDROCK_KB_ID": "your-kb-id"
}
}
}
}Kiro
~/.kiro/settings/mcp.json(グローバル)または .kiro/settings/mcp.json(ワークスペース)に以下を追加:
{
"mcpServers": {
"kk-bedrock-agent-hub-mcp": {
"command": "python",
"args": ["/path/to/mcp-bedrock-kb/kb_mcp_server.py"],
"env": {
"BEDROCK_KB_ID": "your-kb-id"
}
}
}
}Windows の場合
パスはスラッシュ / またはダブルバックスラッシュ \\ を使用:
{
"mcpServers": {
"kk-bedrock-agent-hub-mcp": {
"command": "python",
"args": ["C:/Users/username/mcp-bedrock-kb/kb_mcp_server.py"],
"env": {
"BEDROCK_KB_ID": "your-kb-id"
}
}
}
}AWS_PROFILE を使用する場合
AWS 認証プロファイルを指定する場合は AWS_PROFILE 環境変数を追加:
{
"mcpServers": {
"kk-bedrock-agent-hub-mcp": {
"command": "python",
"args": ["/path/to/mcp-bedrock-kb/kb_mcp_server.py"],
"env": {
"BEDROCK_KB_ID": "your-kb-id",
"AWS_PROFILE": "your-profile-name"
}
}
}
}kb_answer ツール
パラメータ
パラメータ | 型 | 必須 | デフォルト | 説明 |
| string | はい | - | Knowledge Base に送信するクエリ文字列 |
| integer | いいえ | 4 | 取得するソースチャンクの最大数(1-10) |
使用例
kb_answer("製品の返品ポリシーについて教えてください")
kb_answer("技術仕様を詳しく説明してください", max_results=8)レスポンス形式
検索結果は以下の形式で返されます:
{
"content": "ドキュメントチャンクのテキスト内容",
"location": {"s3Location": {...}, "type": "S3"},
"score": 0.85
}開発
テスト実行
pytestプロジェクト構造
bedrock-kb-mcp-server/
├── src/ # メインソースコード
│ ├── __init__.py
│ ├── bedrock_client.py # Bedrock API クライアント
│ ├── config.py # 環境変数からの設定読み込み
│ ├── models.py # データクラス
│ ├── parser.py # API レスポンスパーサー
│ ├── server.py # MCP サーバー実装
│ └── validation.py # 入力バリデーション
├── tests/ # テストコード
├── kb_mcp_server.py # メインエントリーポイント
├── pyproject.toml # プロジェクト設定
└── README.mdライセンス
MIT
Available Tools
1 toolkb_answerA
Amazon Bedrock Knowledge Base を検索し、関連するドキュメントチャンクを返す。
Retrieve API を使用して Knowledge Base から関連ドキュメントを検索する。 回答生成は行わず、検索結果のみを返す。
Inputs: query (required), max_results. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no risk of confusion or overlap. The tool's purpose is clear and distinct.
A single tool cannot be inconsistent; the verb_noun pattern 'kb_answer' is clear and follows common conventions.
The tool count of 1 is far too low for a server named 'hub', which implies a broader set of functionalities. A hub should offer multiple operations.
The server only provides a search/retrieve tool, missing essential operations like listing knowledge bases, managing chunks, or generating answers. The surface is severely incomplete.
Maintenance
Related MCP Connectors
Search your knowledge bases from any AI assistant using hybrid RAG.
Ingest, manage, and retrieve documents for RAG-powered AI applications
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables management of Amazon Bedrock Knowledge Bases including creation, data source configuration, document ingestion, and RAG (Retrieval-Augmented Generation) queries with support for multiple embedding models and custom parsing/chunking strategies.13MIT
- AlicenseBqualityDmaintenanceEnables retrieval-augmented generation by embedding queries with a chosen provider (e.g., OpenAI) and searching supported vector stores (Pinecone, pgvector) to return relevant content.1Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables searching a knowledge base and asking grounded questions with hybrid retrieval, reranking, and cited answers.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query documents in a Bedrock Knowledge Base through the MCP protocol, with tools for semantic search and agentic retrieval.MIT