@integrity-labs/cloud-broker 0.4.6 → 0.5.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.
- package/dist/index.js +77 -1
- 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.1",
|
|
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;
|
|
@@ -21209,6 +21267,11 @@ if (!AGT_HOST || !AGT_AGENT_ID || !AGT_TOKEN && !AGT_API_KEY) {
|
|
|
21209
21267
|
);
|
|
21210
21268
|
process.exit(1);
|
|
21211
21269
|
}
|
|
21270
|
+
if (!AGT_RUN_ID) {
|
|
21271
|
+
console.error(
|
|
21272
|
+
"cloud-broker: AGT_RUN_ID is not set. request_access will require run_id in the args; describe_scope / get_credentials / release_access still work without it."
|
|
21273
|
+
);
|
|
21274
|
+
}
|
|
21212
21275
|
if (process.env.AGT_TEAM_SLUG) {
|
|
21213
21276
|
console.error(
|
|
21214
21277
|
"cloud-broker: AGT_TEAM_SLUG is set but no longer required (the API derives team from agent_id). Safe to remove from .mcp.json env block."
|
|
@@ -21233,7 +21296,7 @@ function formatBrokerError(err) {
|
|
|
21233
21296
|
}
|
|
21234
21297
|
var server = new McpServer({
|
|
21235
21298
|
name: "cloud-broker",
|
|
21236
|
-
version:
|
|
21299
|
+
version: package_default.version
|
|
21237
21300
|
});
|
|
21238
21301
|
server.tool(
|
|
21239
21302
|
"describe_scope",
|
|
@@ -21301,6 +21364,19 @@ server.tool(
|
|
|
21301
21364
|
}
|
|
21302
21365
|
}
|
|
21303
21366
|
);
|
|
21367
|
+
server.tool(
|
|
21368
|
+
"get_credentials",
|
|
21369
|
+
"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.",
|
|
21370
|
+
getCredentialsShape,
|
|
21371
|
+
async (args) => {
|
|
21372
|
+
try {
|
|
21373
|
+
const result = await broker.getCredentials(args);
|
|
21374
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
21375
|
+
} catch (err) {
|
|
21376
|
+
return { content: [{ type: "text", text: formatBrokerError(err) }], isError: true };
|
|
21377
|
+
}
|
|
21378
|
+
}
|
|
21379
|
+
);
|
|
21304
21380
|
var transport = new StdioServerTransport();
|
|
21305
21381
|
await server.connect(transport);
|
|
21306
21382
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@integrity-labs/cloud-broker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
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": {
|