AWS MCP Gateway

AWS MCP Gateway

A minimal, security-focused MCP gateway for connecting ChatGPT to AWS account data through explicit, read-only tools.

Category
访问服务器

README

AWS MCP Gateway

A minimal, security-focused MCP gateway for connecting ChatGPT to AWS account data through explicit, read-only tools.

The initial goal is to expose AWS cost, inventory and observability data to ChatGPT without giving the model direct or generic access to AWS APIs. The gateway runs as a Cloudflare Worker, exposes an MCP endpoint over HTTPS and calls AWS APIs using tightly scoped credentials stored as Cloudflare secrets.

Goals

  • Provide a remote MCP endpoint for ChatGPT.
  • Start with read-only AWS tools for cost, EC2 inventory, CloudWatch alarms and recent log errors.
  • Keep the infrastructure small enough for personal use and low-cost operation.
  • Avoid over-engineering while preserving the minimum security controls required for AWS data access.
  • Keep the repository public-safe by storing all secrets outside Git.

Non-goals

  • No generic AWS CLI execution tool.
  • No arbitrary AWS API proxy.
  • No write or management operations in the MVP.
  • No dashboard or database in the initial version.
  • No Kubernetes, ECS, App Runner or long-running server requirement for the MVP.

Architecture

ChatGPT
  -> Remote MCP connector over HTTPS
  -> Cloudflare Worker MCP Gateway
  -> Explicit MCP tools
  -> AWS signed API requests
  -> AWS Cost Explorer, EC2, CloudWatch, CloudWatch Logs and Budgets

The Worker acts as a policy and translation layer. ChatGPT calls strongly typed MCP tools, and the Worker decides which AWS APIs are allowed to run.

Recommended stack

  • TypeScript
  • Cloudflare Workers
  • Cloudflare Workers KV for optional cache
  • Cloudflare Secrets for credentials and auth configuration
  • MCP SDK / Cloudflare Agents MCP helpers
  • aws4fetch or AWS SDK v3 for signed AWS requests
  • Zod for input validation
  • Wrangler for local development and deployment
  • GitHub Actions for CI

Security model

The MVP must remain read-only.

Required controls:

  • MCP endpoint must require authentication.
  • AWS credentials must be stored only as Cloudflare secrets.
  • IAM permissions must be least-privilege and read-only.
  • Tools must be explicit and allowlisted.
  • Tool inputs must enforce date, region and result-size limits.
  • Cost Explorer calls must be cached to reduce cost and avoid repeated paid API calls.
  • Logs and errors must never expose secrets, AWS access keys, bearer tokens or raw stack traces.

Forbidden controls:

  • Do not commit .env, .dev.vars or real secrets.
  • Do not expose a run_aws_cli tool.
  • Do not expose a call_any_aws_api tool.
  • Do not add AWS write permissions in the MVP.

Initial MCP tools

The MVP should implement these tools first:

get_aws_cost_summary
get_aws_cost_by_service
list_ec2_instances
get_cloudwatch_alarms
get_recent_log_errors

Future read-only tools:

get_aws_daily_cost_trend
get_aws_cost_forecast
get_budget_status
list_rds_instances
list_lambda_functions
get_service_inventory

Management tools may be added later, but they must use a separate security model, separate IAM permissions and explicit confirmation requirements.

Environment variables and secrets

Use .env.example for documentation only. Real values must be configured with Wrangler.

Required secrets (configure with wrangler secret put)

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
MCP_AUTH_TOKEN

Required configuration (configure in wrangler.jsonc [vars])

{
  "vars": {
    "AWS_REGION": "us-east-1",
    "AWS_ALLOWED_REGIONS": "us-east-1,sa-east-1"
  }
}

These are operational configuration, not credentials. They are safe to commit and review.

Optional variables

APP_ENV=production
MCP_NAME=aws-mcp-gateway

Configure secrets with Wrangler

wrangler secret put AWS_ACCESS_KEY_ID
wrangler secret put AWS_SECRET_ACCESS_KEY
wrangler secret put MCP_AUTH_TOKEN

AWS IAM policy

The gateway requires a least-privilege IAM policy scoped to read-only actions. The canonical policy file is maintained at infra/aws/iam-readonly-policy.json.

See docs/aws-iam-setup.md for a complete walkthrough covering IAM user creation, policy attachment, access key generation, and credential storage in Cloudflare.

This template is intentionally narrow. Do not use AdministratorAccess or broad AWS-managed policies for the gateway.

Cost controls

The most important cost control is caching Cost Explorer responses.

Recommended cache TTLs:

Cost summary: 30-60 minutes
Cost by service: 30-60 minutes
EC2 inventory: 1-5 minutes
CloudWatch alarms: 1-5 minutes
Recent log errors: 1-5 minutes

Tool-level limits should reject overly broad requests before calling AWS.

Local development

Expected commands after scaffolding:

npm install
npm run typecheck
npm run test
wrangler dev

Deployment

Expected deployment flow:

wrangler secret put AWS_ACCESS_KEY_ID
wrangler secret put AWS_SECRET_ACCESS_KEY
wrangler secret put MCP_AUTH_TOKEN
wrangler deploy

The deployed MCP endpoint should look like:

https://aws-mcp-gateway.<account>.workers.dev/mcp

A custom domain can be added later, but it is not required for the MVP.

ChatGPT connection

The ChatGPT connector should point to the deployed HTTPS MCP endpoint:

https://<your-worker-domain>/mcp

The connector must authenticate before calling AWS-backed tools.

Repository safety

This repository is intended to be public-safe.

Safe to commit:

  • Source code
  • Tool schemas
  • Documentation
  • Example IAM policy templates
  • .env.example
  • Wrangler configuration without secrets

Never commit:

  • AWS access keys
  • Cloudflare API tokens
  • OAuth client secrets
  • Bearer tokens
  • .env
  • .dev.vars
  • .wrangler/

Roadmap

  1. Scaffold the Cloudflare Workers TypeScript project.
  2. Add a stateless MCP endpoint.
  3. Add authentication.
  4. Add AWS signed request client.
  5. Implement read-only cost and observability tools.
  6. Add KV caching.
  7. Add CI, tests and security documentation.
  8. Design future management mode without changing the MVP read-only security boundary.

Commit convention

Use conventional commits:

type(scope): message

Examples:

docs(readme): add setup instructions
feat(mcp): add stateless server endpoint
feat(aws): implement cost summary tool
security(auth): require bearer token for mcp endpoint

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选