Skip to content

Latest commit

 

History

History

aws-kb-retrieval-server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

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 .

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.