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-mcpfind 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: Amazon Bedrock Knowledge Base MCP Server
機能
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 から関連ドキュメントを検索する。 回答生成は行わず、検索結果のみを返す。
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Knowledge Base に送信する検索クエリ文字列 | |
| max_results | No | 取得するソースチャンクの最大数(デフォルト: 4、範囲: 1-10) |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool uses the Retrieve API and only returns search results (no answer generation). This is clear, though it could mention that the operation is read-only and does not modify any data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short, front-loaded sentences that convey purpose and behavior without unnecessary detail. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 parameters, clear purpose) and the presence of an output schema (which covers return structure), the description is complete enough. It explains what the tool returns (relevant document chunks) and its non-generative nature.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters adequately. The description does not add additional meaning beyond what is in the schema (e.g., constraints or context for max_results range). Baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches Amazon Bedrock Knowledge Base and returns relevant document chunks. It explicitly distinguishes itself from generative tools by stating it does not generate answers (回答生成は行わず、検索結果のみを返す).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for retrieval-only queries, but it does not provide explicit guidance on when not to use or alternatives. Since there are no sibling tools, the lack of exclusion is acceptable, but it could be more explicit about prerequisites or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
kb_answer
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
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Query InterviewFlowAI candidate and interview data from MCP-compatible AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search through structured databases and unstructured content (documents, videos, files) using natural language queries with semantic understanding.MIT
- 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 gradedqualityCmaintenanceEnables searching a knowledge base and asking grounded questions with hybrid retrieval, reranking, and cited answers.-