The AWS Knowledge Base Retrieval MCP Server allows you to access and retrieve information from AWS Knowledge Bases using the Bedrock Agent Runtime. It implements the Model Context Protocol (MCP) to enable AI assistants to search and retrieve context from your AWS knowledge base.
Before installation, you'll need:
Add the MCP server configuration to your claude_desktop_config.json
file using one of the following methods:
{
"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"
}
}
}
}
To manually install in VS Code, add the server configuration to your User Settings (JSON) file:
Ctrl + Shift + P
and type Preferences: Open Settings (JSON)
{
"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}"
}
}
}
}
}
Alternatively, you can add this configuration to a file called .vscode/mcp.json
in your workspace (omit the mcp
root key in this case).
Once installed, you can use the AWS Knowledge Base Retrieval server through the following tool:
This tool performs retrieval operations using the AWS Knowledge Base.
Inputs:
query
(string): The search query for retrievalknowledgeBaseId
(string): The ID of the AWS Knowledge Basen
(number, optional): Number of results to retrieve (default: 3)Example usage:
When using Claude with the MCP server configured, you can ask it to retrieve information from your AWS Knowledge Base:
Please use the retrieve_from_aws_kb tool to search for information about EC2 instances in my AWS Knowledge Base with ID kb-12345abcde.
The AI assistant will then use the tool with appropriate parameters:
retrieve_from_aws_kb(
query: "EC2 instances",
knowledgeBaseId: "kb-12345abcde",
n: 3
)
The results retrieved from the AWS Knowledge Base will be incorporated into the AI assistant's response.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.