The AWS Knowledge Base Retrieval MCP Server provides access to AWS Knowledge Base information through Bedrock Agent Runtime, enabling retrieval-augmented generation (RAG) capabilities for Claude and other AI models that support the Model Context Protocol.
You can run the MCP server using Docker with either IAM Access Keys or AWS SSO authentication.
{
"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\"]"
}
}
}
}
{
"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_REGION": "YOUR_AWS_REGION_HERE",
"AWS_KB_IDS": "[\"kb-12345\", \"kb-67890\"]"
}
}
}
}
Alternatively, you can install and run the server using 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-retrieval": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-aws-kb-retrieval"
],
"env": {
"AWS_REGION": "YOUR_AWS_REGION_HERE",
"AWS_KB_IDS": "[\"kb-12345\", \"kb-67890\"]"
}
}
}
}
If you've cloned and built the repository locally:
{
"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
}
}
}
AWS_SESSION_TOKEN
aws configure sso
AWS_REGION
environment variable in the MCP server configurationYou can specify default knowledge base IDs to use with the retrieval tool:
AWS_KB_IDS
environment variable in your configurationknowledgeBaseId
parameter becomes optional when using the toolThe server provides a tool called retrieve_from_aws_kb
with the following parameters:
query
(string): The search query for retrievalknowledgeBaseId
(string): The ID of the AWS Knowledge Basen
(number, optional): Number of results to retrieve (default: 3)The response returns two items:
If you need to build the Docker image from source:
docker build -t mcp/aws-kb-retrieval -f src/aws-kb-retrieval-server/Dockerfile .
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "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\"]"}}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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\"]"
}
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"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\"]"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect