Simple Mcp Server On Lambda

Simple Mcp Server On Lambda

🚀 简单的Lambda上的MCP服务器

本项目是一个可在AWS Lambda和Amazon API Gateway上原生运行的简单MCP服务器,无需额外的桥接组件或自定义传输。这得益于v2025 - 03 - 26引入的可流式HTTP传输。不过要注意,这目前只是个原型。

架构图

架构尽可能简单,如下所示:

🚀 快速开始

✨ 主要特性

  • 可在AWS Lambda和Amazon API Gateway上原生运行。
  • 无需额外的桥接组件或自定义传输。

📦 安装指南

先决条件

  • AWS CLI
  • Terraform

安装步骤

  1. 安装依赖项
cd src
npm install
cd ..
  1. 引导服务器并设置带有MCP服务器端点的环境变量
cd terraform
terraform init
terraform plan
terraform apply
export SIMPLE_MCP_SERVER_ENDPOINT=$(terraform output --raw endpoint_url)
cd ..

⚠️ 重要提示

API Gateway端点可能需要几秒钟才能运行。

💻 使用示例

基础用法

  1. 运行客户端
node src/client.js
  1. 查看响应
> node client.js
> listTools response:  { tools: [ { name: 'ping', inputSchema: [Object] } ] }
> callTool:ping response:  { content: [ { type: 'text', text: 'pong' } ] }

📚 详细文档

  • 0 关注
  • 0 收藏,26 浏览
  • system 提出于 2025-10-05 21:54

相似服务问题

相关AI产品