
Peppa MCP Server on Lambda

2025.04.22
0
JavaScript票务系统资源管理娱乐功能
Peppa MCP Server on Lambda 是一个运行在 AWS Lambda 和 Amazon API Gateway 上的 Peppa MCP 服务器,无需额外的桥接组件或自定义传输。它利用 Streamable HTTP 传输协议,提供简单的架构和高效的服务。该服务器主要用于处理与 Peppa Pig 主题公园相关的资源查询和票务订购。
View on GitHub
Overview
基本能力
产品定位
Peppa MCP Server on Lambda 是一个基于 AWS Lambda 和 API Gateway 的轻量级 MCP 服务器,专注于提供 Peppa Pig 主题公园的票务和资源管理服务。
核心功能
- 资源查询:可以列出和读取 Peppa Pig 主题公园的开放时间段等资源。
- 票务订购:提供工具用于订购 Peppa Pig 主题公园的门票,支持指定时间段和数量。
- Streamable HTTP 传输:利用最新的 Streamable HTTP 传输协议,实现高效的通信。
适用场景
- 票务系统:用于查询 Peppa Pig 主题公园的开放时间段和订购门票。
- 资源管理:管理和查询 Peppa Pig 主题公园的相关资源。
工具列表
- order-tickets:用于订购 Peppa Pig 主题公园的门票,支持指定时间段和数量。
常见问题解答
- API Gateway 端点启动时间:可能需要几秒钟才能完全启动并运行。
使用教程
使用依赖
- AWS CLI:用于与 AWS 服务交互。
- Terraform:用于基础设施的部署和管理。
安装教程
- 安装依赖:
cd src
npm install
cd ..
- 启动服务器并设置环境变量:
cd terraform
terraform init
terraform plan
terraform apply
export PEPPA_MCP_SERVER_ENDPOINT=$(terraform output --raw endpoint_url)
cd ..
- 运行客户端:
node src/client.js
调试方式
- 观察客户端输出:
> node client.js
listResources response: {
resources: [
{
uri: 'peppa://timeslots',
name: 'timeslots',
description: 'Use this resource to get all open timeslots for ordering tickets to the Peppa Pig Theme Park.',
mimeType: 'text/plain'
}
]
}
readResource response: {
contents: [
{
uri: 'peppa://timeslots',
mimeType: 'text/plain',
text: 'Available timeslots are: April 19th 2025, April 20th 2025, April 21st 2025'
}
]
}
listTools response: {
tools: [
{
name: 'order-tickets',
description: 'Use this tool to order tickets to the Peppa Pig Park. The tool expects two parameters - timeslot and quantity. The timeslot should be a stringified date. The quantity should be a number. Example: order-tickets(timeslot: "April 19, 2025", quantity: 3) The tool will return a text message with the order number. ',
inputSchema: [Object]
}
]
}
callTool response: {
content: [
{
type: 'text',
text: "You've ordered 3 tickets for April 19th, 2025. Your order number is OINK-1234."
}
]
}