Cloud A2A和MCP快速入门
利用云形成脚本和模板创建具有示例A2A和MCP服务的可扩展服务器。
特性
对于每个云基础设施,脚本可以使用VPC、NAT、缓存、可扩展数据库、可扩展 计算、本地安全和不同的AI模型提供商。
展示 通用身份验证 使用DID、JWT和标准HTTPS标头。
A2A和MCP服务是使用Node.js用Javascript/Typescript编写的,并且已经抽象 存储映射到云原生数据存储。
示例A2A试剂包括:
- Venture:了解初创公司并帮助该初创公司找到合适的技术提供商、资本合作伙伴、团队成员和联合创始人的代理人。
- 商业匹配:一个MCP,了解所有企业和可能想与之合作的人,并建议建立联系。
- 志愿者:了解志愿者并帮助他们找到志愿服务机会的代理人
- 慈善机构:了解慈善机构并帮助他们找到志愿者的代理人
- 声誉:了解人们和商业声誉的MCP
- 志愿者比赛:一个了解志愿者和慈善机构并建议比赛的MCP
演示网站使用React编写,并转换为可以部署的静态网站 到边缘缓存服务。
云提供商
支持各种云提供商:
- AWS: 在AWS上进行简单部署 使用 CloudFormation
发展
通过这些依赖关系支持本地开发:
- 版本控制系统
- Node.js 22+
- 雷迪斯
快速启动
- 确保Redis已安装并正在运行
- 安装Redis
- 在本地启动Redis
redis-server- 克隆仓库并将dir更改为它
git clone git@github.com:agentic-profile/cloud-a2a-mcp-quickstart.git
cd cloud-a2a-mcp-quickstart- 在本地启动网站服务
cd website
npm install
npm run dev- 在本地启动A2A和MCP服务器
cd service
npm install
npm run dev- 用浏览器打开网站,访问http://localhost:5173
示例用法:
- 创建代理配置文件,以便您的代理可以进行身份验证
- 单击“设置”,然后单击数字身份行上的“管理” - 输入您的姓名,然后单击“创建数字身份”
- 单击导航栏中的MCP
- 点击位置下的“测试”按钮 - 点击“更新位置”
云部署
网站和服务项目的设计是通用的,易于在云基础设施上部署。
目前 AWS CloudFormation脚本 其他云提供商(如Google cloud和Azure)应该易于实施。
项目结构
├── aws/ # AWS deployment scripts and CloudFormation templates
│ ├── agentic-foundation.yaml # Foundation infrastructure template
│ ├── agentic-service.yaml # Service deployment template
│ ├── agentic-website.yaml # Website deployment template
│ ├── deploy-service.sh # Service deployment script
│ ├── deploy-website.sh # Website deployment script
│ └── ssh-nat-instance.sh # NAT instance SSH script
├── service/ # A2A and MCP Backend service (Node.js/TypeScript)
│ ├── src/
│ │ ├── index.ts # Main Lambda function
│ │ ├── index.local.ts # Local development server
│ │ ├── router.ts # Express router with all endpoints
│ │ ├── a2a/ # A2A TaskHandler implementations
│ │ │ ├── hireme/ # HireMe task handlers
│ │ │ ├── venture/ # Venture task handlers
│ │ │ ├── vc/ # VC task handlers
│ │ │ ├── index.ts # A2A main exports
│ │ │ └── utils.ts # A2A utilities and middleware
│ │ ├── mcp/ # MCP protocol implementations
│ │ │ ├── location/ # Location-related MCP methods
│ │ │ ├── match/ # Matching MCP methods
│ │ │ └── utils.ts # MCP utilities
│ │ ├── json-rpc/ # JSON-RPC protocol handling
│ │ │ ├── auth.ts # Authentication
│ │ │ ├── index.ts # JSON-RPC main handler
│ │ │ ├── types.ts # Type definitions
│ │ │ └── utils.ts # JSON-RPC utilities
│ │ ├── cache/ # Redis caching layer
│ │ │ └── redis.ts # Redis client and utilities
│ │ ├── stores/ # Data storage abstractions
│ │ │ └── memory-store.ts # In-memory storage implementation
│ │ └── __tests__/ # Unit tests
│ ├── www/ # Static web files for the landing page
│ │ ├── index.html # Web interface HTML
│ │ └── images/ # Static images and icons
│ ├── docs/ # Service documentation
│ ├── scripts/ # Helper scripts
│ ├── examples/ # Usage examples
│ ├── dist/ # Compiled JavaScript output
│ ├── package.json
│ ├── tsconfig.json
│ └── jest.config.js
└── website/ # Frontend React application
├── src/
│ ├── App.tsx # Main React application
│ ├── main.tsx # Application entry point
│ ├── components/ # Reusable React components
│ ├── pages/ # Page components
│ │ ├── agents/ # Agent-related pages
│ │ └── mcp/ # MCP-related pages
│ ├── stores/ # State management (Zustand)
│ ├── assets/ # Static assets (images, etc.)
│ └── data/ # Static data files
├── public/ # Public static files
├── package.json
├── tsconfig.json
├── vite.config.ts
├── tailwind.config.js
└── postcss.config.js用于本地测试的有用CURL命令
健康检查
curl -X GET http://localhost:3000/statusMCP定位服务
# Tools List
curl -X POST http://localhost:3000/mcp/location \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# Location Update
curl -X POST http://localhost:3000/mcp/location \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":4,"method":"update","params":{"coords":{"latitude":35.6762,"longitude":139.6503}}}'
# Location Query
curl -X POST http://localhost:3000/mcp/location \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":5,"method":"query"}'A2A端点
# Venture TaskHandler
curl -X POST http://localhost:3000/a2a/venture \
-H 'Content-Type: application/json' \
-d '{"id":"1","method":"venture/create","params":{"name":"Test Venture","type":"startup"}}'