mcp-aws-manager 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_GUIDANCE_LOOP_TEMPLATE_KO.md +19 -3
- package/IMPLEMENTATION_INTEGRATIONS.md +91 -0
- package/MCP_CLIENT_SETUP.md +29 -4
- package/MCP_DIFFERENTIATION.md +39 -0
- package/README.md +55 -6
- package/bin/mcp-aws-manager-mcp.js +142 -37
- package/bin/mcp-aws-manager.js +888 -132
- package/package.json +12 -3
|
@@ -8,6 +8,22 @@
|
|
|
8
8
|
- 수동 개입이 필요한 순간에만 사용자를 안내한다.
|
|
9
9
|
- 사용자가 조치를 완료하면 같은 입력으로 자동 재시도한다.
|
|
10
10
|
|
|
11
|
+
## 초기 설정 온보딩 모드
|
|
12
|
+
|
|
13
|
+
처음 사용하는 사용자에게는 아래 순서로 진행한다.
|
|
14
|
+
|
|
15
|
+
1. `mcp-aws-manager doctor` 실행
|
|
16
|
+
2. 인증 누락 시 `aws configure sso --profile <profile>` 안내
|
|
17
|
+
3. `aws sso login --profile <profile>` 안내
|
|
18
|
+
4. `aws sts get-caller-identity --profile <profile>` 검증
|
|
19
|
+
5. `discover_ec2_with_ssm` 또는 `mcp-aws-manager discover` 재실행
|
|
20
|
+
|
|
21
|
+
원칙:
|
|
22
|
+
|
|
23
|
+
- 한 번에 하나의 조치만 요청
|
|
24
|
+
- 조치 완료 답변(예: `완료`)을 받으면 즉시 같은 요청 재시도
|
|
25
|
+
- 실패하면 다음 `ACTION_REQUIRED` 1건만 이어서 안내
|
|
26
|
+
|
|
11
27
|
## 입력 가정
|
|
12
28
|
|
|
13
29
|
MCP 응답 JSON에는 아래 필드가 포함된다.
|
|
@@ -46,7 +62,7 @@ MCP 응답 JSON에는 아래 필드가 포함된다.
|
|
|
46
62
|
|
|
47
63
|
완료 시 아래를 간단히 보고한다.
|
|
48
64
|
|
|
49
|
-
1. 전체
|
|
50
|
-
2. SSM 관리/온라인 수
|
|
65
|
+
1. 전체 리소스 수(EC2/Lambda)
|
|
66
|
+
2. EC2 기준 SSM 관리/온라인 수
|
|
51
67
|
3. 주요 경고 유무
|
|
52
|
-
4. 다음 선택 사항(예: 런타임 스냅샷 확장)
|
|
68
|
+
4. 다음 선택 사항(예: 런타임 스냅샷 확장)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Implementation Integrations
|
|
2
|
+
|
|
3
|
+
This document lists MCP/API/CLI integrations used by `mcp-aws-manager`.
|
|
4
|
+
|
|
5
|
+
## 1) MCP integration (provided by this project)
|
|
6
|
+
|
|
7
|
+
Tools:
|
|
8
|
+
|
|
9
|
+
- `discover_ec2_with_ssm`
|
|
10
|
+
- `discover_public_ec2_with_pem` (compat alias)
|
|
11
|
+
- `mcp_aws_discover_cli_help`
|
|
12
|
+
|
|
13
|
+
Files:
|
|
14
|
+
|
|
15
|
+
- `bin/mcp-aws-manager-mcp.js`
|
|
16
|
+
- `bin/mcp-aws-manager.js`
|
|
17
|
+
|
|
18
|
+
Behavior:
|
|
19
|
+
|
|
20
|
+
- MCP tool input is translated to CLI args
|
|
21
|
+
- CLI runs inventory/runtime workflow
|
|
22
|
+
- Result is normalized as structured JSON payload (`summary`, `requiredActions`, `guidance`)
|
|
23
|
+
|
|
24
|
+
## 2) Important implementation scope decision
|
|
25
|
+
|
|
26
|
+
- External AWS management MCP backends are **not used** in runtime execution.
|
|
27
|
+
- Execution is internal-only using AWS SDK + AWS CLI.
|
|
28
|
+
- No bridge command / adapter map is required for normal operation.
|
|
29
|
+
|
|
30
|
+
## 3) AWS SDK integrations (internal execution)
|
|
31
|
+
|
|
32
|
+
File:
|
|
33
|
+
|
|
34
|
+
- `bin/mcp-aws-manager.js`
|
|
35
|
+
|
|
36
|
+
SDK clients:
|
|
37
|
+
|
|
38
|
+
- `@aws-sdk/client-sts`
|
|
39
|
+
- `@aws-sdk/client-ec2`
|
|
40
|
+
- `@aws-sdk/client-ssm`
|
|
41
|
+
- `@aws-sdk/client-lambda`
|
|
42
|
+
- `@aws-sdk/client-elastic-load-balancing-v2`
|
|
43
|
+
- `@aws-sdk/client-auto-scaling`
|
|
44
|
+
- `@aws-sdk/client-rds`
|
|
45
|
+
- `@aws-sdk/client-elasticache`
|
|
46
|
+
- `@aws-sdk/client-route-53`
|
|
47
|
+
|
|
48
|
+
Core API calls:
|
|
49
|
+
|
|
50
|
+
- STS: `GetCallerIdentity`
|
|
51
|
+
- EC2: `DescribeRegions`, `DescribeInstances`, `DescribeIamInstanceProfileAssociations`, `AssociateIamInstanceProfile`, `ReplaceIamInstanceProfileAssociation`
|
|
52
|
+
- SSM: `DescribeInstanceInformation`, `SendCommand`, `GetCommandInvocation`
|
|
53
|
+
- Lambda: `ListFunctions`
|
|
54
|
+
- ELBv2: `DescribeLoadBalancers`, `DescribeTargetGroups`
|
|
55
|
+
- Auto Scaling: `DescribeAutoScalingGroups`
|
|
56
|
+
- RDS: `DescribeDBInstances`
|
|
57
|
+
- ElastiCache: `DescribeCacheClusters`
|
|
58
|
+
- Route53: `ListHostedZones`, `ListResourceRecordSets`
|
|
59
|
+
|
|
60
|
+
## 4) AWS CLI integration
|
|
61
|
+
|
|
62
|
+
File:
|
|
63
|
+
|
|
64
|
+
- `bin/mcp-aws-manager.js`
|
|
65
|
+
|
|
66
|
+
Command used:
|
|
67
|
+
|
|
68
|
+
- `aws sso login --profile <profile>`
|
|
69
|
+
|
|
70
|
+
Purpose:
|
|
71
|
+
|
|
72
|
+
- Automatic recovery when SSO credentials expire.
|
|
73
|
+
|
|
74
|
+
## 5) Local MCP client registration automation
|
|
75
|
+
|
|
76
|
+
Supported clients:
|
|
77
|
+
|
|
78
|
+
- `codex`
|
|
79
|
+
- `claude`
|
|
80
|
+
- `cursor`
|
|
81
|
+
- `windsurf`
|
|
82
|
+
- `antigravity`
|
|
83
|
+
|
|
84
|
+
The setup flow tries multiple `mcp` command variants (`get/show`, `add`, `remove/rm`, scope variations) to maximize compatibility.
|
|
85
|
+
|
|
86
|
+
## 6) Related docs
|
|
87
|
+
|
|
88
|
+
- `README.md`
|
|
89
|
+
- `USAGE_GUIDE.md`
|
|
90
|
+
- `MCP_CLIENT_SETUP.md`
|
|
91
|
+
- `MCP_DIFFERENTIATION.md`
|
package/MCP_CLIENT_SETUP.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP Client Setup (stdio)
|
|
2
2
|
|
|
3
|
-
This project provides an MCP stdio wrapper around the SSM-
|
|
3
|
+
This project provides an MCP stdio wrapper around the SSM-first AWS operations CLI.
|
|
4
4
|
|
|
5
5
|
- Preferred CLI command: `mcp-aws-manager`
|
|
6
6
|
- Preferred MCP server command: `mcp-aws-manager-mcp`
|
|
@@ -8,7 +8,7 @@ This project provides an MCP stdio wrapper around the SSM-only CLI.
|
|
|
8
8
|
|
|
9
9
|
Exposed MCP tools:
|
|
10
10
|
|
|
11
|
-
- `discover_ec2_with_ssm` (primary)
|
|
11
|
+
- `discover_ec2_with_ssm` (primary, multi-service inventory + SSM runtime)
|
|
12
12
|
- `discover_public_ec2_with_pem` (compatibility alias, same behavior)
|
|
13
13
|
- `mcp_aws_discover_cli_help`
|
|
14
14
|
|
|
@@ -19,7 +19,7 @@ npm install -g mcp-aws-manager
|
|
|
19
19
|
mcp-aws-manager
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`mcp-aws-manager` (no args) runs bootstrap and registers the MCP server for detected clients (`codex`, `claude`).
|
|
22
|
+
`mcp-aws-manager` (no args) runs bootstrap and registers the MCP server for detected clients (`codex`, `claude` by default).
|
|
23
23
|
|
|
24
24
|
Verification:
|
|
25
25
|
|
|
@@ -27,6 +27,22 @@ Verification:
|
|
|
27
27
|
mcp-aws-manager doctor
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
## Agent-Led Setup Flow
|
|
31
|
+
|
|
32
|
+
When the user is unfamiliar with AWS setup, run this sequence through the agent:
|
|
33
|
+
|
|
34
|
+
1. `mcp-aws-manager doctor`
|
|
35
|
+
2. If AWS auth missing, guide:
|
|
36
|
+
- `aws configure sso --profile default`
|
|
37
|
+
- `aws sso login --profile default`
|
|
38
|
+
3. Validate:
|
|
39
|
+
- `aws sts get-caller-identity --profile default`
|
|
40
|
+
4. Validate MCP discovery path:
|
|
41
|
+
- `mcp-aws-manager discover --profiles default --no-progress`
|
|
42
|
+
5. If `requiresUserAction=true`, ask for one manual action only, then retry same request.
|
|
43
|
+
|
|
44
|
+
Manual user actions are typically limited to SSO browser/MFA and IAM approval.
|
|
45
|
+
|
|
30
46
|
## Explicit Registration
|
|
31
47
|
|
|
32
48
|
```bash
|
|
@@ -39,6 +55,12 @@ Custom name/command:
|
|
|
39
55
|
mcp-aws-manager setup --name mcp-aws-manager --mcp-command mcp-aws-manager-mcp --clients codex,claude
|
|
40
56
|
```
|
|
41
57
|
|
|
58
|
+
Cursor/Windsurf/Antigravity target example:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
mcp-aws-manager setup --name mcp-aws-manager --mcp-command mcp-aws-manager-mcp --clients cursor,windsurf,antigravity
|
|
62
|
+
```
|
|
63
|
+
|
|
42
64
|
## Manual Configuration (Fallback)
|
|
43
65
|
|
|
44
66
|
Use only when automatic registration is unavailable in your environment.
|
|
@@ -91,7 +113,10 @@ Use only when automatic registration is unavailable in your environment.
|
|
|
91
113
|
|
|
92
114
|
## Notes
|
|
93
115
|
|
|
94
|
-
- Discovery is SSM-
|
|
116
|
+
- Discovery is SSM-first for host/runtime access; PEM path arguments are no longer required.
|
|
117
|
+
- Runtime execution uses this package's internal AWS SDK/CLI path only (no external AWS management MCP backend dependency).
|
|
118
|
+
- Use include flags (`includeLambda`, `includeAlb`, `includeAsg`, `includeRds`, `includeElastiCache`, `includeRoute53`) to expand inventory scope.
|
|
95
119
|
- Keep AWS credentials/profiles available on the host running MCP.
|
|
96
120
|
- When `requiresUserAction=true` is returned, use `guidance.assistantMessageTemplate` to prompt the user, then retry with `guidance.retryTool` + `guidance.retryArgs` after user confirmation.
|
|
97
121
|
- For auto remediation, pass `autoRemediateSsm` and an instance profile name/arn.
|
|
122
|
+
- Supported setup clients: `codex`, `claude`, `cursor`, `windsurf`, `antigravity`.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# MCP Differentiation
|
|
2
|
+
|
|
3
|
+
This document clarifies how `mcp-aws-manager` differs from existing AWS-oriented MCP servers.
|
|
4
|
+
|
|
5
|
+
## Scope statement
|
|
6
|
+
|
|
7
|
+
- `mcp-aws-manager` is an internal-execution operations MCP.
|
|
8
|
+
- Runtime does not call external AWS management MCP servers.
|
|
9
|
+
- Discovery/remediation/snapshot are executed directly with AWS SDK and AWS CLI.
|
|
10
|
+
|
|
11
|
+
## Compared targets
|
|
12
|
+
|
|
13
|
+
- AWS MCP Server (Anthropic/community variants)
|
|
14
|
+
- aws-mcp style general AWS control MCPs
|
|
15
|
+
- SSH/filesystem MCP combinations for server introspection
|
|
16
|
+
|
|
17
|
+
## Comparison summary
|
|
18
|
+
|
|
19
|
+
| Area | Existing AWS management MCPs (generic) | `mcp-aws-manager` |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Runtime dependency | Often depends on that MCP server’s own tool/runtime behavior | No external runtime dependency; internal execution only |
|
|
22
|
+
| Product intent | Broad cloud control (many services, ad-hoc actions) | Server operations workflow (inventory + runtime + guided remediation) |
|
|
23
|
+
| Output contract | Tool-specific response shapes | Single normalized multi-service schema (EC2/Lambda/ALB/ASG/RDS/ElastiCache/Route53/SSM) |
|
|
24
|
+
| Runtime insight | Not always integrated with SSM snapshot flow | SSM-first runtime snapshot in same workflow |
|
|
25
|
+
| Failure handling | Varies by server/tool | Standardized `ACTION_REQUIRED` codes and retry guidance payload |
|
|
26
|
+
| Onboarding | Usually per-client manual MCP config | Built-in `bootstrap/setup/doctor` for `codex`, `claude`, `cursor`, `windsurf`, `antigravity` |
|
|
27
|
+
| Governance/audit | Varies | Step-aligned summary and evidence metadata hooks |
|
|
28
|
+
|
|
29
|
+
## Practical differentiation
|
|
30
|
+
|
|
31
|
+
- Deterministic 9-step workflow execution (same ordering every run).
|
|
32
|
+
- Operationally focused defaults (inventory + SSM state + optional remediation/snapshot).
|
|
33
|
+
- User intervention loop designed for agents (ask user only when blocked, then continue).
|
|
34
|
+
- Vendor-agnostic from external MCP backends (no backend lock-in).
|
|
35
|
+
|
|
36
|
+
## Intentional non-goals
|
|
37
|
+
|
|
38
|
+
- Full replacement of every existing AWS management MCP capability.
|
|
39
|
+
- External MCP-to-MCP bridge compatibility as a primary architecture.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# mcp-aws-manager
|
|
2
2
|
|
|
3
|
-
AWS operations CLI and MCP server package (SSM-
|
|
3
|
+
AWS operations CLI and MCP server package (SSM-first mode).
|
|
4
4
|
|
|
5
5
|
## What It Provides
|
|
6
6
|
|
|
@@ -9,13 +9,20 @@ AWS operations CLI and MCP server package (SSM-only mode).
|
|
|
9
9
|
|
|
10
10
|
Current implementation focuses on:
|
|
11
11
|
|
|
12
|
+
- Internal-only execution (AWS SDK + AWS CLI), no external AWS management MCP backend dependency
|
|
12
13
|
- EC2 inventory discovery (multi profile / multi region)
|
|
14
|
+
- Optional Lambda function inventory (same profile/region sweep)
|
|
15
|
+
- Optional ALB/NLB + Target Group inventory
|
|
16
|
+
- Optional Auto Scaling Group inventory
|
|
17
|
+
- Optional RDS inventory
|
|
18
|
+
- Optional ElastiCache inventory
|
|
19
|
+
- Optional Route53 hosted zone inventory
|
|
13
20
|
- SSM management and online-state visibility
|
|
14
21
|
- Optional SSM runtime snapshot collection (`RunCommand`)
|
|
15
22
|
- Optional SSM auto-remediation (instance profile association)
|
|
16
23
|
- Human-in-the-loop guidance via `ACTION_REQUIRED` messages
|
|
17
24
|
- JSON/CSV output (CLI)
|
|
18
|
-
-
|
|
25
|
+
- MCP registration bootstrap helpers (`codex`, `claude`, `cursor`, `windsurf`, `antigravity`)
|
|
19
26
|
|
|
20
27
|
## Install
|
|
21
28
|
|
|
@@ -31,14 +38,21 @@ After install, run once:
|
|
|
31
38
|
mcp-aws-manager
|
|
32
39
|
```
|
|
33
40
|
|
|
34
|
-
This ensures `mcp-aws-manager` is registered in detected clients (`codex`, `claude`).
|
|
41
|
+
This ensures `mcp-aws-manager` is registered in detected clients (`codex`, `claude` by default).
|
|
42
|
+
|
|
43
|
+
For first-time users, follow the agent-assisted onboarding flow in `USAGE_GUIDE.md` ("Agent-Assisted First-Time Setup").
|
|
35
44
|
|
|
36
45
|
## Prerequisites
|
|
37
46
|
|
|
38
47
|
- Node.js `>=18`
|
|
39
48
|
- AWS credentials/profile (or IAM role) on the machine running the CLI/MCP server
|
|
40
|
-
- For runtime snapshots: SSM permissions (`ssm:SendCommand`, `ssm:GetCommandInvocation`)
|
|
49
|
+
- For runtime snapshots: SSM permissions (`ssm:SendCommand`, `ssm:GetCommandInvocation`, `ssm:DescribeInstanceInformation`)
|
|
41
50
|
- For auto remediation: EC2/IAM permissions (`ec2:AssociateIamInstanceProfile`, optionally `ec2:ReplaceIamInstanceProfileAssociation`, `iam:PassRole`)
|
|
51
|
+
- For ALB inventory: `elasticloadbalancing:DescribeLoadBalancers`, `elasticloadbalancing:DescribeTargetGroups`
|
|
52
|
+
- For ASG inventory: `autoscaling:DescribeAutoScalingGroups`
|
|
53
|
+
- For RDS inventory: `rds:DescribeDBInstances`
|
|
54
|
+
- For ElastiCache inventory: `elasticache:DescribeCacheClusters`
|
|
55
|
+
- For Route53 inventory: `route53:ListHostedZones` (record counts require `route53:ListResourceRecordSets`)
|
|
42
56
|
|
|
43
57
|
## Quick Start
|
|
44
58
|
|
|
@@ -56,6 +70,26 @@ Basic discovery:
|
|
|
56
70
|
mcp-aws-manager discover --profiles default
|
|
57
71
|
```
|
|
58
72
|
|
|
73
|
+
Include Lambda inventory together:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mcp-aws-manager discover --profiles default --include-lambda
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Include core service topology (ALB/ASG/RDS/ElastiCache/Route53):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mcp-aws-manager discover \
|
|
83
|
+
--profiles default \
|
|
84
|
+
--include-alb --include-asg --include-rds --include-elasticache --include-route53
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Lambda-only inventory:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mcp-aws-manager discover --profiles default --include-lambda --no-ec2 --no-runtime-snapshot
|
|
91
|
+
```
|
|
92
|
+
|
|
59
93
|
Only public IP instances:
|
|
60
94
|
|
|
61
95
|
```bash
|
|
@@ -98,8 +132,8 @@ mcp-aws-manager-mcp
|
|
|
98
132
|
|
|
99
133
|
Exposed MCP tools:
|
|
100
134
|
|
|
101
|
-
- `discover_ec2_with_ssm` (primary)
|
|
102
|
-
- `discover_public_ec2_with_pem` (compatibility alias, same
|
|
135
|
+
- `discover_ec2_with_ssm` (primary, multi-service inventory + SSM runtime)
|
|
136
|
+
- `discover_public_ec2_with_pem` (compatibility alias, same behavior)
|
|
103
137
|
- `mcp_aws_discover_cli_help`
|
|
104
138
|
|
|
105
139
|
Example tool arguments:
|
|
@@ -107,6 +141,7 @@ Example tool arguments:
|
|
|
107
141
|
```json
|
|
108
142
|
{
|
|
109
143
|
"profiles": ["default"],
|
|
144
|
+
"includeLambda": true,
|
|
110
145
|
"publicOnly": true,
|
|
111
146
|
"runtimeSnapshot": true,
|
|
112
147
|
"autoSsoLogin": true,
|
|
@@ -121,6 +156,12 @@ When fully automatic execution is not possible, the CLI/MCP returns actionable g
|
|
|
121
156
|
- `ACTION_REQUIRED: [SSO_LOGIN_NEEDED] ...`
|
|
122
157
|
- `ACTION_REQUIRED: [SSM_ROLE_OR_AGENT_REQUIRED] ...`
|
|
123
158
|
- `ACTION_REQUIRED: [IAM_PROFILE_ASSOCIATION_FAILED] ...`
|
|
159
|
+
- `ACTION_REQUIRED: [LAMBDA_LIST_PERMISSION_REQUIRED] ...`
|
|
160
|
+
- `ACTION_REQUIRED: [ELBV2_LIST_PERMISSION_REQUIRED] ...`
|
|
161
|
+
- `ACTION_REQUIRED: [ASG_LIST_PERMISSION_REQUIRED] ...`
|
|
162
|
+
- `ACTION_REQUIRED: [RDS_LIST_PERMISSION_REQUIRED] ...`
|
|
163
|
+
- `ACTION_REQUIRED: [ELASTICACHE_LIST_PERMISSION_REQUIRED] ...`
|
|
164
|
+
- `ACTION_REQUIRED: [ROUTE53_LIST_PERMISSION_REQUIRED] ...`
|
|
124
165
|
|
|
125
166
|
The MCP wrapper surfaces these in a structured `requiredActions` list and a `guidance` object (`assistantMessageTemplate`, `retryTool`, `retryArgs`).
|
|
126
167
|
|
|
@@ -140,3 +181,11 @@ These legacy commands are still available:
|
|
|
140
181
|
|
|
141
182
|
- `mcp-aws-discover`
|
|
142
183
|
- `mcp-aws-discover-mcp`
|
|
184
|
+
|
|
185
|
+
## Differentiation Docs
|
|
186
|
+
|
|
187
|
+
This project does not delegate runtime execution to other AWS management MCP servers.
|
|
188
|
+
Implementation details and differentiation are documented in:
|
|
189
|
+
|
|
190
|
+
- `IMPLEMENTATION_INTEGRATIONS.md` (implemented MCP/API/CLI inventory)
|
|
191
|
+
- `MCP_DIFFERENTIATION.md` (differences from existing AWS management MCPs)
|
|
@@ -20,7 +20,7 @@ function usageText() {
|
|
|
20
20
|
return [
|
|
21
21
|
"mcp-aws-manager-mcp",
|
|
22
22
|
"",
|
|
23
|
-
"MCP stdio wrapper for the mcp-aws-manager CLI
|
|
23
|
+
"MCP stdio wrapper for the mcp-aws-manager CLI.",
|
|
24
24
|
"",
|
|
25
25
|
"Usage:",
|
|
26
26
|
" mcp-aws-manager-mcp",
|
|
@@ -28,7 +28,7 @@ function usageText() {
|
|
|
28
28
|
"",
|
|
29
29
|
"Notes:",
|
|
30
30
|
" - This process is an MCP stdio server.",
|
|
31
|
-
" - Exposes
|
|
31
|
+
" - Exposes multi-service AWS inventory and optional runtime tools.",
|
|
32
32
|
""
|
|
33
33
|
].join("\n");
|
|
34
34
|
}
|
|
@@ -100,6 +100,21 @@ function buildCliArgs(input) {
|
|
|
100
100
|
const instanceIds = toCsvArg(input.instanceIds);
|
|
101
101
|
if (instanceIds) args.push("--instance-ids", instanceIds);
|
|
102
102
|
|
|
103
|
+
if (input.includeLambda === true) args.push("--include-lambda");
|
|
104
|
+
if (input.includeLambda === false) args.push("--no-include-lambda");
|
|
105
|
+
if (input.includeEc2 === true) args.push("--include-ec2");
|
|
106
|
+
if (input.includeEc2 === false) args.push("--no-ec2");
|
|
107
|
+
if (input.includeAlb === true) args.push("--include-alb");
|
|
108
|
+
if (input.includeAlb === false) args.push("--no-include-alb");
|
|
109
|
+
if (input.includeAsg === true) args.push("--include-asg");
|
|
110
|
+
if (input.includeAsg === false) args.push("--no-include-asg");
|
|
111
|
+
if (input.includeRds === true) args.push("--include-rds");
|
|
112
|
+
if (input.includeRds === false) args.push("--no-include-rds");
|
|
113
|
+
if (input.includeElastiCache === true) args.push("--include-elasticache");
|
|
114
|
+
if (input.includeElastiCache === false) args.push("--no-include-elasticache");
|
|
115
|
+
if (input.includeRoute53 === true) args.push("--include-route53");
|
|
116
|
+
if (input.includeRoute53 === false) args.push("--no-include-route53");
|
|
117
|
+
|
|
103
118
|
if (input.publicOnly) args.push("--public-only");
|
|
104
119
|
if (input.managedOnly) args.push("--managed-only");
|
|
105
120
|
|
|
@@ -216,6 +231,14 @@ function tryParseJsonArray(text) {
|
|
|
216
231
|
function summarizeRecords(records) {
|
|
217
232
|
const summary = {
|
|
218
233
|
totalRecords: 0,
|
|
234
|
+
ec2Records: 0,
|
|
235
|
+
lambdaRecords: 0,
|
|
236
|
+
albRecords: 0,
|
|
237
|
+
targetGroupRecords: 0,
|
|
238
|
+
asgRecords: 0,
|
|
239
|
+
rdsRecords: 0,
|
|
240
|
+
elasticacheRecords: 0,
|
|
241
|
+
route53ZoneRecords: 0,
|
|
219
242
|
publicIpRecords: 0,
|
|
220
243
|
ssmManagedCount: 0,
|
|
221
244
|
ssmOnlineCount: 0,
|
|
@@ -230,6 +253,15 @@ function summarizeRecords(records) {
|
|
|
230
253
|
|
|
231
254
|
for (const item of Array.isArray(records) ? records : []) {
|
|
232
255
|
summary.totalRecords += 1;
|
|
256
|
+
const resourceType = item && item.resourceType ? String(item.resourceType).toLowerCase() : null;
|
|
257
|
+
if (resourceType === "ec2") summary.ec2Records += 1;
|
|
258
|
+
if (resourceType === "lambda") summary.lambdaRecords += 1;
|
|
259
|
+
if (resourceType === "alb") summary.albRecords += 1;
|
|
260
|
+
if (resourceType === "target_group") summary.targetGroupRecords += 1;
|
|
261
|
+
if (resourceType === "asg") summary.asgRecords += 1;
|
|
262
|
+
if (resourceType === "rds") summary.rdsRecords += 1;
|
|
263
|
+
if (resourceType === "elasticache") summary.elasticacheRecords += 1;
|
|
264
|
+
if (resourceType === "route53_zone") summary.route53ZoneRecords += 1;
|
|
233
265
|
if (item && item.publicIp) summary.publicIpRecords += 1;
|
|
234
266
|
if (item && item.ssmManaged === true) summary.ssmManagedCount += 1;
|
|
235
267
|
if (item && item.ssmOnline === true) summary.ssmOnlineCount += 1;
|
|
@@ -271,9 +303,9 @@ function guidanceForAction(action, args) {
|
|
|
271
303
|
title: "Manual action required",
|
|
272
304
|
steps: [
|
|
273
305
|
action && action.message ? action.message : "A manual action is required.",
|
|
274
|
-
action && action.hint ? action.hint : "After completing the action, reply '
|
|
306
|
+
action && action.hint ? action.hint : "After completing the action, reply '?熬곣뫁?? to continue."
|
|
275
307
|
],
|
|
276
|
-
confirmText: "
|
|
308
|
+
confirmText: "?브퀗??洹쏆쾸? ?熬곣뫁???濡?듆 '?熬곣뫁?????┑?????면썒??닔??? ?띠룇?? ??븐슙???怨쀬Ŧ ???吏?????熬곥굥由?뇦猿뗭쪠????덈펲."
|
|
277
309
|
};
|
|
278
310
|
|
|
279
311
|
switch (code) {
|
|
@@ -284,11 +316,11 @@ function guidanceForAction(action, args) {
|
|
|
284
316
|
code,
|
|
285
317
|
title: "AWS SSO login required",
|
|
286
318
|
steps: [
|
|
287
|
-
|
|
288
|
-
"
|
|
289
|
-
"
|
|
319
|
+
`????????????깅쾳 嶺뚮ㅏ援앲??????덈뺄??琉얠돪?? ${cmd}`,
|
|
320
|
+
"??곗뒧???? ?筌뤾쑴理?MFA???熬곣뫁???琉얠돪??",
|
|
321
|
+
"?熬곣뫁????'?熬곣뫁?????┑?????면썒??닔???"
|
|
290
322
|
],
|
|
291
|
-
confirmText: "SSO
|
|
323
|
+
confirmText: "SSO ?β돦裕??筌뤾쑴逾???硫명뀬???좊듆 '?熬곣뫁?????┑?????면썒??닔???"
|
|
292
324
|
};
|
|
293
325
|
}
|
|
294
326
|
case "AWS_CREDENTIALS_REQUIRED":
|
|
@@ -296,44 +328,44 @@ function guidanceForAction(action, args) {
|
|
|
296
328
|
code,
|
|
297
329
|
title: "AWS credentials required",
|
|
298
330
|
steps: [
|
|
299
|
-
"
|
|
300
|
-
"SSO
|
|
301
|
-
"
|
|
331
|
+
"??????熬곣뫁夷?熬곣뫗踰????遊꾤춯?밸퉾筌?????깆젧??琉얠돪??(SSO ???裕?access key).",
|
|
332
|
+
"SSO??寃밸듆 'aws configure sso --profile <profile>' ???β돦裕??筌뤿굝由?筌뤾쑴??",
|
|
333
|
+
"?熬곣뫁????'?熬곣뫁?????┑?????면썒??닔???"
|
|
302
334
|
],
|
|
303
|
-
confirmText: "
|
|
335
|
+
confirmText: "???遊꾤춯?밸퉾筌????깆젧/?β돦裕??筌뤾쑴逾???硫명뀬???좊듆 '?熬곣뫁?????┑?????면썒??닔???"
|
|
304
336
|
};
|
|
305
337
|
case "SET_SSM_INSTANCE_PROFILE":
|
|
306
338
|
return {
|
|
307
339
|
code,
|
|
308
340
|
title: "SSM remediation target missing",
|
|
309
341
|
steps: [
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
342
|
+
"???吏??곌랜踰?袁ㅻご??????濡?졎嶺?instance profile ???藥????裕?ARN??嶺뚯솘??筌먐삵돵????紐껊퉵??",
|
|
343
|
+
"???깅쾳 ?????繞???濡る룎????節띾쐾 ?熬곣뫀堉??琉얠돪?? --ssm-instance-profile-name ???裕?--ssm-instance-profile-arn",
|
|
344
|
+
"?熬곣뫁????'?熬곣뫁?????┑?????면썒??닔???"
|
|
313
345
|
],
|
|
314
|
-
confirmText: "
|
|
346
|
+
confirmText: "?熬곣뫁夷???逾?????⑤챷諭?嶺뚯솘??筌먐삳빳???좊듆 '?熬곣뫁?????┑?????면썒??닔???"
|
|
315
347
|
};
|
|
316
348
|
case "SSM_ROLE_OR_AGENT_REQUIRED":
|
|
317
349
|
return {
|
|
318
350
|
code,
|
|
319
351
|
title: "Instance is not SSM managed",
|
|
320
352
|
steps: [
|
|
321
|
-
"
|
|
322
|
-
"SSM Agent
|
|
323
|
-
"
|
|
353
|
+
"?筌뤾쑬裕??怨룸츩 ?????AmazonSSMManagedInstanceCore???????琉얠돪??",
|
|
354
|
+
"SSM Agent?? ???덈콦??怨뚯씩(SSM endpoint/?筌뤿굛????롪퍔?δ빳??띠럾? ?筌먦끆留?筌? ?筌먦끉逾??琉얠돪??",
|
|
355
|
+
"?熬곣뫁????'?熬곣뫁?????┑?????면썒??닔???"
|
|
324
356
|
],
|
|
325
|
-
confirmText: "SSM
|
|
357
|
+
confirmText: "SSM ??㉱????⑤객臾???브퀗?????덈펲嶺?'?熬곣뫁?????┑?????면썒??닔???"
|
|
326
358
|
};
|
|
327
359
|
case "INSTANCE_HAS_PROFILE":
|
|
328
360
|
return {
|
|
329
361
|
code,
|
|
330
362
|
title: "Existing instance profile detected",
|
|
331
363
|
steps: [
|
|
332
|
-
"
|
|
333
|
-
"
|
|
334
|
-
"
|
|
364
|
+
"?リ옇????筌뤾쑬裕??怨룸츩 ?熬곣뫁夷???逾?????곕????덈펲.",
|
|
365
|
+
"??ルㅎ臾?1: ?リ옇????????筌먦끉???SSM 雅?굝??뇡???怨뺣뼺???紐껊퉵??",
|
|
366
|
+
"??ルㅎ臾?2: ???吏???흮?우뮁紐???믨퀡由?춯?allowReplaceProfile=true ??????熬곥굥????덈펲."
|
|
335
367
|
],
|
|
336
|
-
confirmText: "
|
|
368
|
+
confirmText: "??⑤챷????꾩렮維뽬떋???筌먐삳빳???좊듆 '?熬곣뫁?????┑?????면썒??닔???"
|
|
337
369
|
};
|
|
338
370
|
case "IAM_PROFILE_ASSOCIATION_FAILED":
|
|
339
371
|
case "IAM_PROFILE_REPLACE_FAILED":
|
|
@@ -341,22 +373,88 @@ function guidanceForAction(action, args) {
|
|
|
341
373
|
code,
|
|
342
374
|
title: "Missing IAM permission for remediation",
|
|
343
375
|
steps: [
|
|
344
|
-
"
|
|
345
|
-
"
|
|
346
|
-
"
|
|
376
|
+
"???덈뺄 ?낅슣?섊뙼??EC2 ?筌뤾쑬裕??怨룸츩 ?熬곣뫁夷???逾???⑤슡????흮??雅?굝??뇡???遊붋????筌뤾쑴??",
|
|
377
|
+
"?熬곣뫗??雅?굝??뇡? ec2:AssociateIamInstanceProfile, ec2:ReplaceIamInstanceProfileAssociation(??흮????, iam:PassRole",
|
|
378
|
+
"?熬곣뫁????'?熬곣뫁?????┑?????면썒??닔???"
|
|
347
379
|
],
|
|
348
|
-
confirmText: "IAM
|
|
380
|
+
confirmText: "IAM 雅?굝??뇡??꾩룇瑗?????硫명뀬???좊듆 '?熬곣뫁?????┑?????면썒??닔???"
|
|
349
381
|
};
|
|
350
382
|
case "SSM_RUNCOMMAND_PERMISSION_REQUIRED":
|
|
351
383
|
return {
|
|
352
384
|
code,
|
|
353
385
|
title: "Missing SSM RunCommand permission",
|
|
354
386
|
steps: [
|
|
355
|
-
"
|
|
356
|
-
"
|
|
357
|
-
"
|
|
387
|
+
"???덈뺄 ?낅슣?섊뙼??SSM 嶺뚮ㅏ援앲??雅?굝??뇡???遊붋????筌뤾쑴??",
|
|
388
|
+
"?熬곣뫗??雅?굝??뇡? ssm:SendCommand, ssm:GetCommandInvocation",
|
|
389
|
+
"?熬곣뫁????'?熬곣뫁?????┑?????면썒??닔???"
|
|
390
|
+
],
|
|
391
|
+
confirmText: "SSM 雅?굝??뇡??꾩룇瑗?????硫명뀬???좊듆 '?熬곣뫁?????┑?????면썒??닔???"
|
|
392
|
+
};
|
|
393
|
+
case "LAMBDA_LIST_PERMISSION_REQUIRED":
|
|
394
|
+
return {
|
|
395
|
+
code,
|
|
396
|
+
title: "Missing Lambda list permission",
|
|
397
|
+
steps: [
|
|
398
|
+
"??쎈뻬 雅뚯눘猿??Lambda 鈺곌퀬??亦낅슦釉???봔鈺곌퉲鍮??덈뼄.",
|
|
399
|
+
"?袁⑹뒄 亦낅슦釉? lambda:ListFunctions",
|
|
400
|
+
"亦낅슦釉?獄쏆꼷????'??袁⑥┷'??⑦????젻雅뚯눘苑??"
|
|
401
|
+
],
|
|
402
|
+
confirmText: "Lambda 亦낅슦釉?獄쏆꼷?????멸돌筌?'??袁⑥┷'??⑦????젻雅뚯눘苑??"
|
|
403
|
+
};
|
|
404
|
+
case "ELBV2_LIST_PERMISSION_REQUIRED":
|
|
405
|
+
return {
|
|
406
|
+
code,
|
|
407
|
+
title: "Missing ELBv2 list permission",
|
|
408
|
+
steps: [
|
|
409
|
+
"Grant permissions to list load balancers and target groups.",
|
|
410
|
+
"Required: elasticloadbalancing:DescribeLoadBalancers and elasticloadbalancing:DescribeTargetGroups.",
|
|
411
|
+
"Retry after permission update."
|
|
412
|
+
],
|
|
413
|
+
confirmText: "After ELBv2 permission update, reply 'completed' and retry."
|
|
414
|
+
};
|
|
415
|
+
case "ASG_LIST_PERMISSION_REQUIRED":
|
|
416
|
+
return {
|
|
417
|
+
code,
|
|
418
|
+
title: "Missing Auto Scaling list permission",
|
|
419
|
+
steps: [
|
|
420
|
+
"Grant permission to read Auto Scaling Groups.",
|
|
421
|
+
"Required: autoscaling:DescribeAutoScalingGroups.",
|
|
422
|
+
"Retry after permission update."
|
|
423
|
+
],
|
|
424
|
+
confirmText: "After Auto Scaling permission update, reply 'completed' and retry."
|
|
425
|
+
};
|
|
426
|
+
case "RDS_LIST_PERMISSION_REQUIRED":
|
|
427
|
+
return {
|
|
428
|
+
code,
|
|
429
|
+
title: "Missing RDS list permission",
|
|
430
|
+
steps: [
|
|
431
|
+
"Grant permission to list RDS DB instances.",
|
|
432
|
+
"Required: rds:DescribeDBInstances.",
|
|
433
|
+
"Retry after permission update."
|
|
434
|
+
],
|
|
435
|
+
confirmText: "After RDS permission update, reply 'completed' and retry."
|
|
436
|
+
};
|
|
437
|
+
case "ELASTICACHE_LIST_PERMISSION_REQUIRED":
|
|
438
|
+
return {
|
|
439
|
+
code,
|
|
440
|
+
title: "Missing ElastiCache list permission",
|
|
441
|
+
steps: [
|
|
442
|
+
"Grant permission to list ElastiCache clusters.",
|
|
443
|
+
"Required: elasticache:DescribeCacheClusters.",
|
|
444
|
+
"Retry after permission update."
|
|
445
|
+
],
|
|
446
|
+
confirmText: "After ElastiCache permission update, reply 'completed' and retry."
|
|
447
|
+
};
|
|
448
|
+
case "ROUTE53_LIST_PERMISSION_REQUIRED":
|
|
449
|
+
return {
|
|
450
|
+
code,
|
|
451
|
+
title: "Missing Route53 list permission",
|
|
452
|
+
steps: [
|
|
453
|
+
"Grant permission to list Route53 hosted zones.",
|
|
454
|
+
"Required: route53:ListHostedZones (and route53:ListResourceRecordSets for record counts).",
|
|
455
|
+
"Retry after permission update."
|
|
358
456
|
],
|
|
359
|
-
confirmText: "
|
|
457
|
+
confirmText: "After Route53 permission update, reply 'completed' and retry."
|
|
360
458
|
};
|
|
361
459
|
default:
|
|
362
460
|
return defaultItem;
|
|
@@ -393,7 +491,7 @@ function buildAgentGuidance(requiredActions, toolName, args) {
|
|
|
393
491
|
autoRetryRecommended: true,
|
|
394
492
|
retryTool: toolName,
|
|
395
493
|
retryArgs: args,
|
|
396
|
-
completionTrigger: "사용자가 '완료' 또는 조치
|
|
494
|
+
completionTrigger: "사용자가 '완료' 또는 조치 완료 의사를 전달하면 같은 입력으로 재시도",
|
|
397
495
|
userChecklist: items,
|
|
398
496
|
assistantMessageTemplate: lines.join("\n")
|
|
399
497
|
};
|
|
@@ -408,6 +506,13 @@ function toolSchema() {
|
|
|
408
506
|
profiles: z.array(z.string().min(1)).optional().describe("Optional AWS profiles."),
|
|
409
507
|
regions: z.array(z.string().min(1)).optional().describe("Optional AWS regions."),
|
|
410
508
|
instanceIds: z.array(z.string().min(1)).optional().describe("Optional EC2 instance ids."),
|
|
509
|
+
includeLambda: z.boolean().optional().describe("If true, include Lambda inventory."),
|
|
510
|
+
includeEc2: z.boolean().optional().describe("If false, skip EC2 inventory."),
|
|
511
|
+
includeAlb: z.boolean().optional().describe("If true, include ALB/NLB and target group inventory."),
|
|
512
|
+
includeAsg: z.boolean().optional().describe("If true, include Auto Scaling Group inventory."),
|
|
513
|
+
includeRds: z.boolean().optional().describe("If true, include RDS DB instance inventory."),
|
|
514
|
+
includeElastiCache: z.boolean().optional().describe("If true, include ElastiCache cluster inventory."),
|
|
515
|
+
includeRoute53: z.boolean().optional().describe("If true, include Route53 hosted zone inventory."),
|
|
411
516
|
publicOnly: z.boolean().optional().describe("If true, include only public IPv4 instances."),
|
|
412
517
|
managedOnly: z.boolean().optional().describe("If true, include only SSM-managed instances."),
|
|
413
518
|
autoRemediateSsm: z.boolean().optional().describe("If true, try attaching/replacing instance profile for unmanaged instances."),
|
|
@@ -548,15 +653,15 @@ async function registerTools(server) {
|
|
|
548
653
|
registerDiscoverTool(
|
|
549
654
|
server,
|
|
550
655
|
"discover_ec2_with_ssm",
|
|
551
|
-
"Discover
|
|
552
|
-
"Runs mcp-aws-manager
|
|
656
|
+
"Discover AWS Inventory (multi-service + SSM runtime)",
|
|
657
|
+
"Runs mcp-aws-manager and returns inventory across EC2/Lambda/ALB/ASG/RDS/ElastiCache/Route53 with optional SSM runtime snapshots."
|
|
553
658
|
);
|
|
554
659
|
|
|
555
660
|
registerDiscoverTool(
|
|
556
661
|
server,
|
|
557
662
|
"discover_public_ec2_with_pem",
|
|
558
|
-
"Discover
|
|
559
|
-
"Compatibility alias. Internally runs the same
|
|
663
|
+
"Discover AWS Inventory (compat alias)",
|
|
664
|
+
"Compatibility alias. Internally runs the same multi-service discovery flow."
|
|
560
665
|
);
|
|
561
666
|
|
|
562
667
|
server.registerTool(
|