@yawlabs/aws-mcp 1.2.1 → 1.3.1

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.
Files changed (3) hide show
  1. package/README.md +20 -4
  2. package/dist/index.js +36 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -100,23 +100,39 @@ The rest -- SSO device-code re-login, CCAPI CRUD with dry-run diffs, multi-regio
100
100
 
101
101
  ## Install
102
102
 
103
+ Add to your MCP client config (e.g. `.mcp.json`):
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "aws": {
109
+ "command": "npx",
110
+ "args": ["-y", "@yawlabs/aws-mcp"]
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ The `-y` flag is what gives you **auto-update on each session load**: every time your MCP client spawns the server, `npx` checks the registry for the latest `@yawlabs/aws-mcp` and downloads it if newer. The first launch in a fresh cache adds ~100-500 ms; subsequent launches use npm's cache (typical metadata-freshness window: 5 min) and add ~50 ms or less. Once the server is up, tool calls have zero auto-update overhead -- the check fires only on (re-)spawn. No separate install step is needed; `-y` covers both first-time install and ongoing updates.
117
+
118
+ If you'd rather pin a specific version (no auto-update, but zero startup overhead), install globally and point the config at the installed binary:
119
+
103
120
  ```bash
104
121
  npm install -g @yawlabs/aws-mcp
105
122
  ```
106
123
 
107
- Or add to your MCP client config (e.g. `.mcp.json`):
108
-
109
124
  ```json
110
125
  {
111
126
  "mcpServers": {
112
127
  "aws": {
113
- "command": "npx",
114
- "args": ["-y", "@yawlabs/aws-mcp"]
128
+ "command": "aws-mcp"
115
129
  }
116
130
  }
117
131
  }
118
132
  ```
119
133
 
134
+ You'll need to `npm install -g @yawlabs/aws-mcp@latest` manually when you want a newer version.
135
+
120
136
  ## Example session
121
137
 
122
138
  You ask the assistant to check a staging bucket, but your SSO token just expired. What the assistant does (and what you see):
package/dist/index.js CHANGED
@@ -55453,6 +55453,14 @@ function isValidStatistic(s) {
55453
55453
  if (SIMPLE_STATS.some((stat) => stat.toLowerCase() === lower)) return true;
55454
55454
  return EXTENDED_STAT_RE.test(s);
55455
55455
  }
55456
+ function canonicalizeStatistic(s) {
55457
+ const lower = s.toLowerCase();
55458
+ for (const stat of SIMPLE_STATS) {
55459
+ if (stat.toLowerCase() === lower) return stat;
55460
+ }
55461
+ if (EXTENDED_STAT_RE.test(s)) return lower;
55462
+ return s;
55463
+ }
55456
55464
  var QUERY_ID_RE = /^[a-z][A-Za-z0-9_]*$/;
55457
55465
  var MAX_QUERIES = 100;
55458
55466
  var PERIOD_3H_MS = 3 * 60 * 60 * 1e3;
@@ -55505,7 +55513,7 @@ function buildMetricDataQueries(inputs, autoPeriod) {
55505
55513
  ...dimensions ? { Dimensions: dimensions } : {}
55506
55514
  },
55507
55515
  Period: q.period ?? autoPeriod,
55508
- Stat: q.statistic ?? "Average"
55516
+ Stat: q.statistic !== void 0 ? canonicalizeStatistic(q.statistic) : "Average"
55509
55517
  };
55510
55518
  if (q.unit !== void 0) stat.Unit = q.unit;
55511
55519
  base.MetricStat = stat;
@@ -55682,7 +55690,6 @@ var metricsTools = [
55682
55690
  var DEFAULT_CONCURRENCY = 8;
55683
55691
  var MAX_CONCURRENCY = 32;
55684
55692
  var MAX_REGIONS = 32;
55685
- var REGION_RE = /^[a-z][a-z0-9-]{2,30}$/;
55686
55693
  async function runWithConcurrency(inputs, concurrency, fn) {
55687
55694
  const results = new Array(inputs.length);
55688
55695
  let next = 0;
@@ -55735,11 +55742,11 @@ var multiRegionTools = [
55735
55742
  }
55736
55743
  const concurrency = i.concurrency ?? DEFAULT_CONCURRENCY;
55737
55744
  const results = await runWithConcurrency(regions, concurrency, async (region) => {
55738
- if (!REGION_RE.test(region)) {
55745
+ if (!isValidRegionName(region)) {
55739
55746
  return {
55740
55747
  region,
55741
55748
  ok: false,
55742
- error: `Invalid region '${region}'. Must match /^[a-z][a-z0-9-]{2,30}$/.`,
55749
+ error: `Invalid region '${region}'. Must match ${REGION_NAME_RE} (e.g. 'us-east-1').`,
55743
55750
  errorKind: "bad_input"
55744
55751
  };
55745
55752
  }
@@ -56639,6 +56646,12 @@ function defaultScriptHandlers() {
56639
56646
  const callTool = findTool("aws_call", callTools);
56640
56647
  const paginateTool = findTool("aws_paginate", paginateTools);
56641
56648
  const logsTailTool = findTool("aws_logs_tail", logsTools);
56649
+ const metricsQueryTool = findTool("aws_metrics_query", metricsTools);
56650
+ const iamSimulateTool = findTool("aws_iam_simulate", iamSimulateTools);
56651
+ const multiRegionTool = findTool("aws_multi_region", multiRegionTools);
56652
+ const assumeRoleTool = findTool("aws_assume_role", assumeTools);
56653
+ const docsSearchTool = findTool("aws_docs_search", docsTools);
56654
+ const docsReadTool = findTool("aws_docs_read", docsTools);
56642
56655
  const resourceGet = findTool("aws_resource_get", resourceTools);
56643
56656
  const resourceList = findTool("aws_resource_list", resourceTools);
56644
56657
  const resourceCreate = findTool("aws_resource_create", resourceTools);
@@ -56650,6 +56663,10 @@ function defaultScriptHandlers() {
56650
56663
  paginate: (input) => unwrap(paginateTool, input),
56651
56664
  paginateAll: buildPaginateAll(paginateTool),
56652
56665
  logsTail: (input) => unwrap(logsTailTool, input),
56666
+ metricsQuery: (input) => unwrap(metricsQueryTool, input),
56667
+ iamSimulate: (input) => unwrap(iamSimulateTool, input),
56668
+ multiRegion: (input) => unwrap(multiRegionTool, input),
56669
+ assumeRole: (input) => unwrap(assumeRoleTool, input),
56653
56670
  resource: {
56654
56671
  get: (input) => unwrap(resourceGet, input),
56655
56672
  list: (input) => unwrap(resourceList, input),
@@ -56657,6 +56674,10 @@ function defaultScriptHandlers() {
56657
56674
  update: (input) => unwrap(resourceUpdate, input),
56658
56675
  delete: (input) => unwrap(resourceDelete, input),
56659
56676
  status: (input) => unwrap(resourceStatus, input)
56677
+ },
56678
+ docs: {
56679
+ search: (input) => unwrap(docsSearchTool, input),
56680
+ read: (input) => unwrap(docsReadTool, input)
56660
56681
  }
56661
56682
  };
56662
56683
  }
@@ -56710,6 +56731,10 @@ async function runScript(opts, handlers = defaultScriptHandlers()) {
56710
56731
  paginate: wrapForRealm(handlers.paginate),
56711
56732
  paginateAll: wrapForRealm(handlers.paginateAll),
56712
56733
  logsTail: wrapForRealm(handlers.logsTail),
56734
+ metricsQuery: wrapForRealm(handlers.metricsQuery),
56735
+ iamSimulate: wrapForRealm(handlers.iamSimulate),
56736
+ multiRegion: wrapForRealm(handlers.multiRegion),
56737
+ assumeRole: wrapForRealm(handlers.assumeRole),
56713
56738
  resource: {
56714
56739
  get: wrapForRealm(handlers.resource.get),
56715
56740
  list: wrapForRealm(handlers.resource.list),
@@ -56717,6 +56742,10 @@ async function runScript(opts, handlers = defaultScriptHandlers()) {
56717
56742
  update: wrapForRealm(handlers.resource.update),
56718
56743
  delete: wrapForRealm(handlers.resource.delete),
56719
56744
  status: wrapForRealm(handlers.resource.status)
56745
+ },
56746
+ docs: {
56747
+ search: wrapForRealm(handlers.docs.search),
56748
+ read: wrapForRealm(handlers.docs.read)
56720
56749
  }
56721
56750
  };
56722
56751
  Object.assign(ctx, {
@@ -56801,7 +56830,7 @@ ${opts.code}
56801
56830
  var scriptTools = [
56802
56831
  {
56803
56832
  name: "aws_script",
56804
- description: "Run a short JavaScript snippet that orchestrates other aws-mcp tools (aws.call, aws.paginate, aws.paginateAll, aws.resource.*, aws.logsTail) and returns a combined result. Best for batched read+filter+aggregate workflows that would otherwise need N tool round-trips: 'list all Lambdas, fetch each one's config, return those with memory > 1024'. Use `return <value>` at the end to surface a result; console.log lines are captured and returned alongside. Helpers throw Errors on failure -- use try/catch. NOT a security sandbox -- treat the same as any other tool the model can call.",
56833
+ description: "Run a short JavaScript snippet that orchestrates other aws-mcp tools (aws.call, aws.paginate, aws.paginateAll, aws.resource.*, aws.logsTail, aws.metricsQuery, aws.iamSimulate, aws.multiRegion, aws.assumeRole, aws.docs.{search,read}) and returns a combined result. Best for batched read+filter+aggregate workflows that would otherwise need N tool round-trips: 'list all Lambdas, fetch each one's config, return those with memory > 1024'. Use `return <value>` at the end to surface a result; console.log lines are captured and returned alongside. Helpers throw Errors on failure -- use try/catch. NOT a security sandbox -- treat the same as any other tool the model can call.",
56805
56834
  annotations: {
56806
56835
  title: "Run a JS snippet that orchestrates AWS tool calls",
56807
56836
  // The script may invoke destructive tools (resource.create/update/delete)
@@ -56813,7 +56842,7 @@ var scriptTools = [
56813
56842
  },
56814
56843
  inputSchema: external_exports3.object({
56815
56844
  code: external_exports3.string().min(1).describe(
56816
- "JavaScript snippet evaluated inside `(async () => { ... })()`. Use `return <value>` to surface a result. Bound globals: aws.call, aws.paginate, aws.paginateAll, aws.resource.{get,list,create,update,delete,status}, aws.logsTail, console (capture), JSON, Math, Date, Promise, Array, Object, String, Number, Boolean, Error, Intl, Atomics, SharedArrayBuffer, WebAssembly (compile blocked). Shadowed (undefined): require, import, process, fs, fetch + family, BroadcastChannel, setTimeout/Interval, queueMicrotask, Buffer, global, globalThis. NOT available (ReferenceError if used): URL, URLSearchParams, TextEncoder, TextDecoder, crypto, structuredClone, EventTarget, MessageChannel, performance. eval/Function are disabled (codeGeneration off). Tool helpers throw on failure -- wrap in try/catch when you want to handle errors per-call."
56845
+ "JavaScript snippet evaluated inside `(async () => { ... })()`. Use `return <value>` to surface a result. Bound globals: aws.call, aws.paginate, aws.paginateAll, aws.resource.{get,list,create,update,delete,status}, aws.logsTail, aws.metricsQuery, aws.iamSimulate, aws.multiRegion, aws.assumeRole, aws.docs.{search,read}, console (capture), JSON, Math, Date, Promise, Array, Object, String, Number, Boolean, Error, Intl, Atomics, SharedArrayBuffer, WebAssembly (compile blocked). Intentionally NOT bound (call as sibling MCP tools instead): aws_list_profiles, the auth/session tools, and aws_script itself. Shadowed (undefined): require, import, process, fs, fetch + family, BroadcastChannel, setTimeout/Interval, queueMicrotask, Buffer, global, globalThis. NOT available (ReferenceError if used): URL, URLSearchParams, TextEncoder, TextDecoder, crypto, structuredClone, EventTarget, MessageChannel, performance. eval/Function are disabled (codeGeneration off). Tool helpers throw on failure -- wrap in try/catch when you want to handle errors per-call."
56817
56846
  ),
56818
56847
  timeoutMs: external_exports3.number().int().positive().max(MAX_TIMEOUT_MS).optional().describe(
56819
56848
  `Wall-clock timeout in milliseconds. Default ${DEFAULT_TIMEOUT_MS2}; max ${MAX_TIMEOUT_MS}. Covers evaluation plus every awaited aws.* call. On timeout the script stops being awaited and the tool returns an error, but any aws.* call already in flight is NOT cancelled -- it continues until its own per-call timeout (default 60s). Plan retries accordingly: a script that timed out mid 'resource.delete' may have completed the delete; re-issuing the same script can double-mutate.`
@@ -56914,7 +56943,7 @@ var sessionTools = [
56914
56943
  ];
56915
56944
 
56916
56945
  // src/index.ts
56917
- var version2 = true ? "1.2.1" : (await null).createRequire(import.meta.url)("../package.json").version;
56946
+ var version2 = true ? "1.3.1" : (await null).createRequire(import.meta.url)("../package.json").version;
56918
56947
  var subcommand = process.argv[2];
56919
56948
  if (subcommand === "version" || subcommand === "--version") {
56920
56949
  console.log(version2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/aws-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "mcpName": "io.github.YawLabs/aws-mcp",
5
5
  "description": "AWS MCP server — call any AWS API from AI assistants, with first-class SSO re-login (no more 'browser won't open' dead ends)",
6
6
  "license": "MIT",