mcp-aws-manager 0.3.5 → 0.3.7

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/README.md CHANGED
@@ -2,37 +2,54 @@
2
2
 
3
3
  AWS operations CLI + MCP stdio server (SSM-first).
4
4
 
5
- This package is not a plain AWS CLI wrapper. It orchestrates multi-step operations:
5
+ This package orchestrates AWS operations (inventory/runtime/remediation) with a normalized output schema and `ACTION_REQUIRED` guidance. It is not a plain AWS CLI wrapper.
6
6
 
7
- - Multi-service inventory (EC2/Lambda/ALB/ASG/RDS/ElastiCache/Route53)
8
- - SSM management/online status
9
- - Optional runtime snapshot and SSM remediation
10
- - Normalized output + `ACTION_REQUIRED` guidance for human-in-the-loop retries
11
-
12
- Execution path is internal-only (AWS SDK + AWS CLI). It does not delegate runtime execution to external AWS management MCP backends.
13
-
14
- ## Binaries
15
-
16
- - CLI: `mcp-aws-manager`
17
- - MCP stdio server: `mcp-aws-manager-mcp`
18
-
19
- ## Install
7
+ ## TL;DR
20
8
 
21
9
  ```bash
22
10
  npm install -g mcp-aws-manager
11
+ mcp-aws-manager
12
+ mcp-aws-manager doctor
13
+ mcp-aws-manager discover --profiles default --no-progress
23
14
  ```
24
15
 
25
- ## First Run (Recommended)
16
+ ## What It Does
26
17
 
27
- ```bash
28
- mcp-aws-manager
29
- ```
18
+ - Multi-service inventory: EC2, Lambda, ALB/NLB, ASG, RDS, ElastiCache, Route53
19
+ - SSM state visibility: managed/online status
20
+ - Optional runtime snapshot and SSM remediation
21
+ - Manual fallback mode: JSON/CSV server list + PEM SSH runtime snapshot (when AWS auth is unavailable)
22
+ - Human-in-the-loop retry flow via `ACTION_REQUIRED`
23
+ - Internal-only execution path (AWS SDK + AWS CLI)
24
+
25
+ ## API Coverage Snapshot
26
+
27
+ - AWS API total: no fixed official single number, but the action surface is on the order of tens of thousands across services (and continuously expanding).
28
+ - Current implementation scope is not "all AWS APIs".
29
+ - AWS SDK service clients used: `9`
30
+ - AWS SDK operation calls used: `20`
31
+ - AWS CLI commands used: `1` (`aws sso login --profile <profile>`)
32
+
33
+ Current 20 AWS SDK operations:
34
+
35
+ - STS: `GetCallerIdentity`
36
+ - EC2: `DescribeRegions`, `DescribeInstances`, `StartInstances`, `StopInstances`, `RebootInstances`, `DescribeIamInstanceProfileAssociations`, `AssociateIamInstanceProfile`, `ReplaceIamInstanceProfileAssociation`
37
+ - SSM: `DescribeInstanceInformation`, `SendCommand`, `GetCommandInvocation`
38
+ - Lambda: `ListFunctions`
39
+ - ELBv2: `DescribeLoadBalancers`, `DescribeTargetGroups`
40
+ - Auto Scaling: `DescribeAutoScalingGroups`
41
+ - RDS: `DescribeDBInstances`
42
+ - ElastiCache: `DescribeCacheClusters`
43
+ - Route53: `ListHostedZones`, `ListResourceRecordSets`
30
44
 
31
- This bootstraps MCP server registration for detected clients (`codex`, `claude` by default).
45
+ ## Binaries
46
+
47
+ - CLI: `mcp-aws-manager`
48
+ - MCP stdio server: `mcp-aws-manager-mcp`
32
49
 
33
50
  ## Agent-Assisted First-Time Setup
34
51
 
35
- Use this 5-step flow for new users.
52
+ Use this flow for new users.
36
53
 
37
54
  1. Install and bootstrap:
38
55
 
@@ -68,62 +85,130 @@ mcp-aws-manager discover --profiles default --no-progress
68
85
 
69
86
  If blocked, follow one `ACTION_REQUIRED` item, then retry the same command.
70
87
 
88
+ If AWS auth is not available, use manual fallback:
89
+
90
+ ```bash
91
+ mcp-aws-manager discover --manual-server-list ./servers.csv --pem-paths C:\keys\prod.pem --no-progress
92
+ ```
93
+
94
+ GUI report is generated by default (`./aws-inventory.html`):
95
+
96
+ ```bash
97
+ mcp-aws-manager discover --profiles default --no-progress
98
+ ```
99
+
100
+ Custom path / open behavior:
101
+
102
+ ```bash
103
+ mcp-aws-manager discover --profiles default --html-out ./inventory.html --open-html --no-progress
104
+ ```
105
+
71
106
  ## User Confirmation Required
72
107
 
73
- These are expected manual steps (agent-guided):
108
+ These are normally the only manual steps (agent-guided):
74
109
 
75
110
  - SSO browser login and MFA confirmation
76
111
  - IAM permission approval in organization account
77
112
  - For EC2 runtime visibility: attach `AmazonSSMManagedInstanceCore` and keep SSM Agent/network healthy
78
113
 
79
- ## Prerequisites
114
+ ## MCP Tool Usage
115
+
116
+ Run MCP server:
117
+
118
+ ```bash
119
+ mcp-aws-manager-mcp
120
+ ```
121
+
122
+ Exposed MCP tools:
123
+
124
+ - `discover_ec2_with_ssm`
125
+ - `ec2_start_instances`
126
+ - `ec2_stop_instances`
127
+ - `ec2_reboot_instances`
128
+ - `ec2_apply_instance_profile`
129
+ - `mcp_aws_discover_cli_help`
130
+
131
+ Mutation tool examples:
132
+
133
+ - `ec2_start_instances`: `{ "profile": "default", "region": "ap-southeast-1", "instanceIds": ["i-123"] }`
134
+ - `ec2_stop_instances`: `{ "profile": "default", "region": "ap-southeast-1", "instanceIds": ["i-123"], "force": false }`
135
+ - `ec2_reboot_instances`: `{ "profile": "default", "region": "ap-southeast-1", "instanceIds": ["i-123"] }`
136
+ - `ec2_apply_instance_profile`: `{ "profile": "default", "region": "ap-southeast-1", "instanceId": "i-123", "instanceProfileName": "my-ssm-profile", "allowReplaceProfile": true }`
137
+
138
+ Example tool args:
139
+
140
+ ```json
141
+ {
142
+ "profiles": ["default"],
143
+ "regions": ["ap-northeast-2"],
144
+ "includeLambda": true,
145
+ "publicOnly": true,
146
+ "runtimeSnapshot": true,
147
+ "htmlOutPath": "C:\\tmp\\inventory.html",
148
+ "openHtml": true,
149
+ "manualServerListPath": "C:\\tmp\\servers.csv",
150
+ "pemPaths": ["C:\\keys\\prod.pem"],
151
+ "sshUser": "ec2-user",
152
+ "sshPort": 22,
153
+ "sshConnectTimeoutSec": 8,
154
+ "autoSsoLogin": true,
155
+ "noProgress": true
156
+ }
157
+ ```
158
+
159
+ ## Action Codes
80
160
 
81
- - Node.js `>=18`
82
- - AWS credentials on the host where CLI/MCP runs:
83
- - SSO: `aws configure sso --profile <profile>` then `aws sso login --profile <profile>`
84
- - Access key: `aws configure --profile <profile>`
85
- - Verify auth:
86
- - `aws sts get-caller-identity --profile <profile>`
87
- - Runtime snapshot permissions:
88
- - `ssm:SendCommand`, `ssm:GetCommandInvocation`, `ssm:DescribeInstanceInformation`
89
- - Auto-remediation permissions:
90
- - `ec2:AssociateIamInstanceProfile`
91
- - optional `ec2:ReplaceIamInstanceProfileAssociation`
92
- - `iam:PassRole`
161
+ Common `ACTION_REQUIRED` codes:
93
162
 
94
- Why SSO is recommended:
163
+ - `SSO_LOGIN_NEEDED`
164
+ - `AWS_CREDENTIALS_REQUIRED`
165
+ - `IAM_PERMISSION_REQUIRED`
166
+ - `AWS_OPERATION_FAILED`
167
+ - `SSM_ROLE_OR_AGENT_REQUIRED`
168
+ - `INSTANCE_HAS_PROFILE`
169
+ - `IAM_PROFILE_ASSOCIATION_FAILED`
170
+ - `SSM_RUNCOMMAND_PERMISSION_REQUIRED`
171
+ - `LAMBDA_LIST_PERMISSION_REQUIRED`
172
+ - `ELBV2_LIST_PERMISSION_REQUIRED`
173
+ - `ASG_LIST_PERMISSION_REQUIRED`
174
+ - `RDS_LIST_PERMISSION_REQUIRED`
175
+ - `ELASTICACHE_LIST_PERMISSION_REQUIRED`
176
+ - `ROUTE53_LIST_PERMISSION_REQUIRED`
177
+ - `MANUAL_SERVER_LIST_EMPTY`
178
+ - `MANUAL_SERVER_HOST_REQUIRED`
179
+ - `PEM_KEY_NOT_FOUND`
180
+ - `PEM_MAPPING_REQUIRED`
181
+ - `SSH_CLIENT_NOT_FOUND`
182
+ - `SSH_AUTH_OR_CONNECT_FAILED`
95
183
 
96
- - Avoid long-lived access keys on user machines
97
- - Easier MFA/session-based enforcement
98
- - Better centralized revoke/audit handling
184
+ <details>
185
+ <summary>Detailed AWS Auth Setup (SSO vs Access Key)</summary>
99
186
 
100
- ## Commands
187
+ SSO is recommended because:
101
188
 
102
- - `mcp-aws-manager`: bootstrap mode (default)
103
- - `mcp-aws-manager setup`: register/re-register MCP server
104
- - `mcp-aws-manager doctor`: check install/registration/auth readiness
105
- - `mcp-aws-manager discover ...`: run inventory/runtime workflow
189
+ - Avoids long-lived access keys on user machines
190
+ - Enforces session-based login and MFA more easily
191
+ - Improves centralized revoke/audit handling
106
192
 
107
- ## Quick Commands
193
+ SSO setup:
108
194
 
109
195
  ```bash
110
- mcp-aws-manager
111
- mcp-aws-manager doctor
112
- mcp-aws-manager discover --profiles default
113
- mcp-aws-manager discover --profiles default --include-lambda
114
- mcp-aws-manager discover --profiles default --include-alb --include-asg --include-rds --include-elasticache --include-route53
115
- mcp-aws-manager discover --profiles default --public-only
116
- mcp-aws-manager discover --profiles default --runtime-snapshot
117
- mcp-aws-manager discover --profiles default --auto-remediate-ssm --ssm-instance-profile-name MySsmInstanceProfile
196
+ aws configure sso --profile default
197
+ aws sso login --profile default
198
+ aws sts get-caller-identity --profile default
118
199
  ```
119
200
 
120
- Legacy invocation form (still supported):
201
+ Access key setup (optional):
121
202
 
122
203
  ```bash
123
- mcp-aws-manager --profiles default --public-only
204
+ aws configure --profile default
205
+ aws sts get-caller-identity --profile default
124
206
  ```
125
207
 
126
- ## Important Discover Options
208
+ </details>
209
+
210
+ <details>
211
+ <summary>Discover Option Reference</summary>
127
212
 
128
213
  - `--profiles <a,b,c>`
129
214
  - `--regions <a,b,c>`
@@ -144,52 +229,47 @@ mcp-aws-manager --profiles default --public-only
144
229
  - `--snapshot-timeout <seconds>`
145
230
  - `--snapshot-concurrency <n>`
146
231
  - `--snapshot-max-kb <n>`
232
+ - `--manual-server-list <path>` (JSON/CSV)
233
+ - `--pem-paths <a,b,c>`
234
+ - `--ssh-user <name>`
235
+ - `--ssh-port <port>`
236
+ - `--ssh-connect-timeout <seconds>`
237
+ - `--html-out <path>` (default: `./aws-inventory.html`)
238
+ - `--open-html` (force open)
239
+ - `--no-open-html` (disable auto-open)
147
240
  - `--auto-sso-login` / `--no-auto-sso-login`
148
241
  - `--format <json|csv>`
149
242
  - `--out <path>`
150
243
 
151
- ## MCP Tool Usage
244
+ </details>
152
245
 
153
- Run MCP server:
246
+ <details>
247
+ <summary>Permission Checklist</summary>
154
248
 
155
- ```bash
156
- mcp-aws-manager-mcp
157
- ```
249
+ Minimum permissions depend on enabled features.
158
250
 
159
- Exposed MCP tools:
251
+ - Core inventory: `ec2:DescribeRegions`, `ec2:DescribeInstances`
252
+ - Lambda: `lambda:ListFunctions`
253
+ - ALB/TargetGroups: `elasticloadbalancing:DescribeLoadBalancers`, `elasticloadbalancing:DescribeTargetGroups`
254
+ - ASG: `autoscaling:DescribeAutoScalingGroups`
255
+ - RDS: `rds:DescribeDBInstances`
256
+ - ElastiCache: `elasticache:DescribeCacheClusters`
257
+ - Route53: `route53:ListHostedZones`, `route53:ListResourceRecordSets`
258
+ - Runtime snapshot: `ssm:SendCommand`, `ssm:GetCommandInvocation`, `ssm:DescribeInstanceInformation`
259
+ - Auto-remediation: `ec2:AssociateIamInstanceProfile`, optional `ec2:ReplaceIamInstanceProfileAssociation`, `iam:PassRole`
160
260
 
161
- - `discover_ec2_with_ssm`
162
- - `mcp_aws_discover_cli_help`
261
+ Manual fallback mode:
163
262
 
164
- Example tool args:
263
+ - Inventory uses user-provided server list file (no AWS API required)
264
+ - Runtime snapshot uses local `ssh` client + PEM key access
165
265
 
166
- ```json
167
- {
168
- "profiles": ["default"],
169
- "regions": ["ap-northeast-2"],
170
- "includeLambda": true,
171
- "publicOnly": true,
172
- "runtimeSnapshot": true,
173
- "autoSsoLogin": true,
174
- "noProgress": true
175
- }
176
- ```
177
-
178
- ## ACTION_REQUIRED Examples
179
-
180
- - `SSO_LOGIN_NEEDED`
181
- - `SSM_ROLE_OR_AGENT_REQUIRED`
182
- - `IAM_PROFILE_ASSOCIATION_FAILED`
183
- - `SSM_RUNCOMMAND_PERMISSION_REQUIRED`
184
- - `LAMBDA_LIST_PERMISSION_REQUIRED`
185
- - `ELBV2_LIST_PERMISSION_REQUIRED`
186
- - `ASG_LIST_PERMISSION_REQUIRED`
187
- - `RDS_LIST_PERMISSION_REQUIRED`
188
- - `ELASTICACHE_LIST_PERMISSION_REQUIRED`
189
- - `ROUTE53_LIST_PERMISSION_REQUIRED`
266
+ </details>
190
267
 
191
268
  ## Related Docs
192
269
 
270
+ - `README_KO.md`: Korean overview and quick start
271
+ - `MCP_CLIENT_SETUP_KO.md`: Korean MCP client registration guide
272
+ - `AWS_SSO_SETUP_GUIDE_KO.md`: Korean AWS auth setup guide
193
273
  - `MCP_CLIENT_SETUP.md`: MCP registration and stdio config details
194
274
  - `AGENT_GUIDANCE_LOOP_TEMPLATE_KO.md`: agent retry/guidance template
195
275
  - `IMPLEMENTATION_INTEGRATIONS.md`: API/CLI integration inventory
package/README_KO.md ADDED
@@ -0,0 +1,117 @@
1
+ # mcp-aws-manager (한국어 안내)
2
+
3
+ AWS 운영 작업용 CLI + MCP stdio 서버입니다.
4
+
5
+ 이 패키지는 AWS 인벤토리/런타임/완화 작업을 정규화된 출력 스키마와 `ACTION_REQUIRED` 가이드로 제공합니다. 단순 AWS CLI 래퍼가 아니라, 에이전트 친화적인 운영 워크플로우를 목표로 합니다.
6
+
7
+ ## 빠른 시작
8
+
9
+ ```bash
10
+ npm install -g mcp-aws-manager
11
+ mcp-aws-manager
12
+ mcp-aws-manager doctor
13
+ mcp-aws-manager discover --profiles default --no-progress
14
+ ```
15
+
16
+ ## 핵심 기능
17
+
18
+ - 멀티 서비스 인벤토리: EC2, Lambda, ALB/NLB, ASG, RDS, ElastiCache, Route53
19
+ - SSM 상태 확인: managed/online
20
+ - 런타임 스냅샷(선택), SSM 완화(선택)
21
+ - AWS 인증이 안 될 때 수동 모드: JSON/CSV 서버 목록 + PEM SSH
22
+ - GUI 리포트 기본 생성: `./aws-inventory.html` (검색/필터/CSV 다운로드 버튼 포함)
23
+ - 사람이 개입해야 할 상황을 `ACTION_REQUIRED`로 표준화
24
+
25
+ ## 바이너리
26
+
27
+ - CLI: `mcp-aws-manager`
28
+ - MCP stdio server: `mcp-aws-manager-mcp`
29
+
30
+ ## 최초 설정(권장 흐름)
31
+
32
+ 1. 설치 및 부트스트랩
33
+
34
+ ```bash
35
+ npm.cmd install -g mcp-aws-manager@latest
36
+ mcp-aws-manager
37
+ ```
38
+
39
+ 2. 상태 확인
40
+
41
+ ```bash
42
+ mcp-aws-manager doctor
43
+ ```
44
+
45
+ 3. AWS 인증 설정(권장: SSO)
46
+
47
+ ```bash
48
+ aws configure sso --profile default
49
+ aws sso login --profile default
50
+ ```
51
+
52
+ 4. 인증 확인
53
+
54
+ ```bash
55
+ aws sts get-caller-identity --profile default
56
+ ```
57
+
58
+ 5. 인벤토리 실행
59
+
60
+ ```bash
61
+ mcp-aws-manager discover --profiles default --no-progress
62
+ ```
63
+
64
+ ## 인증 불가 시 수동 모드
65
+
66
+ ```bash
67
+ mcp-aws-manager discover --manual-server-list ./servers.csv --pem-paths C:\keys\prod.pem --no-progress
68
+ ```
69
+
70
+ ## GUI 리포트
71
+
72
+ ```bash
73
+ mcp-aws-manager discover --profiles default --no-progress
74
+ ```
75
+
76
+ - 기본 경로: `./aws-inventory.html`
77
+ - `--html-out <path>`: 리포트 경로 변경
78
+ - `--open-html`: 생성 후 브라우저 오픈 강제
79
+ - `--no-open-html`: 자동 오픈 비활성화
80
+ - GUI에서 현재 뷰 기준 CSV 다운로드 가능
81
+
82
+ ## MCP 도구
83
+
84
+ 조회:
85
+
86
+ - `discover_ec2_with_ssm`
87
+ - `mcp_aws_discover_cli_help`
88
+
89
+ 변경:
90
+
91
+ - `ec2_start_instances`
92
+ - `ec2_stop_instances`
93
+ - `ec2_reboot_instances`
94
+ - `ec2_apply_instance_profile`
95
+
96
+ 예시:
97
+
98
+ - `ec2_start_instances`: `{ "profile": "default", "region": "ap-southeast-1", "instanceIds": ["i-123"] }`
99
+ - `ec2_apply_instance_profile`: `{ "profile": "default", "region": "ap-southeast-1", "instanceId": "i-123", "instanceProfileName": "my-ssm-profile", "allowReplaceProfile": true }`
100
+
101
+ ## 자주 쓰는 ACTION_REQUIRED
102
+
103
+ - 인증: `SSO_LOGIN_NEEDED`, `AWS_CREDENTIALS_REQUIRED`
104
+ - 권한: `IAM_PERMISSION_REQUIRED`, `AWS_OPERATION_FAILED`
105
+ - SSM/런타임: `SSM_ROLE_OR_AGENT_REQUIRED`, `SSM_RUNCOMMAND_PERMISSION_REQUIRED`
106
+ - 수동 모드: `MANUAL_SERVER_LIST_EMPTY`, `MANUAL_SERVER_HOST_REQUIRED`, `PEM_KEY_NOT_FOUND`, `PEM_MAPPING_REQUIRED`, `SSH_CLIENT_NOT_FOUND`
107
+
108
+ ## 한국어 관련 문서
109
+
110
+ - `MCP_CLIENT_SETUP_KO.md`
111
+ - `AWS_SSO_SETUP_GUIDE_KO.md`
112
+
113
+ ## 원문(영문) 문서
114
+
115
+ - `README.md`
116
+ - `MCP_CLIENT_SETUP.md`
117
+ - `AWS_SSO_SETUP_GUIDE.md`