Skip to main content
Glama
sammcj

AWS Knowledge Base Retrieval MCP Server

by sammcj

AWS ナレッジベース取得 MCP サーバー

Bedrock エージェント ランタイムを使用して AWS ナレッジベースから情報を取得するための MCP サーバー実装。

特徴

  • RAG (Retrieval-Augmented Generation) : クエリとナレッジベース ID に基づいて、AWS ナレッジベースからコンテキストを取得します。

  • 複数の結果の取得をサポート: カスタマイズ可能な数の結果を取得するオプション。

Related MCP server: DuckDB-RAG-MCP-Sample

ツール

  • aws_kb から取得

    • AWS ナレッジベースを使用して取得操作を実行します。

    • 入力:

      • query (文字列): 取得のための検索クエリ。

      • knowledgeBaseId (文字列): AWS ナレッジベースの ID。

      • n (数値、オプション): 取得する結果の数 (デフォルト: 3)。

    • 応答形式:

      • 応答では、次の 2 つの個別のコンテンツ項目が返されます。

        • ナレッジ ベースからの生のコンテキストを含むテキスト項目。

        • メタデータ (ID、ファイル名、スニペット、スコア) を含む構造化 RAG ソースを含む JSON アイテム。

      • この分離により、結果をより柔軟に処理できるようになります。

構成

AWS認証情報の設定

AWS 認証情報を構成するには、次の 2 つのオプションがあります。

オプション1: IAMアクセスキー

  1. AWS マネジメントコンソールから AWS アクセスキー ID、シークレットアクセスキー、リージョンを取得します。

  2. これらの資格情報に、Bedrock エージェント ランタイム操作に対する適切な権限があることを確認します。

  3. 以下の設定例に示すように環境変数を設定します。

  4. 一時的な認証情報の場合は、 AWS_SESSION_TOKEN環境変数を使用してセッショントークンを提供することもできます。

オプション2: AWS SSO (シングルサインオン)

サーバーは AWS SSO 認証情報をサポートするようになりました。

  1. SSO プロファイルを使用して AWS CLI を設定します: aws configure sso

  2. MCP サーバー構成では、AWS_REGION 環境変数のみを設定します。

  3. サーバーは、SSO 資格情報を含むデフォルトの資格情報プロバイダー チェーンを使用します。

オプション: デフォルトのナレッジベース ID を構成する

オプションで、デフォルトで使用する 1 つ以上のナレッジ ベース ID を指定できます。

  1. JSON 形式でナレッジ ベース ID の配列を作成します。

  2. これを設定内の AWS_KB_IDS 環境変数として設定します。

  3. これを構成すると、 knowledgeBaseIdパラメータはツール内でオプションになります。

Claude Desktopでの使用

これをclaude_desktop_config.jsonに追加します:

IAM アクセスキーを使用した Docker

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

AWS SSO を使用した Docker

{
  "mcpServers": {
    "aws-kb-retrieval": {
      "command": "docker",
      "args": [ "run", "-i", "--rm", "-e", "AWS_REGION", "-e", "AWS_KB_IDS", "-v", "${HOME}/.aws:/root/.aws", "mcp/aws-kb-retrieval-server" ],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
        "AWS_SESSION_TOKEN": "YOUR_OPTIONAL_SESSION_ID_FOR_SSO_TEMPORARY_CREDENTIALS_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE",
        "AWS_KB_IDS": "[\"kb-12345\", \"kb-67890\"]"
      }
    }
  }
}

IAM アクセスキーを使用した NPX

{
  "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_SESSION_TOKEN": "YOUR_OPTIONAL_SESSION_ID_FOR_SSO_TEMPORARY_CREDENTIALS_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE",
        "AWS_KB_IDS": "[\"kb-12345\", \"kb-67890\"]"
      }
    }
  }
}

AWS SSO を使用した NPX

{
  "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_SESSION_TOKEN": "YOUR_OPTIONAL_SESSION_ID_FOR_SSO_TEMPORARY_CREDENTIALS_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE",
        "AWS_KB_IDS": "[\"kb-12345\", \"kb-67890\"]"
      }
    }
  }
}

ローカルリポジトリ(クローン/ビルドされたリポジトリから)

{
  "mcpServers": {
    "aws-kb": {
      "command": "node",
      "args": [
        "/path/to/mcp-aws-kb/dist/index.js"
      ],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
        "AWS_SESSION_TOKEN": "YOUR_OPTIONAL_SESSION_ID_FOR_SSO_TEMPORARY_CREDENTIALS_HERE",
        "AWS_REGION": "YOUR_AWS_REGION_HERE",
        "AWS_KB_IDS": "[\"kb-12345\", \"kb-67890\"]"
      },
      "disabled": false,
      "autoApprove": [
        "retrieve_from_aws_kb"
      ],
      "timeout": 120
    }
  }
}

建物

ドッカー:

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

ライセンス

このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。

このREADMEでは、サーバーパッケージの名前が@modelcontextprotocol/server-aws-kb-retrievalであることを前提としています。パッケージ名とインストールの詳細が異なる場合は、設定に合わせて調整してください。また、サーバースクリプトが正しくビルドされていること、およびすべての依存関係がpackage.jsonで適切に管理されていることを確認してください。

Available Tools

1 tool
retrieve_from_aws_kbC

Performs retrieval from the AWS Knowledge Base using the provided query and Knowledge Base ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe query to perform retrieval on
knowledgeBaseIdYesThe ID of the AWS Knowledge Base
nNoNumber of results to retrieve

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieval but fails to describe key traits like authentication requirements, rate limits, error handling, or what the retrieval entails (e.g., returns text snippets, metadata). This leaves significant gaps in understanding how the tool behaves in practice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function and inputs without any fluff. It's front-loaded with the core purpose and appropriately sized for the task, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the retrieval returns (e.g., format, content), error conditions, or operational details like latency or costs. For a tool with 3 parameters and missing structured data, this leaves the agent under-informed about critical context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters (query, knowledgeBaseId, n). The description adds no additional meaning beyond what's in the schema, such as examples or constraints. This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('performs retrieval') and the resource ('from the AWS Knowledge Base'), making the purpose immediately understandable. It specifies the required inputs (query and Knowledge Base ID), which helps distinguish it from generic retrieval tools. However, without sibling tools, it doesn't need to differentiate further, so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. It merely states what the tool does without indicating appropriate scenarios or limitations, leaving the agent without usage direction.

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. 1 tool update
    • First observedretrieve_from_aws_kb

TDQS

B3.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.

Naming Consistency5/5

A single tool inherently has perfect naming consistency, as there are no other tools to compare it against for patterns or conventions.

Tool Count2/5

One tool is too few for a server focused on AWS Knowledge Base retrieval, as it lacks essential operations like listing knowledge bases, managing queries, or handling configurations, making the scope feel incomplete and limiting.

Completeness2/5

The tool set is severely incomplete for the domain of AWS Knowledge Base operations. It only provides retrieval, missing critical functions such as creating, updating, or deleting knowledge base entries, which are necessary for a full workflow.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers