mcp-aws-manager 0.4.1 → 0.4.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/README.md CHANGED
@@ -8,6 +8,7 @@ This package orchestrates AWS operations (inventory/runtime/remediation) with a
8
8
 
9
9
  ```bash
10
10
  npm install -g mcp-aws-manager
11
+ mcp-aws-manager --version
11
12
  mcp-aws-manager
12
13
  mcp-aws-manager doctor
13
14
  mcp-aws-manager discover --profiles default --no-progress
@@ -152,16 +153,33 @@ Optional explicit registration:
152
153
 
153
154
  ```bash
154
155
  mcp-aws-manager setup
155
- mcp-aws-manager setup --clients codex,claude
156
- mcp-aws-manager setup --clients cursor,windsurf,antigravity
156
+ mcp-aws-manager setup --clients cursor
157
+ mcp-aws-manager setup --clients codex
158
+ mcp-aws-manager setup --clients claude
157
159
  ```
158
160
 
161
+ Default behavior (`setup`/`bootstrap` without `--clients`) auto-detects installed clients and registers only detected CLIs.
162
+
159
163
  2. Health check:
160
164
 
161
165
  ```bash
162
166
  mcp-aws-manager doctor
163
167
  ```
164
168
 
169
+ Default behavior (`doctor` without `--clients`) auto-detects installed clients and skips non-installed CLIs.
170
+
171
+ ### Agent Instruction Snippet (Any Client)
172
+
173
+ When asking an agent to check AWS status, use this exact sequence first:
174
+
175
+ ```bash
176
+ mcp-aws-manager setup --force
177
+ mcp-aws-manager doctor
178
+ mcp-aws-manager discover --profiles default --no-progress
179
+ ```
180
+
181
+ Require the agent to include `runId`/`started_at` (live run evidence) in the response. If missing, treat it as file-only/cached summary.
182
+
165
183
  3. Configure AWS auth (SSO recommended):
166
184
 
167
185
  ```bash
package/README_KO.md CHANGED
@@ -8,6 +8,7 @@ SSM 우선(SSM-first) 방식의 AWS 운영 CLI + MCP stdio 서버입니다.
8
8
 
9
9
  ```bash
10
10
  npm install -g mcp-aws-manager
11
+ mcp-aws-manager --version
11
12
  mcp-aws-manager
12
13
  mcp-aws-manager doctor
13
14
  mcp-aws-manager discover --profiles default --no-progress
@@ -152,16 +153,33 @@ bootstrap/setup 기본 동작은 단일 서버 1개를 등록합니다.
152
153
 
153
154
  ```bash
154
155
  mcp-aws-manager setup
155
- mcp-aws-manager setup --clients codex,claude
156
- mcp-aws-manager setup --clients cursor,windsurf,antigravity
156
+ mcp-aws-manager setup --clients cursor
157
+ mcp-aws-manager setup --clients codex
158
+ mcp-aws-manager setup --clients claude
157
159
  ```
158
160
 
161
+ 기본 동작(`--clients` 없이 `setup`/`bootstrap`)은 설치된 클라이언트를 자동 감지해, 감지된 CLI만 등록합니다.
162
+
159
163
  2. 상태 점검:
160
164
 
161
165
  ```bash
162
166
  mcp-aws-manager doctor
163
167
  ```
164
168
 
169
+ 기본 동작(`--clients` 없이 `doctor`)은 설치된 클라이언트를 자동 감지하고, 미설치 CLI는 skip 처리합니다.
170
+
171
+ ### 에이전트 지시용 공통 스니펫
172
+
173
+ 에이전트에게 AWS 상태 점검을 지시할 때는 먼저 아래 순서를 그대로 실행하도록 요청하세요.
174
+
175
+ ```bash
176
+ mcp-aws-manager setup --force
177
+ mcp-aws-manager doctor
178
+ mcp-aws-manager discover --profiles default --no-progress
179
+ ```
180
+
181
+ 응답에는 반드시 `runId`/`started_at`(라이브 실행 증거)를 포함하도록 요구하세요. 없으면 파일 기반/캐시 요약으로 간주하세요.
182
+
165
183
  3. AWS 인증 설정(권장: SSO):
166
184
 
167
185
  ```bash
@@ -723,6 +723,8 @@ function usageText() {
723
723
  return [
724
724
  "Usage:",
725
725
  " mcp-aws-manager",
726
+ " mcp-aws-manager version",
727
+ " mcp-aws-manager --version",
726
728
  " mcp-aws-manager bootstrap [options]",
727
729
  " mcp-aws-manager setup [options]",
728
730
  " mcp-aws-manager doctor [options]",
@@ -734,6 +736,7 @@ function usageText() {
734
736
  "SSM-first AWS inventory/runtime collector (EC2/Lambda/ALB/ASG/RDS/ElastiCache/Route53 + VPC/ECS/S3/IAM/KMS/CloudWatch/CloudTrail/Config/ECR/DynamoDB/SNS/SQS/Budgets/CostAnomaly + EBS/EFS/EKS/APIGateway/CloudFront/WAF/Shield/StepFunctions/CloudWatchLogs/X-Ray/Inspector2/Redshift/OpenSearch/Organizations/ControlTower + ACM/Kinesis/MSK) plus MCP client setup helper.",
735
737
  "",
736
738
  "Commands:",
739
+ " version Print CLI package version",
737
740
  " bootstrap Ensure mcp-aws-manager MCP server is registered (default command)",
738
741
  " setup Register/re-register MCP server for supported clients",
739
742
  " doctor Check install and registration health",
@@ -743,7 +746,7 @@ function usageText() {
743
746
  "",
744
747
  "Setup/Bootstrap/Doctor options:",
745
748
  " (target: mcp-aws-manager => auto-resolved runtime command for mcp-aws-manager-mcp)",
746
- ` --clients <${clientList}> (default: codex,claude)`,
749
+ ` --clients <${clientList}> (default: auto-detect installed clients)`,
747
750
  " --force (setup/bootstrap only; always remove then add)",
748
751
  " -h, --help",
749
752
  "",
@@ -995,6 +998,9 @@ function parseCommand(argv) {
995
998
  }
996
999
 
997
1000
  const first = String(args[0] || "");
1001
+ if (first === "-v" || first === "--version" || first === "version") {
1002
+ return { command: "version", args: [] };
1003
+ }
998
1004
  if (first === "-h" || first === "--help") {
999
1005
  return { command: "help", args: [] };
1000
1006
  }
@@ -1071,10 +1077,12 @@ function parseRegistrationArgs(argv, opts = {}) {
1071
1077
  }
1072
1078
 
1073
1079
  const defaultTarget = resolveDefaultRegistrationTarget();
1080
+ const clientsExplicit = Boolean(options.clients && String(options.clients).trim());
1074
1081
  return {
1075
1082
  help: false,
1076
1083
  targets: [defaultTarget],
1077
- clients: options.clients ? parseClients(options.clients) : ["codex", "claude"],
1084
+ clients: options.clients ? parseClients(options.clients) : Array.from(SUPPORTED_CLIENTS),
1085
+ clientsExplicit,
1078
1086
  force: options.force
1079
1087
  };
1080
1088
  }
@@ -2460,15 +2468,26 @@ function targetCommandLabel(target) {
2460
2468
  return [command, ...args].join(" ");
2461
2469
  }
2462
2470
 
2471
+ function detectClientAvailability(clients) {
2472
+ const candidateClients = Array.isArray(clients) && clients.length
2473
+ ? clients
2474
+ : Array.from(SUPPORTED_CLIENTS);
2475
+ return candidateClients.map((cliBin) => {
2476
+ const exists = clientHelpAttempts(cliBin).some((args) => commandExists(cliBin, args));
2477
+ return { cliBin, exists };
2478
+ });
2479
+ }
2480
+
2463
2481
  function runSetupInternal(config, options = {}) {
2464
2482
  const ensureOnly = options.ensureOnly === true;
2465
2483
  const defaultTarget = resolveDefaultRegistrationTarget();
2466
2484
  const targets = Array.isArray(config.targets) && config.targets.length
2467
2485
  ? config.targets
2468
2486
  : [defaultTarget];
2469
- const clients = config.clients.filter((cli) =>
2470
- clientHelpAttempts(cli).some((args) => commandExists(cli, args))
2471
- );
2487
+ const clientsExplicit = config && config.clientsExplicit === true;
2488
+ const availability = detectClientAvailability(config.clients);
2489
+ const clients = availability.filter((row) => row.exists).map((row) => row.cliBin);
2490
+ const missingClients = availability.filter((row) => !row.exists).map((row) => row.cliBin);
2472
2491
  const results = [];
2473
2492
  const commandChecks = targets.map((target) => ({
2474
2493
  ...target,
@@ -2477,7 +2496,11 @@ function runSetupInternal(config, options = {}) {
2477
2496
 
2478
2497
  process.stdout.write(ensureOnly ? "Bootstrap start.\n" : "Setup start.\n");
2479
2498
  process.stdout.write(`Targets: ${targets.map((t) => `${t.serverName}=>${targetCommandLabel(t)}`).join(", ")}\n`);
2480
- process.stdout.write(`Clients: ${config.clients.join(",")}\n`);
2499
+ process.stdout.write(`Clients(requested): ${availability.map((row) => row.cliBin).join(",")}\n`);
2500
+ process.stdout.write(`Clients(detected): ${clients.length ? clients.join(",") : "none"}\n`);
2501
+ if (!clientsExplicit && missingClients.length) {
2502
+ process.stdout.write(`Clients(skipped): ${missingClients.join(",")} (not installed or not available in PATH)\n`);
2503
+ }
2481
2504
 
2482
2505
  if (!clients.length) {
2483
2506
  process.stdout.write(`No supported client CLI found. Supported: ${Array.from(SUPPORTED_CLIENTS).join(", ")}\n`);
@@ -2546,8 +2569,11 @@ function runDoctor(config) {
2546
2569
  const targets = Array.isArray(config.targets) && config.targets.length
2547
2570
  ? config.targets
2548
2571
  : [defaultTarget];
2572
+ const clientsExplicit = config && config.clientsExplicit === true;
2573
+ const availability = detectClientAvailability(config.clients);
2549
2574
  process.stdout.write("Doctor start.\n");
2550
2575
  process.stdout.write(`Targets: ${targets.map((t) => `${t.serverName}=>${targetCommandLabel(t)}`).join(", ")}\n`);
2576
+ process.stdout.write(`Clients(requested): ${availability.map((row) => row.cliBin).join(",")}\n`);
2551
2577
  let hasIssue = false;
2552
2578
  let foundClient = false;
2553
2579
 
@@ -2563,11 +2589,15 @@ function runDoctor(config) {
2563
2589
  }
2564
2590
  }
2565
2591
 
2566
- for (const cliBin of config.clients) {
2567
- const exists = clientHelpAttempts(cliBin).some((args) => commandExists(cliBin, args));
2568
- if (!exists) {
2569
- hasIssue = true;
2570
- process.stdout.write(`${cliBin}: not installed or not available in PATH\n`);
2592
+ for (const row of availability) {
2593
+ const cliBin = row.cliBin;
2594
+ if (!row.exists) {
2595
+ if (clientsExplicit) {
2596
+ hasIssue = true;
2597
+ process.stdout.write(`${cliBin}: not installed or not available in PATH\n`);
2598
+ } else {
2599
+ process.stdout.write(`${cliBin}: skipped (not installed or not available in PATH)\n`);
2600
+ }
2571
2601
  continue;
2572
2602
  }
2573
2603
 
@@ -2586,6 +2616,7 @@ function runDoctor(config) {
2586
2616
  }
2587
2617
 
2588
2618
  if (!foundClient) {
2619
+ hasIssue = true;
2589
2620
  process.stdout.write("No requested clients detected. Install at least one supported client first.\n");
2590
2621
  }
2591
2622
 
@@ -12065,6 +12096,11 @@ async function runWorkflow(config) {
12065
12096
  async function main() {
12066
12097
  try {
12067
12098
  const parsed = parseCommand(process.argv.slice(2));
12099
+ if (parsed.command === "version") {
12100
+ process.stdout.write(`${readCurrentPackageVersion()}\n`);
12101
+ process.exitCode = 0;
12102
+ return;
12103
+ }
12068
12104
  if (parsed.command === "help") {
12069
12105
  process.stdout.write(usageText());
12070
12106
  process.exitCode = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-aws-manager",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "AWS operations CLI and MCP server (SSM-only) for EC2/Lambda inventory, remediation, and runtime snapshots",
5
5
  "license": "MIT",
6
6
  "publishConfig": {