@actwith-ai/mcp-server 0.1.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 (63) hide show
  1. package/ACTWITH.md +152 -0
  2. package/README.md +290 -0
  3. package/dist/client.d.ts +866 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +959 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/index.d.ts +20 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +247 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/init.d.ts +10 -0
  12. package/dist/init.d.ts.map +1 -0
  13. package/dist/init.js +222 -0
  14. package/dist/init.js.map +1 -0
  15. package/dist/resources/index.d.ts +35 -0
  16. package/dist/resources/index.d.ts.map +1 -0
  17. package/dist/resources/index.js +292 -0
  18. package/dist/resources/index.js.map +1 -0
  19. package/dist/tools/artifacts.d.ts +12 -0
  20. package/dist/tools/artifacts.d.ts.map +1 -0
  21. package/dist/tools/artifacts.js +462 -0
  22. package/dist/tools/artifacts.js.map +1 -0
  23. package/dist/tools/contexts.d.ts +15 -0
  24. package/dist/tools/contexts.d.ts.map +1 -0
  25. package/dist/tools/contexts.js +188 -0
  26. package/dist/tools/contexts.js.map +1 -0
  27. package/dist/tools/discovery.d.ts +11 -0
  28. package/dist/tools/discovery.d.ts.map +1 -0
  29. package/dist/tools/discovery.js +249 -0
  30. package/dist/tools/discovery.js.map +1 -0
  31. package/dist/tools/identity.d.ts +15 -0
  32. package/dist/tools/identity.d.ts.map +1 -0
  33. package/dist/tools/identity.js +237 -0
  34. package/dist/tools/identity.js.map +1 -0
  35. package/dist/tools/index.d.ts +29 -0
  36. package/dist/tools/index.d.ts.map +1 -0
  37. package/dist/tools/index.js +228 -0
  38. package/dist/tools/index.js.map +1 -0
  39. package/dist/tools/memory.d.ts +11 -0
  40. package/dist/tools/memory.d.ts.map +1 -0
  41. package/dist/tools/memory.js +349 -0
  42. package/dist/tools/memory.js.map +1 -0
  43. package/dist/tools/patterns.d.ts +17 -0
  44. package/dist/tools/patterns.d.ts.map +1 -0
  45. package/dist/tools/patterns.js +874 -0
  46. package/dist/tools/patterns.js.map +1 -0
  47. package/dist/tools/reputation.d.ts +11 -0
  48. package/dist/tools/reputation.d.ts.map +1 -0
  49. package/dist/tools/reputation.js +175 -0
  50. package/dist/tools/reputation.js.map +1 -0
  51. package/dist/tools/tasks.d.ts +11 -0
  52. package/dist/tools/tasks.d.ts.map +1 -0
  53. package/dist/tools/tasks.js +549 -0
  54. package/dist/tools/tasks.js.map +1 -0
  55. package/dist/tools/topics.d.ts +13 -0
  56. package/dist/tools/topics.d.ts.map +1 -0
  57. package/dist/tools/topics.js +561 -0
  58. package/dist/tools/topics.js.map +1 -0
  59. package/dist/tools/workspace.d.ts +10 -0
  60. package/dist/tools/workspace.d.ts.map +1 -0
  61. package/dist/tools/workspace.js +183 -0
  62. package/dist/tools/workspace.js.map +1 -0
  63. package/package.json +59 -0
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Workspace Tools for MCP Server
3
+ *
4
+ * Tools for workspace/space management including invites.
5
+ */
6
+ export const workspaceTools = [
7
+ {
8
+ name: "current_space",
9
+ description: "Show which space is currently active. " +
10
+ "All memory, tasks, and messages are scoped to this space.",
11
+ inputSchema: {
12
+ type: "object",
13
+ properties: {},
14
+ },
15
+ },
16
+ {
17
+ name: "switch_space",
18
+ description: "Switch to a different space. " +
19
+ "All subsequent operations will use the new space.",
20
+ inputSchema: {
21
+ type: "object",
22
+ properties: {
23
+ space_id: {
24
+ type: "string",
25
+ description: "The ID of the space to switch to (use my_spaces to see available spaces)",
26
+ },
27
+ },
28
+ required: ["space_id"],
29
+ },
30
+ },
31
+ {
32
+ name: "create_invite",
33
+ description: "Create a shareable invite link for your workspace. " +
34
+ "Share the link with coworkers so they can join.",
35
+ inputSchema: {
36
+ type: "object",
37
+ properties: {
38
+ expires_in_days: {
39
+ type: "number",
40
+ description: "Days until link expires (default: 7, use 0 for never)",
41
+ },
42
+ max_uses: {
43
+ type: "number",
44
+ description: "Maximum number of uses (default: unlimited)",
45
+ },
46
+ },
47
+ },
48
+ },
49
+ {
50
+ name: "list_invites",
51
+ description: "List active invite links for your workspace.",
52
+ inputSchema: {
53
+ type: "object",
54
+ properties: {},
55
+ },
56
+ },
57
+ {
58
+ name: "revoke_invite",
59
+ description: "Revoke an invite link so it can no longer be used.",
60
+ inputSchema: {
61
+ type: "object",
62
+ properties: {
63
+ code: {
64
+ type: "string",
65
+ description: "The invite code to revoke",
66
+ },
67
+ },
68
+ required: ["code"],
69
+ },
70
+ },
71
+ ];
72
+ export async function handleWorkspaceTool(client, name, args) {
73
+ switch (name) {
74
+ case "current_space": {
75
+ const currentId = client.getContextId();
76
+ const spaces = await client.getSpaces();
77
+ const current = spaces.find((s) => s.id === currentId);
78
+ if (!current) {
79
+ return {
80
+ success: true,
81
+ spaceId: currentId,
82
+ note: "Space details not found - may have been deleted or access revoked",
83
+ };
84
+ }
85
+ return {
86
+ success: true,
87
+ space: {
88
+ id: current.id,
89
+ name: current.name,
90
+ description: current.description,
91
+ visibility: current.visibility,
92
+ role: current.role,
93
+ isPersonal: current.settings?.isPersonal || false,
94
+ stats: current.stats,
95
+ },
96
+ };
97
+ }
98
+ case "switch_space": {
99
+ const spaceId = args.space_id;
100
+ if (!spaceId) {
101
+ throw new Error("space_id is required");
102
+ }
103
+ // Verify the space exists and user has access
104
+ const spaces = await client.getSpaces();
105
+ const targetSpace = spaces.find((s) => s.id === spaceId);
106
+ if (!targetSpace) {
107
+ throw new Error(`Space not found or you don't have access. Use my_spaces to see available spaces.`);
108
+ }
109
+ // Switch context
110
+ client.setContextId(spaceId);
111
+ // Re-register agent in new space
112
+ await client.reregisterAgent();
113
+ return {
114
+ success: true,
115
+ message: `Switched to space: ${targetSpace.name}`,
116
+ space: {
117
+ id: targetSpace.id,
118
+ name: targetSpace.name,
119
+ description: targetSpace.description,
120
+ isPersonal: targetSpace.settings?.isPersonal || false,
121
+ },
122
+ };
123
+ }
124
+ case "create_invite": {
125
+ const { expires_in_days, max_uses } = args;
126
+ const invite = await client.createInvite({
127
+ expiresInDays: expires_in_days,
128
+ maxUses: max_uses,
129
+ });
130
+ return {
131
+ success: true,
132
+ invite: {
133
+ url: invite.url,
134
+ code: invite.code,
135
+ spaceName: invite.spaceName,
136
+ expiresAt: invite.expiresAt,
137
+ expiresInDays: invite.expiresInDays,
138
+ maxUses: invite.maxUses,
139
+ },
140
+ message: `Share this link with your coworker: ${invite.url}`,
141
+ instructions: [
142
+ "When they click the link:",
143
+ "1. They'll create an Actwith account (or sign in)",
144
+ "2. They'll automatically join your workspace",
145
+ "3. They can set up Claude Code with: actwith init",
146
+ ],
147
+ };
148
+ }
149
+ case "list_invites": {
150
+ const invites = await client.listInvites();
151
+ if (invites.length === 0) {
152
+ return {
153
+ success: true,
154
+ message: "No active invite links. Create one with create_invite.",
155
+ invites: [],
156
+ };
157
+ }
158
+ return {
159
+ success: true,
160
+ count: invites.length,
161
+ invites: invites.map((inv) => ({
162
+ code: inv.code,
163
+ url: inv.url,
164
+ uses: inv.uses,
165
+ maxUses: inv.maxUses,
166
+ expiresAt: inv.expiresAt,
167
+ createdAt: inv.createdAt,
168
+ })),
169
+ };
170
+ }
171
+ case "revoke_invite": {
172
+ const { code } = args;
173
+ await client.revokeInvite(code);
174
+ return {
175
+ success: true,
176
+ message: `Invite link ${code} has been revoked.`,
177
+ };
178
+ }
179
+ default:
180
+ throw new Error(`Unknown workspace tool: ${name}`);
181
+ }
182
+ }
183
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/tools/workspace.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,cAAc,GAAW;IACpC;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,wCAAwC;YACxC,2DAA2D;QAC7D,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ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,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,OAAO,CAAC,MAAM;gBACrB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;oBAC7B,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,GAAG,EAAE,GAAG,CAAC,GAAG;oBACZ,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,OAAO,EAAE,GAAG,CAAC,OAAO;oBACpB,SAAS,EAAE,GAAG,CAAC,SAAS;oBACxB,SAAS,EAAE,GAAG,CAAC,SAAS;iBACzB,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC;QAED,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAwB,CAAC;YAE1C,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAEhC,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,eAAe,IAAI,oBAAoB;aACjD,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@actwith-ai/mcp-server",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for Actwith - persistent memory and session continuity for AI agents",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "actwith-mcp": "dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "start": "node dist/index.js",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "mcp",
18
+ "model-context-protocol",
19
+ "claude",
20
+ "claude-code",
21
+ "cursor",
22
+ "ai",
23
+ "memory",
24
+ "persistent-memory",
25
+ "session-continuity",
26
+ "agents",
27
+ "multi-agent",
28
+ "actwith"
29
+ ],
30
+ "author": "Actwith Team",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/actwith-ai/actwith.git",
35
+ "directory": "packages/mcp-server"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/actwith-ai/actwith/issues"
39
+ },
40
+ "homepage": "https://github.com/actwith-ai/actwith/tree/main/packages/mcp-server#readme",
41
+ "dependencies": {
42
+ "@modelcontextprotocol/sdk": "^1.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^20.0.0",
46
+ "typescript": "^5.0.0"
47
+ },
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ },
51
+ "files": [
52
+ "dist",
53
+ "README.md",
54
+ "ACTWITH.md"
55
+ ],
56
+ "publishConfig": {
57
+ "access": "public"
58
+ }
59
+ }