@integrity-labs/cloud-broker 0.4.6 → 0.5.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 (2) hide show
  1. package/dist/index.js +74 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21132,6 +21132,16 @@ var BrokerClient = class {
21132
21132
  `/aws/grants/${encodeURIComponent(args.grant_id)}/release`
21133
21133
  );
21134
21134
  }
21135
+ // ENG-4779: fetch the AWS_* credentials persisted on the grant. Pre-4779
21136
+ // there was no path back to credentials for a route_to_approver grant —
21137
+ // they were minted inside mintAndActivateGrant and never returned. Now
21138
+ // they're encrypted on the row and decrypted here.
21139
+ getCredentials(args) {
21140
+ return this.request(
21141
+ "POST",
21142
+ `/aws/grants/${encodeURIComponent(args.grant_id)}/credentials`
21143
+ );
21144
+ }
21135
21145
  };
21136
21146
 
21137
21147
  // src/tool-schemas.ts
@@ -21191,11 +21201,59 @@ var pollGrantSchema = external_exports.object({
21191
21201
  var releaseAccessSchema = external_exports.object({
21192
21202
  grant_id: external_exports.string().uuid("grant_id must be a UUID")
21193
21203
  });
21204
+ var getCredentialsSchema = external_exports.object({
21205
+ grant_id: external_exports.string().uuid("grant_id must be a UUID")
21206
+ });
21194
21207
  var describeScopeShape = describeScopeSchema.shape;
21195
21208
  var previewRequestShape = previewRequestSchema.shape;
21196
21209
  var requestAccessShape = requestAccessSchema.shape;
21197
21210
  var pollGrantShape = pollGrantSchema.shape;
21198
21211
  var releaseAccessShape = releaseAccessSchema.shape;
21212
+ var getCredentialsShape = getCredentialsSchema.shape;
21213
+
21214
+ // package.json
21215
+ var package_default = {
21216
+ name: "@integrity-labs/cloud-broker",
21217
+ version: "0.5.0",
21218
+ description: "Cloud Access Broker \u2014 MCP server that mints scoped, TTL-bounded cloud credentials per agent task. v1 ships AWS support (request_access, poll_grant, release_access, describe_scope, preview_request \u2014 STS AssumeRole under the hood); GCP, Azure, and Cloudflare land alongside in the same package as the broker grows.",
21219
+ type: "module",
21220
+ bin: {
21221
+ "cloud-broker": "./dist/index.js"
21222
+ },
21223
+ main: "dist/index.js",
21224
+ files: [
21225
+ "dist",
21226
+ "README.md"
21227
+ ],
21228
+ repository: {
21229
+ type: "git",
21230
+ url: "https://github.com/Integrity-Labs/augmented.git",
21231
+ directory: "packages/cloud-broker"
21232
+ },
21233
+ publishConfig: {
21234
+ registry: "https://registry.npmjs.org",
21235
+ access: "public"
21236
+ },
21237
+ scripts: {
21238
+ build: "tsup",
21239
+ dev: "tsx watch src/index.ts",
21240
+ typecheck: "tsc --noEmit",
21241
+ test: "vitest run",
21242
+ clean: "rm -rf dist",
21243
+ "publish:templates": "bash cloudformation/publish.sh"
21244
+ },
21245
+ dependencies: {
21246
+ "@modelcontextprotocol/sdk": "^1.27.1",
21247
+ zod: "^3.25.0"
21248
+ },
21249
+ devDependencies: {
21250
+ "@types/node": "^22.0.0",
21251
+ tsup: "^8.0.0",
21252
+ tsx: "^4.19.0",
21253
+ typescript: "^5.7.0",
21254
+ vitest: "^3.0.0"
21255
+ }
21256
+ };
21199
21257
 
21200
21258
  // src/index.ts
21201
21259
  var AGT_HOST = process.env.AGT_HOST;
@@ -21203,9 +21261,9 @@ var AGT_AGENT_ID = process.env.AGT_AGENT_ID;
21203
21261
  var AGT_RUN_ID = process.env.AGT_RUN_ID ?? "";
21204
21262
  var AGT_TOKEN = process.env.AGT_TOKEN ?? "";
21205
21263
  var AGT_API_KEY = process.env.AGT_API_KEY ?? "";
21206
- if (!AGT_HOST || !AGT_AGENT_ID || !AGT_TOKEN && !AGT_API_KEY) {
21264
+ if (!AGT_HOST || !AGT_AGENT_ID || !AGT_RUN_ID || !AGT_TOKEN && !AGT_API_KEY) {
21207
21265
  console.error(
21208
- "cloud-broker: missing env vars. Need AGT_HOST, AGT_AGENT_ID, and one of AGT_TOKEN or AGT_API_KEY."
21266
+ "cloud-broker: missing env vars. Need AGT_HOST, AGT_AGENT_ID, AGT_RUN_ID, and one of AGT_TOKEN or AGT_API_KEY."
21209
21267
  );
21210
21268
  process.exit(1);
21211
21269
  }
@@ -21233,7 +21291,7 @@ function formatBrokerError(err) {
21233
21291
  }
21234
21292
  var server = new McpServer({
21235
21293
  name: "cloud-broker",
21236
- version: "0.1.0"
21294
+ version: package_default.version
21237
21295
  });
21238
21296
  server.tool(
21239
21297
  "describe_scope",
@@ -21301,6 +21359,19 @@ server.tool(
21301
21359
  }
21302
21360
  }
21303
21361
  );
21362
+ server.tool(
21363
+ "get_credentials",
21364
+ "Fetch the AWS credentials for an active grant. Call this AFTER request_access returns active (auto-approve) OR after the resolution-notification arrives (route_to_approver). Returns { grant_id, expires_at, credentials: { access_key_id, secret_access_key, session_token } }. Use them by prefixing your bash invocation, e.g. `AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_SESSION_TOKEN=... aws ec2 describe-instances`. The grant must still be active and unexpired \u2014 409 if already released, 410 if past expires_at. Safe to call multiple times within the TTL window; the credentials don't change. Call release_access when done.",
21365
+ getCredentialsShape,
21366
+ async (args) => {
21367
+ try {
21368
+ const result = await broker.getCredentials(args);
21369
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
21370
+ } catch (err) {
21371
+ return { content: [{ type: "text", text: formatBrokerError(err) }], isError: true };
21372
+ }
21373
+ }
21374
+ );
21304
21375
  var transport = new StdioServerTransport();
21305
21376
  await server.connect(transport);
21306
21377
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/cloud-broker",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "description": "Cloud Access Broker — MCP server that mints scoped, TTL-bounded cloud credentials per agent task. v1 ships AWS support (request_access, poll_grant, release_access, describe_scope, preview_request — STS AssumeRole under the hood); GCP, Azure, and Cloudflare land alongside in the same package as the broker grows.",
5
5
  "type": "module",
6
6
  "bin": {