ghost-dev-mcp
An MCP server on AWS Lambda that gives AI assistants read-only access to SQS dead-letter queues and CloudWatch logs for fast incident triage.
README
AWS Ghost Developer — MCP Serverless Agent
Version: 1.0
An MCP (Model Context Protocol) server running on AWS Lambda that acts as a secure proxy between an AI assistant (Claude, Cursor) and your AWS infrastructure. It gives the AI read-only access to your systems so it can help investigate incidents without needing human copy-paste of logs.
What it does (v1.0)
This version focuses on triage — collecting raw data from two sources fast enough that an AI can summarize what is failing and where.
| Tool | What it answers |
|---|---|
list_dlqs |
"Which Dead Letter Queues have messages piling up?" |
inspect_dlq_payload |
"What do those failed messages look like?" |
search_log_groups |
"Which CloudWatch log groups exist for this service?" |
get_error_traces |
"What errors appeared in these log groups recently?" |
Honest scope
v1.0 helps an AI identify symptoms (error messages, failed payloads) but does not determine root cause automatically. It is most useful for:
- On-call triage at odd hours — reduce time-to-data from 30+ minutes to under a minute
- Letting a junior engineer hand off context to an AI before escalating
- Situations where copy-pasting logs manually is the main bottleneck
It does not (yet) cover: X-Ray service maps, deployment correlation, infrastructure metrics.
Architecture
Claude / Cursor
│ HTTPS + x-api-key header
▼
API Gateway (HTTP API)
│
▼ Lambda Authorizer (validates API key via Secrets Manager)
▼
Lambda: mcp-router
├── SQS → list_dlqs, inspect_dlq_payload
└── Logs → search_log_groups, get_error_traces
Two CloudFormation stacks:
aws-ghost-developer-secrets-{env}— manages the API key in Secrets Manageraws-ghost-developer-{env}— Lambda, API Gateway, IAM roles (deployed via SAM)
Prerequisites
- AWS CLI configured (
aws configure) - AWS SAM CLI (
pip install aws-sam-cli) - Python 3.12+
openssl(available on macOS/Linux by default; on Windows use Git Bash or WSL)
Setup
1. Clone and install dependencies
git clone <repo-url>
cd aws-ghost-developer
pip install -r requirements.txt
2. Configure region in samconfig.toml
Open samconfig.toml and update the region to match where you want to deploy:
[default.deploy.parameters]
region = "ap-southeast-1" # change this to your target region
Note:
bootstrap.shreadsAWS_DEFAULT_REGIONat runtime, butsam deployalso picks upregionfromsamconfig.toml. Keep them in sync to avoid deploying to the wrong region.
3. Run bootstrap (one command does everything)
export AWS_DEFAULT_REGION=ap-southeast-1 # must match samconfig.toml
./scripts/bootstrap.sh prod
This will:
- Generate a cryptographically secure API key
- Deploy
infra/secrets.yamlto store the key in Secrets Manager - Build and deploy the SAM stack
- Print the MCP endpoint URL and config snippet
For other environments:
./scripts/bootstrap.sh dev
./scripts/bootstrap.sh staging
At the end you will see output like:
{
"mcpServers": {
"aws-ghost-developer": {
"url": "https://<api-id>.execute-api.ap-southeast-1.amazonaws.com/mcp",
"transport": "http",
"headers": {
"x-api-key": "<generated-key>"
}
}
}
}
Copy the url and x-api-key values — you will need them in the next step.
4. Add to your MCP client
Claude Code CLI (recommended)
claude mcp add --transport http aws-ghost-developer \
https://<api-id>.execute-api.<region>.amazonaws.com/mcp \
--header "x-api-key:<your-generated-key>"
Verify it was added:
claude mcp get aws-ghost-developer
Claude Desktop (macOS)
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"aws-ghost-developer": {
"url": "https://<api-id>.execute-api.<region>.amazonaws.com/mcp",
"transport": "http",
"headers": {
"x-api-key": "<your-generated-key>"
}
}
}
}
Cursor
Edit .cursor/mcp.json in your project root (or the global Cursor MCP config):
{
"mcpServers": {
"aws-ghost-developer": {
"url": "https://<api-id>.execute-api.<region>.amazonaws.com/mcp",
"transport": "http",
"headers": {
"x-api-key": "<your-generated-key>"
}
}
}
}
Usage examples
Once connected, you can ask the AI naturally:
"Check if there are any failed messages in our SQS queues for the payment service"
"Look at the dead letter queue for order-processor and tell me what's failing"
"Find the CloudWatch logs for the auth service and show me errors from the last hour"
"Search log groups for 'checkout' and query them for 5xx errors in the last 30 minutes"
Project structure
aws-ghost-developer/
├── src/
│ ├── handler.py # Lambda entrypoint, MCP JSON-RPC router
│ ├── authorizer.py # Lambda authorizer — validates x-api-key
│ ├── transport/
│ │ └── sse.py # MCP response/error formatters
│ ├── tools/
│ │ ├── __init__.py # Tool registry
│ │ ├── list_dlqs.py # List SQS Dead Letter Queues
│ │ ├── inspect_dlq.py # Peek at DLQ messages
│ │ ├── search_log_groups.py # Discover CloudWatch log groups
│ │ └── get_error_traces.py # Query Logs Insights (async-safe)
│ └── utils/
│ ├── redact.py # Auto-redact secrets from responses
│ └── secrets.py # Secrets Manager wrapper with TTL cache
├── infra/
│ └── secrets.yaml # CloudFormation — Secrets Manager stack
├── scripts/
│ ├── bootstrap.sh # Full setup: secrets + SAM deploy
│ └── gen-secret.sh # Secrets only (for key rotation)
├── tests/
│ └── unit/
├── template.yaml # SAM template — Lambda + API Gateway
├── samconfig.toml # SAM deploy defaults
└── requirements.txt
Security
- All tools are read-only. No write/delete permissions are granted.
- API key is stored in AWS Secrets Manager, never in environment variables.
- The Lambda authorizer validates every request using constant-time comparison.
- IAM role follows least-privilege — each permission is scoped to the minimum required action.
- DLQ messages are peeked with a 30-second visibility timeout and never deleted.
- Sensitive values (passwords, tokens) in message payloads are automatically redacted before being returned to the AI.
Rotating the API key
./scripts/gen-secret.sh prod
Then update mcp_config.json with the new key. No redeployment needed.
Running tests
pip install pytest
python -m pytest tests/unit/ -v
Roadmap
v1.0 covers triage. Planned for future versions:
- v1.1 — X-Ray service map (
get_service_map) to trace which service in a chain is failing - v1.2 — Deployment correlation (
get_recent_deployments) via CloudTrail to link errors to releases - v2.0 — Multi-region support, structured RCA report generation
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。