@astramindapp/mcp-server 0.28.0 → 0.29.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/integration-guide.d.ts +2 -2
- package/dist/integration-guide.d.ts.map +1 -1
- package/dist/integration-guide.js +536 -25
- package/dist/integration-guide.js.map +1 -1
- package/dist/mind-client.d.ts +48 -0
- package/dist/mind-client.d.ts.map +1 -1
- package/dist/mind-client.js +17 -0
- package/dist/mind-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +74 -7
- package/dist/server.js.map +1 -1
- package/package.json +5 -3
package/dist/server.js
CHANGED
|
@@ -86,7 +86,7 @@ const apiDetail = (e) => {
|
|
|
86
86
|
function createMindMcpServer(client) {
|
|
87
87
|
const server = new mcp_js_1.McpServer({
|
|
88
88
|
name: "mind",
|
|
89
|
-
version: "0.
|
|
89
|
+
version: "0.29.1",
|
|
90
90
|
}, {
|
|
91
91
|
// Returned to every client in the MCP `initialize` response — the first
|
|
92
92
|
// thing any connecting agent sees about how to integrate with MIND.
|
|
@@ -3144,10 +3144,24 @@ function createMindMcpServer(client) {
|
|
|
3144
3144
|
"3) IDLE — MIND marks the session idle after 30 minutes with no append; the next append revives it, nothing to do meanwhile. " +
|
|
3145
3145
|
"4) TERMINATE — on exit, compaction, or \"done\", call action=close with a summary (what was asked, what shipped with ids/PR numbers, what is still undone); MIND mirrors the transcript into your Sessions folder as a document. " +
|
|
3146
3146
|
"5) HANDOFF — to pass the conversation to another agent, call action=handoff with to_source_key=<their toggle>; they see it in their session list with the transcript as context. " +
|
|
3147
|
+
"6) SHARE — to let another MIND user follow this session, call action=share with grantee_username and role (\"viewer\" read-only, the default, or \"replier\" which also lets them reply — a reply is a live action that wakes your process via wake_url, so grant it deliberately). It's a live mirror, never a copy: they always see the current transcript, and revoking (action=revoke_share) removes their access immediately. Never share a session with anyone who shouldn't see its full transcript.\n" +
|
|
3147
3148
|
"Never claim a session is synced without the session_id MIND returned. Never log secrets or raw tool payloads.\n\n" +
|
|
3148
|
-
"Actions: open, append, close, list, get, reply (alias for append of one assistant message), inbox (undelivered mind-origin replies), handoff, sources (source_action=list|create|update|delete manages the MIND Chat sidebar toggles — auto-created on first open with an unknown source_key).", {
|
|
3149
|
+
"Actions: open, append, close, list, get, reply (alias for append of one assistant message), inbox (undelivered mind-origin replies), handoff, sources (source_action=list|create|update|delete manages the MIND Chat sidebar toggles — auto-created on first open with an unknown source_key), share (grant another MIND account viewer or replier access — owner only), list_shares (owner only), revoke_share (owner only).", {
|
|
3149
3150
|
action: zod_1.z
|
|
3150
|
-
.enum([
|
|
3151
|
+
.enum([
|
|
3152
|
+
"open",
|
|
3153
|
+
"append",
|
|
3154
|
+
"close",
|
|
3155
|
+
"list",
|
|
3156
|
+
"get",
|
|
3157
|
+
"reply",
|
|
3158
|
+
"inbox",
|
|
3159
|
+
"handoff",
|
|
3160
|
+
"sources",
|
|
3161
|
+
"share",
|
|
3162
|
+
"list_shares",
|
|
3163
|
+
"revoke_share",
|
|
3164
|
+
])
|
|
3151
3165
|
.describe("Which agent-session operation to perform."),
|
|
3152
3166
|
// open
|
|
3153
3167
|
source_key: zod_1.z.string().optional().describe("Your assigned MIND Chat sidebar toggle slug, e.g. \"claude-code-1\" — required for open; also filters list; also required for sources action=create (as the new source's key)."),
|
|
@@ -3192,6 +3206,10 @@ function createMindMcpServer(client) {
|
|
|
3192
3206
|
color: zod_1.z.string().optional().describe("Sidebar chip color — sources action=create/update."),
|
|
3193
3207
|
wake_url: zod_1.z.string().optional().describe("Optional push endpoint MIND POSTs {session_id, reply} to (fire-and-forget, 5s timeout) when the user replies — sources action=create/update."),
|
|
3194
3208
|
force: zod_1.z.boolean().optional().describe("sources action=delete: also delete the source's sessions instead of failing 409 when sessions exist."),
|
|
3209
|
+
// share / list_shares / revoke_share
|
|
3210
|
+
grantee_username: zod_1.z.string().optional().describe("MIND username to share with — required for share."),
|
|
3211
|
+
role: zod_1.z.enum(["viewer", "replier"]).optional().describe("Role to grant — share (default \"viewer\"). \"replier\" additionally allows the grantee to reply, which reaches you via wake_url."),
|
|
3212
|
+
share_id: zod_1.z.string().optional().describe("Share grant id (from share or list_shares) — required for revoke_share."),
|
|
3195
3213
|
}, async (args) => {
|
|
3196
3214
|
const { action } = args;
|
|
3197
3215
|
try {
|
|
@@ -3317,6 +3335,32 @@ function createMindMcpServer(client) {
|
|
|
3317
3335
|
}
|
|
3318
3336
|
}
|
|
3319
3337
|
}
|
|
3338
|
+
case "share": {
|
|
3339
|
+
const { session_id, grantee_username } = args;
|
|
3340
|
+
if (!session_id)
|
|
3341
|
+
return err("Error: 'session_id' is required for share.");
|
|
3342
|
+
if (!grantee_username)
|
|
3343
|
+
return err("Error: 'grantee_username' is required for share.");
|
|
3344
|
+
return ok(await client.createAgentSessionShare(session_id, {
|
|
3345
|
+
grantee_username,
|
|
3346
|
+
role: args.role,
|
|
3347
|
+
}));
|
|
3348
|
+
}
|
|
3349
|
+
case "list_shares": {
|
|
3350
|
+
const { session_id } = args;
|
|
3351
|
+
if (!session_id)
|
|
3352
|
+
return err("Error: 'session_id' is required for list_shares.");
|
|
3353
|
+
return ok(await client.listAgentSessionShares(session_id));
|
|
3354
|
+
}
|
|
3355
|
+
case "revoke_share": {
|
|
3356
|
+
const { session_id, share_id } = args;
|
|
3357
|
+
if (!session_id)
|
|
3358
|
+
return err("Error: 'session_id' is required for revoke_share.");
|
|
3359
|
+
if (!share_id)
|
|
3360
|
+
return err("Error: 'share_id' is required for revoke_share.");
|
|
3361
|
+
await client.revokeAgentSessionShare(session_id, share_id);
|
|
3362
|
+
return ok({ ok: true, session_id, share_id });
|
|
3363
|
+
}
|
|
3320
3364
|
default: {
|
|
3321
3365
|
const _exhaustive = action;
|
|
3322
3366
|
return err(`Unknown action: ${_exhaustive}`);
|
|
@@ -4259,10 +4303,10 @@ function createMindMcpServer(client) {
|
|
|
4259
4303
|
// Multi-MIND accounts: discover the MINDs this key's owner can access,
|
|
4260
4304
|
// create new ones, and manage owners / viewers. Requires the server to
|
|
4261
4305
|
// have MULTI_MIND_ACCOUNTS_ENABLED set.
|
|
4262
|
-
server.tool("mind_accounts", "Manage multi-MIND accounts. A 'MIND' is a knowledge-graph account; one person can own or be granted access to many. Use to discover every MIND you can access (list), spin up a new one (create), permanently delete one (delete), see who can access a MIND (members), grant an existing user access (grant),
|
|
4306
|
+
server.tool("mind_accounts", "Manage multi-MIND accounts. A 'MIND' is a knowledge-graph account; one person can own or be granted access to many. Use to discover every MIND you can access (list), spin up a new one (create), permanently delete one (delete), see who can access a MIND (members), grant an existing user access (grant), email an invitation (invite), or switch into a granted MIND (switch — POST /developer/v1/accounts/switch; returns access_token JWT). Protocol: AstraAI=HQ, MIND=product, anthonyjconti=personal.", {
|
|
4263
4307
|
action: zod_1.z
|
|
4264
|
-
.enum(["list", "create", "delete", "members", "grant", "invite"])
|
|
4265
|
-
.describe("list (every MIND you can access), create (a new MIND you own), delete (permanently delete a MIND you own), members (owners/viewers of a MIND), grant (give an existing user access), invite (email an invitation)"),
|
|
4308
|
+
.enum(["list", "create", "delete", "members", "grant", "invite", "switch"])
|
|
4309
|
+
.describe("list (every MIND you can access), create (a new MIND you own), delete (permanently delete a MIND you own), members (owners/viewers of a MIND), grant (give an existing user access), invite (email an invitation), switch (activate/enter a granted MIND — requires mind_username; returns access_token)"),
|
|
4266
4310
|
label: zod_1.z
|
|
4267
4311
|
.string()
|
|
4268
4312
|
.optional()
|
|
@@ -4270,7 +4314,7 @@ function createMindMcpServer(client) {
|
|
|
4270
4314
|
mind_username: zod_1.z
|
|
4271
4315
|
.string()
|
|
4272
4316
|
.optional()
|
|
4273
|
-
.describe("Username of the MIND to manage (required for delete/members/grant/invite)"),
|
|
4317
|
+
.describe("Username of the MIND to manage (required for delete/members/grant/invite/switch)"),
|
|
4274
4318
|
grantee_username: zod_1.z
|
|
4275
4319
|
.string()
|
|
4276
4320
|
.optional()
|
|
@@ -4411,6 +4455,29 @@ function createMindMcpServer(client) {
|
|
|
4411
4455
|
],
|
|
4412
4456
|
};
|
|
4413
4457
|
}
|
|
4458
|
+
case "switch": {
|
|
4459
|
+
if (!mind_username) {
|
|
4460
|
+
return {
|
|
4461
|
+
content: [{ type: "text", text: "Error: mind_username is required for switch" }],
|
|
4462
|
+
isError: true,
|
|
4463
|
+
};
|
|
4464
|
+
}
|
|
4465
|
+
const res = await client.switchMind(mind_username);
|
|
4466
|
+
return {
|
|
4467
|
+
content: [
|
|
4468
|
+
{
|
|
4469
|
+
type: "text",
|
|
4470
|
+
text: JSON.stringify({
|
|
4471
|
+
switched: true,
|
|
4472
|
+
account: res.account,
|
|
4473
|
+
access_token: res.access_token,
|
|
4474
|
+
token_type: res.token_type,
|
|
4475
|
+
note: "Bearer access_token operates as this MIND for session JWT paths. Hosted API-key MCP remains the key owner unless the host applies the token.",
|
|
4476
|
+
}, null, 2),
|
|
4477
|
+
},
|
|
4478
|
+
],
|
|
4479
|
+
};
|
|
4480
|
+
}
|
|
4414
4481
|
}
|
|
4415
4482
|
}
|
|
4416
4483
|
catch (err) {
|