本项目是一个基于 Model Context Protocol (MCP) 的服务,专为大型语言模型 (LLMs) 提供多运行时 AWS Lambda Powertools 文档的搜索功能,能高效检索并呈现相关文档内容,助力用户快速获取所需信息。
若你使用 Claude Desktop,可按照 Claude Desktop 用户的 Model Context Protocol 快速开始指南 进行安装。你需要在 MCP 配置文件中添加如下内容:
{
"mcpServers": {
"powertools": {
"command": "npx",
"args": [
"-y",
"@serverless-dna/powertools-mcp"
]
}
}
}
# 安装依赖项
pnpm install
# 构建项目
pnpm build
该服务器可作为 MCP 服务运行,通过 stdio 进行通信:
npx -y @serverless-dna/powertools-mcp
服务器提供了 search_docs 工具,可使用以下参数进行搜索:
search: 搜索查询字符串runtime: Powertools 的运行时(python、typescript、java、dotnet)version: 可选版本号(默认为 'latest')src/:源代码目录
index.ts:主服务器实现文件searchIndex.ts:搜索索引管理文件indexes/:存放每个运行时的预建 lunr.js 搜索索引dist/:编译输出目录pnpm build
pnpm test
在开发期间,你可以使用以下配置在 Claude Desktop 上运行 MCP 服务器。以下示例展示了在 Windows 系统上使用 WSL(Windows Subsystem for Linux)进行开发的情况,Mac 或 Linux 环境可参照操作。输出是一个捆绑文件,可启用 Windows 中安装的 Node 来运行 MCP 服务器,因为所有依赖项都已打包。
{
"mcpServers": {
"powertools": {
"command": "node",
"args": [
"\\\\wsl$\\Ubuntu\\home\\walmsles\\dev\\serverless-dna\\powertools-mcp\\dist\\bundle.js"
]
}
}
}
本项目采用 MIT 许可证。