AWS Knowledge Base Retrieval MCP Server
AWS 知识库检索 MCP 服务器
使用 Bedrock Agent Runtime 从 AWS 知识库检索信息的 MCP 服务器实现。
特征
RAG(检索增强生成) :根据查询和知识库 ID 从 AWS 知识库检索上下文。
支持多个结果检索:可选择检索自定义数量的结果。
Related MCP server: DuckDB-RAG-MCP-Sample
工具
从 aws_kb 检索
使用 AWS 知识库执行检索操作。
输入:
query(字符串):用于检索的搜索查询。knowledgeBaseId(字符串):AWS 知识库的 ID。n(数字,可选):要检索的结果数(默认值:3)。
响应格式:
响应现在返回两个单独的内容项:
包含来自知识库的原始上下文的文本项。
包含具有元数据(id、fileName、snippet 和 score)的结构化 RAG 源的 JSON 项。
这种分离使得结果的处理更加灵活。
配置
设置AWS凭证
您有两种配置 AWS 凭证的选项:
选项 1:IAM 访问密钥
从 AWS 管理控制台获取 AWS 访问密钥 ID、秘密访问密钥和区域。
确保这些凭据具有 Bedrock Agent Runtime 操作的适当权限。
按照下面的配置示例所示设置环境变量。
对于临时凭证,您还可以使用
AWS_SESSION_TOKEN环境变量提供会话令牌。
选项 2:AWS SSO(单点登录)
该服务器现在支持 AWS SSO 凭证:
使用您的 SSO 配置文件配置 AWS CLI:
aws configure sso仅设置 MCP 服务器配置中的 AWS_REGION 环境变量。
服务器将使用默认凭证提供程序链,其中包括 SSO 凭证。
可选:配置默认知识库 ID
您可以选择指定一个或多个默认使用的知识库 ID:
创建 JSON 格式的知识库 ID 数组。
在您的配置中将其设置为 AWS_KB_IDS 环境变量。
配置完成后,
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\"]"
}
}
}
}Docker 与 AWS SSO
{
"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\"]"
}
}
}
}NPX 与 AWS SSO
{
"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:
docker build -t mcp/aws-kb-retrieval -f src/aws-kb-retrieval-server/Dockerfile .执照
此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。
本自述文件假定您的服务器软件包名为@modelcontextprotocol/server-aws-kb-retrieval 。如果您的设置与软件包名称和安装详细信息不同,请调整它们。此外,请确保您的服务器脚本已正确构建,并且所有依赖项均已在package.json中得到妥善管理。
Available Tools
1 toolretrieve_from_aws_kbC
Performs retrieval from the AWS Knowledge Base using the provided query and Knowledge Base ID.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The query to perform retrieval on | |
| knowledgeBaseId | Yes | The ID of the AWS Knowledge Base | |
| n | No | Number of results to retrieve |
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 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.
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.
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.
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.
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.
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 tool update
- First observed
retrieve_from_aws_kb
TDQS
Scored across 1 tool
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.
A single tool inherently has perfect naming consistency, as there are no other tools to compare it against for patterns or conventions.
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.
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
Related MCP Connectors
The AWS Knowledge MCP server is a fully managed remote Model Context Protocol server that provides real-time access to official AWS content in an LLM-compatible format. It offers structured access to AWS documentation, code samples, blog posts, What's New announcements, Well-Architected best practices, and regional availability information for AWS APIs and CloudFormation resources. Key capabilities include searching and reading documentation in markdown format, getting content recommendations, listing AWS regions, and checking regional availability for services and features.
MCP server for AI dialogue using various LLM models via AceDataCloud
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server that enables AI models to retrieve information from Ragie's knowledge base through a simple 'retrieve' tool.134 npm91MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables RAG (Retrieval-Augmented Generation) on markdown documents by converting them to embedding vectors and performing vector search using DuckDB.4Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server that implements Retrieval-Augmented Generation to efficiently retrieve and process important information from various sources, providing accurate and contextually relevant responses.-
- FlicenseNot gradedqualityDmaintenanceAn MCP server integrating LangChain, RAG, and Agent to provide knowledge retrieval and tool invocation through natural language.-