使用说明
🎬 演示
看看它在行动!以下是通过自然语言提示将完整的EC2设置(VPC、子网、安全组,这是可行的)旋转到AI模型上下文协议(MCP)服务器是多么容易。
✨ 特性
目前支持
- 关系型数据库服务
- 第3页
- EC2
- 垂直路径计算机
- 子网
- 互联网网关
- 路由表
- 安全组
- 密钥对
- 实例标签
- 急性心肌梗死
更多AWS服务(如Lambda、API网关等)即将推出!欢迎捐款🚀
📋 先决条件
发展:
- Node.js >= 18.0.0
- pnpm >= 10.0.0
对于Docker部署:
- 码头工人 和 Docker Compose
对于两者:
- AWS帐户 使用AWS凭据(访问密钥ID和秘密访问密钥)
⚙️ 开发人员设置
1.克隆仓库
git clone https://github.com/lokeswaran-aj/aws-mcp.git
cd aws-mcp
❗️目前,服务器从MCP配置标头中读取凭据。在未来的版本中,我们将支持AWS角色ARN。
2.安装依赖项
pnpm install
💡 确保你有
pnpm全球安装。如果没有:npm install -g pnpm
3.运行开发服务器
pnpm dev
🐳 Docker部署
Docker快速入门
选项1:使用Docker Compose(推荐)
docker-compose up -d
选项2:直接使用Docker
# Build the image
docker build -t aws-mcp .
# Run with port mapping
docker run -d --name aws-mcp-server -p 8080:8080 aws-mcp
服务器将在以下位置可用:
- MCP HTTP流:
http://localhost:8080/mcp - MCP SSE:
http://localhost:8080/sse
管理Docker容器
# View logs
docker-compose logs -f
# Stop container
docker-compose down
# Rebuild and restart
docker-compose build --no-cache && docker-compose up -d
# Stop aws-mcp-server and remove container
docker stop aws-mcp-server && docker rm aws-mcp-server
💡 AWS凭据仍然通过HTTP标头传递(与开发设置相同)。不需要容器配置。
🧪 示例:光标配置
使用此服务器 光标,将以下内容添加到您的 ~/.cursor/mcp.json:
{
"mcpServers": {
"aws": {
"serverUrl": "http://localhost:8080/mcp",
"headers": {
"AWS_ACCESS_KEY_ID": "YOUR_AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY": "YOUR_AWS_SECRET_ACCESS_KEY",
"AWS_SESSION_TOKEN": "YOUR_AWS_SESSION_TOKEN"
}
}
}
}
❗️ Use
http://localhost:8080/mcp如果您的客户端支持HTTP流式传输(例如:Cursor)。使用http://localhost:8080/sse如果您的客户仅支持SSE(例如:Windsurf)。
MCP HTTP可流式传输端点: http://localhost:8080/mcp
MCP SSE端点: http://localhost:8080/sse
📁 项目结构
.
├── src/
│ ├── server.ts # AWS MCP server setup - Entry point
│ ├── aws-clients.ts # AWS SDK client setup
│ ├── config/ # App configuration
│ ├── tools/ # Tools definitions
│ │ ├── rds/ # RDS operations
│ │ ├── s3/ # S3 operations
│ │ ├── ec2/ # EC2 operations
│ │ ├── vpc/ # VPC operations
│ │ ├── subnet/ # Subnet operations
│ │ ├── internet-gateway/ # Internet Gateway operations
│ │ ├── route-table/ # Route Table operations
│ │ ├── security-group/ # Security Group operations
│ │ ├── key-pair/ # Key Pair operations
│ │ ├── instance-tag/ # Instance Tag operations
│ │ ├── ami/ # AMI operations
│ ├── schema/ # Tool input schemas
│ ├── types/ # TypeScript definitions
│ └── utils/ # Helper functions
├── package.json # Dependencies and scripts
└── README.md # This file
📌 路线图
- [x] 支持RDS(创建、列表、更新、删除)
- [x] 添加S3工具
- [x] 添加网络工具
- [x] 添加EC2工具
- []添加Lambda工具
- []添加API网关工具
- []添加IAM工具
- []添加ECS工具
🤝 贡献
想帮助将AWS infrachat设置为本机吗? 欢迎拉取请求、反馈和功能建议!
- 克隆并分叉仓库
- 创建功能分支(
git checkout -b feat/add-ec2) - 承诺并推动
- 打开PR🙌
📄 许可证
麻省理工学院——做你想做的事,只要在适当的时候给予表扬。 ✌️
