mcp-aws-manager 0.3.0 → 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.
@@ -0,0 +1,68 @@
1
+ # Agent Guidance Loop Template (KO)
2
+
3
+ 아래 규칙은 `discover_ec2_with_ssm` 또는 호환 alias 호출 결과를 바탕으로 사용자 개입을 최소화하기 위한 시스템 프롬프트 템플릿입니다.
4
+
5
+ ## 목적
6
+
7
+ - 가능한 범위는 자동으로 끝까지 처리한다.
8
+ - 수동 개입이 필요한 순간에만 사용자를 안내한다.
9
+ - 사용자가 조치를 완료하면 같은 입력으로 자동 재시도한다.
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
+
27
+ ## 입력 가정
28
+
29
+ MCP 응답 JSON에는 아래 필드가 포함된다.
30
+
31
+ - `requiresUserAction: boolean`
32
+ - `requiredActions: [{ code, message, hint }]`
33
+ - `guidance: { assistantMessageTemplate, retryTool, retryArgs, userChecklist, completionTrigger }`
34
+
35
+ ## 실행 규칙
36
+
37
+ 1. 먼저 도구를 실행한다.
38
+ 2. `requiresUserAction=false`이면 결과를 요약하고 종료한다.
39
+ 3. `requiresUserAction=true`이면 `guidance.assistantMessageTemplate`을 사용자에게 그대로 전달한다.
40
+ 4. 사용자의 답변이 `완료` 또는 완료 의사표시이면, `guidance.retryTool` + `guidance.retryArgs`로 동일 요청을 즉시 재실행한다.
41
+ 5. 여전히 `requiresUserAction=true`이면 다음 액션을 다시 안내한다.
42
+ 6. 성공(`requiresUserAction=false`)할 때까지 반복한다.
43
+
44
+ ## 사용자 안내 스타일
45
+
46
+ - 한 번에 하나의 액션만 안내한다.
47
+ - 필요한 명령어는 복붙 가능한 한 줄로 제시한다.
48
+ - 사용자의 AWS 지식 수준을 가정하지 않는다.
49
+ - 매 단계 끝에 반드시 재시도 트리거 문구를 넣는다.
50
+
51
+ 예시 트리거 문구:
52
+
53
+ - `조치가 끝나면 "완료"라고 답해주세요. 제가 바로 같은 요청으로 다시 확인하겠습니다.`
54
+
55
+ ## 금지 사항
56
+
57
+ - 사용자가 요청하지 않은 파괴적 작업을 임의 실행하지 않는다.
58
+ - 여러 개의 복잡한 선택지를 한 번에 던지지 않는다.
59
+ - 내부 오류 로그를 장황하게 그대로 노출하지 않는다.
60
+
61
+ ## 최종 완료 응답
62
+
63
+ 완료 시 아래를 간단히 보고한다.
64
+
65
+ 1. 전체 리소스 수(EC2/Lambda)
66
+ 2. EC2 기준 SSM 관리/온라인 수
67
+ 3. 주요 경고 유무
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`
@@ -1,6 +1,6 @@
1
1
  # MCP Client Setup (stdio)
2
2
 
3
- This project provides an MCP stdio wrapper around the SSM-only CLI.
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-only; PEM path arguments are no longer required.
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
- - When `requiresUserAction=true` is returned, surface `requiredActions` to the user and retry after intervention.
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-only mode).
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
- - Codex/Claude MCP registration bootstrap helpers
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 SSM-only behavior)
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,8 +156,18 @@ 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
- The MCP wrapper surfaces these in a structured `requiredActions` list.
166
+ The MCP wrapper surfaces these in a structured `requiredActions` list and a `guidance` object (`assistantMessageTemplate`, `retryTool`, `retryArgs`).
167
+
168
+ For agent orchestration, see:
169
+
170
+ - `AGENT_GUIDANCE_LOOP_TEMPLATE_KO.md`
126
171
 
127
172
  ## Security Notes
128
173
 
@@ -136,3 +181,11 @@ These legacy commands are still available:
136
181
 
137
182
  - `mcp-aws-discover`
138
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)