@aaa-sentinel/mcp-server 0.12.0 → 0.14.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 +7 -1
  2. package/dist/cli.js +67 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -96,7 +96,7 @@ status as plain JSON.
96
96
  | `list_findings` | `scanId`, `includeSuppressed?` | `findings:read` | Pro |
97
97
  | `get_reports_summary` | `accountId?` | `reports:read` | Pro |
98
98
  | `list_savings` | `accountId?`, `type?` | `savings:read` | Pro |
99
- | `get_chargeback` | `clientId?` | `reports:read` | Business |
99
+ | `get_chargeback` | `clientId?`, `view?`, `period?` | `reports:read` | Business |
100
100
  | `get_dashboard` | `accountId?` | `dashboard:read` | Pro |
101
101
  | `get_cost_forecast` | `accountId` | `reports:read` | Pro |
102
102
  | `list_cost_anomalies` | `accountId?` | `reports:read` | Business |
@@ -152,6 +152,12 @@ 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 |
159
+ | `list_owner_sources` | — | `owners:read` | Business |
160
+ | `get_team_costs` | — | `owners:read` | Business |
155
161
 
156
162
  In `list_savings`, `type` is one of `compute`, `storage`, `network`, `database`, `serverless`,
157
163
  `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." };
@@ -6184,15 +6186,21 @@ var TOOLS = [
6184
6186
  }),
6185
6187
  defineTool({
6186
6188
  name: "get_chargeback",
6187
- description: "Break down cost and savings by tag, account and service \u2014 the report an MSP uses to justify its invoice. Requires the reports:read scope and the Business plan.",
6189
+ description: 'Break down cost and savings by tag, account and service \u2014 the report an MSP uses to justify its invoice. With view "team" it splits the billed cost of a closed month (FOCUS, AWS and Azure) by owning team instead: each team with its cost by origin (real team tag, manual rule, repository source), the unassigned part and the total they add up to, in the organization currency ("approximate" is true), why an account is left out (no_focus, gcp, team_not_allocated, no_conversion) and "partial" when its FOCUS report for that month is incomplete; the team "__overflow__" groups the smallest teams. Requires the reports:read scope and the Business plan.',
6188
6190
  inputSchema: {
6189
6191
  type: "object",
6190
6192
  properties: {
6191
- clientId: { type: "string", description: "Restrict the breakdown to one managed client (optional)." }
6193
+ clientId: { type: "string", description: "Restrict the breakdown to one managed client (optional)." },
6194
+ view: { type: "string", enum: ["team"], description: "Split by owning team from the closed-month bill (optional)." },
6195
+ period: { ...BILLING_PERIOD, description: 'Closed month as YYYY-MM for view "team" (optional; default the last closed month).' }
6192
6196
  }
6193
6197
  },
6194
- argsSchema: object({ clientId: string2().min(1).optional() }),
6195
- handler: async ({ clientId: clientId2 }, config2) => apiGet("/v1/reports/chargeback", { clientId: clientId2 }, config2)
6198
+ argsSchema: object({
6199
+ clientId: string2().min(1).optional(),
6200
+ view: _enum(["team"]).optional(),
6201
+ period: BillingPeriod.optional()
6202
+ }),
6203
+ handler: async ({ clientId: clientId2, view, period }, config2) => apiGet("/v1/reports/chargeback", { clientId: clientId2, view, period }, config2)
6196
6204
  }),
6197
6205
  defineTool({
6198
6206
  name: "get_dashboard",
@@ -6756,6 +6764,60 @@ var TOOLS = [
6756
6764
  },
6757
6765
  argsSchema: object({ budgetId: string2().min(1) }),
6758
6766
  handler: async ({ budgetId }, config2) => apiGet(`/v1/budgets/${encodeURIComponent(budgetId)}`, void 0, config2)
6767
+ }),
6768
+ // ── Entornos efímeros (leases) ─────────────────────────────
6769
+ defineTool({
6770
+ name: "list_leases",
6771
+ 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.`,
6772
+ inputSchema: objectWith({
6773
+ env: { type: "string", pattern: LEASE_ENV_PATTERN, description: 'Only the leases of this environment, e.g. "pr-412" (optional).' }
6774
+ }),
6775
+ argsSchema: object({ env: string2().regex(LEASE_ENV_RE).optional() }),
6776
+ handler: async ({ env }, config2) => apiGet("/v1/leases", { env }, config2)
6777
+ }),
6778
+ defineTool({
6779
+ name: "get_lease",
6780
+ 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.',
6781
+ inputSchema: {
6782
+ type: "object",
6783
+ properties: { leaseId: { type: "string", description: "Lease identifier (lse_\u2026), as returned by list_leases." } },
6784
+ required: ["leaseId"]
6785
+ },
6786
+ argsSchema: object({ leaseId: string2().min(1) }),
6787
+ handler: async ({ leaseId }, config2) => apiGet(`/v1/leases/${encodeURIComponent(leaseId)}`, void 0, config2)
6788
+ }),
6789
+ defineTool({
6790
+ name: "list_environments",
6791
+ 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.',
6792
+ inputSchema: { type: "object", properties: {} },
6793
+ argsSchema: object({}),
6794
+ handler: async (_args, config2) => apiGet("/v1/environments", void 0, config2)
6795
+ }),
6796
+ defineTool({
6797
+ name: "get_environment_cost",
6798
+ 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.',
6799
+ inputSchema: {
6800
+ type: "object",
6801
+ properties: { env: { type: "string", pattern: LEASE_ENV_PATTERN, description: "Environment name, as returned by list_environments." } },
6802
+ required: ["env"]
6803
+ },
6804
+ argsSchema: object({ env: string2().regex(LEASE_ENV_RE) }),
6805
+ handler: async ({ env }, config2) => apiGet(`/v1/environments/${encodeURIComponent(env)}/cost`, void 0, config2)
6806
+ }),
6807
+ // ── Propietarios desde el código ───────────────────────────
6808
+ defineTool({
6809
+ name: "list_owner_sources",
6810
+ description: 'List where team ownership comes from: the repository sources synced by `iac-cost owners sync` (kind backstage or codeowners_tf, repository, path, branch, commit, last sync, number of tag rules and resources), the conflicts between sources (the same resource id or tag value claimed by two teams; the oldest source wins), how many manual team rules the console has, and the coverage of the last closed month from the FOCUS bill: cost assigned by the real team tag, by a manual rule, by a repository source, and unassigned, in the organization currency ("approximate" is true). Use it to answer "who owns this cost" or "how much of our bill has no team". Requires the owners:read scope and the Business plan.',
6811
+ inputSchema: { type: "object", properties: {} },
6812
+ argsSchema: object({}),
6813
+ handler: async (_args, config2) => apiGet("/v1/owners", void 0, config2)
6814
+ }),
6815
+ defineTool({
6816
+ name: "get_team_costs",
6817
+ description: 'Get the estimated cost of the current month per owning team: the monthly list price of each resource in the last daily inventory, assigned to its effective team (real team tag, manual rule or repository source), with resources and accounts per team, the unassigned part and the accounts without an inventory yet. It is an estimate from list prices in the organization currency ("approximate" is true), not the bill; for the billed split of a closed month use get_chargeback. Requires the owners:read scope and the Business plan.',
6818
+ inputSchema: { type: "object", properties: {} },
6819
+ argsSchema: object({}),
6820
+ handler: async (_args, config2) => apiGet("/v1/owners/teams", void 0, config2)
6759
6821
  })
6760
6822
  ];
6761
6823
  function withoutPrivateLink(page) {
@@ -6769,7 +6831,7 @@ function findTool(name) {
6769
6831
 
6770
6832
  // src/protocol.ts
6771
6833
  var SERVER_NAME = "aaa-sentinel-mcp";
6772
- var SERVER_VERSION = "0.12.0";
6834
+ var SERVER_VERSION = "0.14.0";
6773
6835
  var SUPPORTED_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
6774
6836
  var PARSE_ERROR = -32700;
6775
6837
  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.14.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",