AWS Bedrock AgentCore を活用した、ソリューション提案・構成図生成・見積もり計算エージェント。
3 つの MCP (Model Context Protocol) Server と連携し、AWS ソリューションの提案を統合的に行います。
| MCP Server | 機能 | 接続方式 |
|---|---|---|
| AWS Knowledge MCP Server | ベストプラクティス取得 | Remote MCP (Streamable HTTP) |
| AWS Diagram MCP Server | 構成図生成 | Lambda ラップ (stdio) |
| AWS Pricing MCP Server | 見積もり計算 | Lambda ラップ (stdio) |
オンプレミス
│ Direct Connect
▼
┌─────────────────────────────────────────────────────────┐
│ VPC (Private Isolated Subnet x 2AZ) │
│ │
│ ECS Express Mode (CfnExpressGatewayService) │
│ ┌─────────────────────────────────────────┐ │
│ │ ALB (自動管理) ──► Streamlit (8501) │ │
│ │ Auto Scaling / TG / SG / CW Logs 自動管理│ │
│ └─────────────────────────────────────────┘ │
│ │ │
│ VPC Endpoint │
│ (bedrock-agentcore) │
│ │ │
│ ┌──────────▼──────────┐ │
│ │ AgentCore Runtime │ │
│ │ (Direct Code Deploy)│ │
│ └──────────┬──────────┘ │
│ │ AWS 内部ネットワーク │
│ ┌──────────▼──────────┐ │
│ │ AgentCore Gateway │ │
│ │ (MCP + Semantic) │ │
│ └──┬────┬────┬───────┘ │
│ │ │ │ │
│ ┌───────┐ │ ┌─▼──┐ │ ┌────────┐ │
│ │Lambda │ │ │Lamb│ │ │Remote │ │
│ │Diagram│◄─┘ │Pric│ └─►│AWS │ │
│ │MCP │ │MCP │ │Knowledge│ │
│ └───────┘ └────┘ └────────┘ │
└─────────────────────────────────────────────────────────┘
aws-solution-agent/
├── agent/ # Strands Agent (BedrockAgentCoreApp)
│ ├── main.py # エントリポイント
│ ├── system_prompt.py # システムプロンプト
│ ├── requirements.txt
│ └── build.sh # arm64 zip ビルド
├── frontend/ # Streamlit チャット UI
│ ├── app.py
│ ├── agent_client.py # InvokeAgentRuntime クライアント
│ ├── requirements.txt
│ └── Dockerfile
├── lambda/ # Lambda MCP ラッパー
│ ├── diagram-mcp-wrapper/
│ └── pricing-mcp-wrapper/
├── infra/ # CDK TypeScript (4 スタック)
│ ├── bin/app.ts
│ └── lib/
│ ├── network-stack.ts # VPC, Endpoints, SG
│ ├── mcp-server-stack.ts # Gateway, Lambda, Remote MCP
│ ├── agent-stack.ts # Runtime, Memory
│ └── frontend-stack.ts # ECS Express Mode
├── tests/
│ ├── conftest.py
│ └── test_agent_local.py
└── docs/
├── aws-solution-agent-plan.md
└── aws-solution-agent-architecture.drawio
- Node.js >= 18
- Python >= 3.12
- AWS CDK CLI (
npm install -g aws-cdk) - AWS 認証情報(
aws configure設定済み) - Docker(Lambda バンドリングおよびフロントエンドコンテナビルド用)
cd infra
npm installデプロイ前に各 Lambda ラッパーの依存関係をインストールします。
cd lambda/diagram-mcp-wrapper
pip install -t . -r requirements.txt
cd ../pricing-mcp-wrapper
pip install -t . -r requirements.txtcd infra
npx cdk synth4 つのスタックのテンプレートが生成されます:
AwsSolutionAgent-NetworkAwsSolutionAgent-McpServerAwsSolutionAgent-AgentAwsSolutionAgent-Frontend
cd infra
npx cdk deploy --allスタックは依存順(Network → McpServer → Agent → Frontend)で自動デプロイされます。
pip install pytest
pytest tests/ -vcd agent
pip install -r requirements.txt
python main.py
# http://localhost:8080/ping でヘルスチェックcd frontend
pip install -r requirements.txt
streamlit run app.py
# http://localhost:8501 でUI表示確認- 閉域ネットワーク(NAT Gateway なし、PRIVATE_ISOLATED サブネット)
- VPC Endpoint 経由の AWS サービスアクセス
- IAM 認証(Runtime / Gateway)
- 最小権限の IAM ポリシー
- Runtime: Direct Code Deploy (S3 zip) + VPC 配置
- Memory: STM のみ、7 日有効期限
- Gateway: MCP プロトコル + Semantic 検索有効
- ECS Express Mode (CfnExpressGatewayService): ALB / TG / Auto Scaling / CW Logs を自動管理
- networkConfiguration にプライベートサブネットを指定し、内部 ALB として動作
- Streamlit: ポート 8501、ストリーミング応答対応
- Direct Connect 経由でオンプレミスユーザーからアクセス