@aaa-sentinel/mcp-server 0.12.0 → 0.13.0

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 +4 -0
  2. package/dist/cli.js +42 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -152,6 +152,10 @@ status as plain JSON.
152
152
  | `list_deployments` | `service?`, `environment?`, `accountId?`, `monitoringServiceId?`, `from?`, `to?`, `limit?`, `cursor?` | `deployments:read` | Pro |
153
153
  | `list_budgets` | — | `budgets:read` | Pro |
154
154
  | `get_budget` | `budgetId` | `budgets:read` | Pro |
155
+ | `list_leases` | `env?` | `leases:read` | Pro |
156
+ | `get_lease` | `leaseId` | `leases:read` | Pro |
157
+ | `list_environments` | — | `leases:read` | Pro |
158
+ | `get_environment_cost` | `env` | `leases:read` | Pro |
155
159
 
156
160
  In `list_savings`, `type` is one of `compute`, `storage`, `network`, `database`, `serverless`,
157
161
  `governance`. `source` is one of `own`, `corroborated`, `securityhub`, `guardduty`, `defender`,
package/dist/cli.js CHANGED
@@ -6092,6 +6092,8 @@ var SAVINGS_TYPES = ["compute", "storage", "network", "database", "serverless",
6092
6092
  var SECURITY_SOURCES = ["own", "corroborated", "securityhub", "guardduty", "defender", "scc"];
6093
6093
  var SECURITY_CATEGORIES = ["security_network", "security_exposure", "security_encryption", "security_iam", "security_logging", "security_secrets", "security_patching"];
6094
6094
  var AGENT_STATUSES = ["proposed", "pending_approval", "pending_second_approval", "approved", "executing", "completed", "failed", "cancelled", "expired"];
6095
+ var LEASE_ENV_PATTERN = "^[a-z0-9][a-z0-9._-]{0,62}$";
6096
+ var LEASE_ENV_RE = new RegExp(LEASE_ENV_PATTERN);
6095
6097
  var BillingPeriod = string2().regex(/^\d{4}-(0[1-9]|1[0-2])$/, "Use YYYY-MM");
6096
6098
  var ACCOUNT_ID = { type: "string", description: "Account identifier, as returned by list_accounts." };
6097
6099
  var CLIENT_ID = { type: "string", description: "Managed client identifier, as returned by list_clients." };
@@ -6756,6 +6758,45 @@ var TOOLS = [
6756
6758
  },
6757
6759
  argsSchema: object({ budgetId: string2().min(1) }),
6758
6760
  handler: async ({ budgetId }, config2) => apiGet(`/v1/budgets/${encodeURIComponent(budgetId)}`, void 0, config2)
6761
+ }),
6762
+ // ── Entornos efímeros (leases) ─────────────────────────────
6763
+ defineTool({
6764
+ name: "list_leases",
6765
+ description: `List the organization's leases: ephemeral environments with an expiry date, declared through the API or found by the aaa-sentinel:expires-at tag (aaa-sentinel_expires-at on GCP) in the daily scan, which can see a new tag up to a day late. Each lease has its selector (a tag or resource ids), account, environment ("env"), expiry ("expiresAt", UTC), what happens on expiry ("onExpiry": stop or delete), state (active, expiring_notified when the 24-hour warning was sent, expired, closed), how many times it was extended, an "issue" when the agent cannot act on the whole lease (too_broad, tag_unreadable, discovered_expired) and a "summary": resources matched, estimated cost in USD (usdMonthly, estimatedUsd) and in the organization currency (monthlyCost, estimatedCost, currency; approximate), and how many agent actions were proposed or approved by a playbook. Use it to answer "what expires today" or "which preview environments are still alive". Requires the leases:read scope.`,
6766
+ inputSchema: objectWith({
6767
+ env: { type: "string", pattern: LEASE_ENV_PATTERN, description: 'Only the leases of this environment, e.g. "pr-412" (optional).' }
6768
+ }),
6769
+ argsSchema: object({ env: string2().regex(LEASE_ENV_RE).optional() }),
6770
+ handler: async ({ env }, config2) => apiGet("/v1/leases", { env }, config2)
6771
+ }),
6772
+ defineTool({
6773
+ name: "get_lease",
6774
+ description: 'Get one lease by id with the resources its selector matched in the last inventory: provider, type, region, estimated monthly list cost in USD, whether the resource carries the consent tag (required to stop or terminate instances, stop databases and delete AWS disks), and, after expiry on Business, the agent action proposed for it or why none was ("issue": consent_missing, no_executor, not_found). Requires the leases:read scope.',
6775
+ inputSchema: {
6776
+ type: "object",
6777
+ properties: { leaseId: { type: "string", description: "Lease identifier (lse_\u2026), as returned by list_leases." } },
6778
+ required: ["leaseId"]
6779
+ },
6780
+ argsSchema: object({ leaseId: string2().min(1) }),
6781
+ handler: async ({ leaseId }, config2) => apiGet(`/v1/leases/${encodeURIComponent(leaseId)}`, void 0, config2)
6782
+ }),
6783
+ defineTool({
6784
+ name: "list_environments",
6785
+ description: 'List the environments, grouped by the "env" of their leases or the aaa-sentinel:env tag, with their resources, open leases, nearest expiry and estimated cost in the organization currency: the monthly list price of each resource and what it has cost so far over the days it has been alive. The cost is an estimate from list prices, not the bill, and "approximate" is always true. Use it to answer "how much are our preview environments costing". Requires the leases:read scope.',
6786
+ inputSchema: { type: "object", properties: {} },
6787
+ argsSchema: object({}),
6788
+ handler: async (_args, config2) => apiGet("/v1/environments", void 0, config2)
6789
+ }),
6790
+ defineTool({
6791
+ name: "get_environment_cost",
6792
+ description: 'Get the estimated cost of one environment resource by resource: monthly list cost and cost so far over its days alive, in the organization currency ("approximate" is true), plus the lease and expiry that covers each resource. A resource without a known price has a null cost and does not add to the total. Requires the leases:read scope.',
6793
+ inputSchema: {
6794
+ type: "object",
6795
+ properties: { env: { type: "string", pattern: LEASE_ENV_PATTERN, description: "Environment name, as returned by list_environments." } },
6796
+ required: ["env"]
6797
+ },
6798
+ argsSchema: object({ env: string2().regex(LEASE_ENV_RE) }),
6799
+ handler: async ({ env }, config2) => apiGet(`/v1/environments/${encodeURIComponent(env)}/cost`, void 0, config2)
6759
6800
  })
6760
6801
  ];
6761
6802
  function withoutPrivateLink(page) {
@@ -6769,7 +6810,7 @@ function findTool(name) {
6769
6810
 
6770
6811
  // src/protocol.ts
6771
6812
  var SERVER_NAME = "aaa-sentinel-mcp";
6772
- var SERVER_VERSION = "0.12.0";
6813
+ var SERVER_VERSION = "0.13.0";
6773
6814
  var SUPPORTED_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
6774
6815
  var PARSE_ERROR = -32700;
6775
6816
  var INVALID_REQUEST = -32600;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaa-sentinel/mcp-server",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Read-only MCP server for AAA Sentinel: query cloud costs, savings, security posture, AI spend, uptime monitoring, the remediation agent and managed clients from an AI assistant",
5
5
  "license": "MIT",
6
6
  "type": "module",