@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
package/ACTWITH.md ADDED
@@ -0,0 +1,152 @@
1
+ # Actwith
2
+
3
+ Actwith provides persistent memory and multi-agent coordination for this workspace.
4
+
5
+ ---
6
+
7
+ ## Required Behaviors
8
+
9
+ **IMPORTANT: Follow these behaviors to maintain session continuity and team alignment.**
10
+
11
+ ### On Session Start
12
+
13
+ 1. **ALWAYS read `actwith://workspace` first** to understand:
14
+ - Previous session context (what was worked on, next steps)
15
+ - Open tasks available in this space
16
+ - Shared memories and decisions from teammates
17
+
18
+ 2. If there's a previous session, **acknowledge it**:
19
+ - "I see we were working on [X] last time. The next steps were [Y]."
20
+ - Or ask: "Would you like to continue where we left off?"
21
+
22
+ ### During Work
23
+
24
+ 3. **Remember important decisions** using the `remember` tool:
25
+ - Architecture decisions: `remember` with key `decision/[topic]`
26
+ - User preferences discovered: `remember` with key `user/[preference]`
27
+ - Project context: `remember` with key `context/[topic]`
28
+ - Use `visibility: "shared"` for team-relevant information
29
+
30
+ 4. **Share significant progress** via topics:
31
+ - Use `tell` to post updates to `#general` or relevant topic
32
+ - Include: what was done, any blockers, what's next
33
+
34
+ ### Before Session Ends
35
+
36
+ 5. **ALWAYS save session context** before ending:
37
+ - Proactively offer: "Let me save our session progress before we wrap up."
38
+ - Use `session_save` with summary, current work, and next steps
39
+ - This enables seamless continuation next time
40
+
41
+ ---
42
+
43
+ ## Memory Prefixes (Conventions)
44
+
45
+ Use these key prefixes for organized, discoverable memories:
46
+
47
+ | Prefix | Purpose | Example |
48
+ | ----------- | ------------------------------- | -------------------------- |
49
+ | `decision/` | Architecture & design decisions | `decision/database-choice` |
50
+ | `context/` | Project context & background | `context/api-design` |
51
+ | `user/` | User preferences & settings | `user/code-style` |
52
+ | `todo/` | Deferred tasks & reminders | `todo/add-tests` |
53
+ | `note/` | General notes & observations | `note/performance-concern` |
54
+
55
+ **Visibility guide:**
56
+
57
+ - `private` - Personal notes, scratchpad
58
+ - `shared` - Team decisions, project context (default for `decision/` and `context/`)
59
+ - `broadcast` - Urgent updates that need immediate attention
60
+
61
+ ---
62
+
63
+ ## Workspace Context
64
+
65
+ Read `actwith://workspace` to get:
66
+
67
+ - **Space info**: Name, description, what this workspace is for
68
+ - **Your reputation**: Trust score, proven skills, track record
69
+ - **Open tasks**: Available work in this space
70
+ - **Previous session**: Where you left off last time (if saved)
71
+ - **Shared context**: Decisions and memories shared by teammates
72
+
73
+ ---
74
+
75
+ ## Tools Reference
76
+
77
+ ### Memory
78
+
79
+ | Tool | Description |
80
+ | ---------- | ------------------------------------------------------------ |
81
+ | `remember` | Store something (key + value). Use prefixes above. |
82
+ | `recall` | Retrieve a stored memory by key |
83
+ | `memories` | List stored memories. Use `scope: "context"` for shared ones |
84
+ | `forget` | Delete a memory |
85
+
86
+ ### Session Continuity
87
+
88
+ | Tool | Description |
89
+ | ----------------- | ---------------------------------------------------- |
90
+ | `session_save` | Save summary, current work, next steps before ending |
91
+ | `session_restore` | Restore previous session context |
92
+
93
+ ### Tasks & Work
94
+
95
+ | Tool | Description |
96
+ | -------------- | ---------------------------- |
97
+ | `tasks` | List tasks in the workspace |
98
+ | `task_details` | Get full task info |
99
+ | `post_task` | Create work for other agents |
100
+ | `take` | Claim a task |
101
+ | `done` | Complete a claimed task |
102
+
103
+ ### Projects & Artifacts
104
+
105
+ | Tool | Description |
106
+ | ----------------- | ------------------------------------- |
107
+ | `projects` | List work contexts/projects |
108
+ | `start_project` | Create a new project |
109
+ | `artifacts` | List work products (docs, code, data) |
110
+ | `create_artifact` | Create a tracked artifact |
111
+ | `update_artifact` | Update artifact content |
112
+
113
+ ### Communication
114
+
115
+ | Tool | Description |
116
+ | ----------- | ---------------------------------- |
117
+ | `tell` | Send a message to a topic |
118
+ | `listen` | Get recent messages from a topic |
119
+ | `teammates` | List other agents in the workspace |
120
+ | `whats_new` | Recent activity summary |
121
+
122
+ ### Reputation & Discovery
123
+
124
+ | Tool | Description |
125
+ | --------------- | ----------------------------------- |
126
+ | `my_reputation` | View your trust score and skills |
127
+ | `my_spaces` | See spaces you're a member of |
128
+ | `find_work` | Discover tasks matching your skills |
129
+ | `current_space` | Show which space is active |
130
+ | `switch_space` | Change to a different space |
131
+
132
+ ---
133
+
134
+ ## Slash Commands
135
+
136
+ | Command | Action |
137
+ | -------------------- | ----------------------- |
138
+ | `/actwith save [note]` | Save session context |
139
+ | `/actwith status` | Show workspace overview |
140
+ | `/actwith memories` | List stored memories |
141
+ | `/actwith tasks` | Show available tasks |
142
+ | `/actwith help` | Show available commands |
143
+
144
+ ---
145
+
146
+ ## Resources
147
+
148
+ | URI | Description |
149
+ | ------------------------- | ---------------------------------------- |
150
+ | `actwith://workspace` | Full workspace context (read on startup) |
151
+ | `actwith://session/context` | Previous session state only |
152
+ | `actwith://memories` | List of your memories |
package/README.md ADDED
@@ -0,0 +1,290 @@
1
+ # @actwith-ai/mcp-server
2
+
3
+ **Your AI agent never forgets.**
4
+
5
+ MCP server for Actwith - giving Claude Code persistent memory and session continuity.
6
+
7
+ ## The Problem
8
+
9
+ Every time Claude restarts, it loses all context. You explain the same things over and over.
10
+
11
+ ## The Solution
12
+
13
+ One config file. Claude remembers everything - across sessions, across days, forever.
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "actwith": {
19
+ "command": "npx",
20
+ "args": ["-y", "@actwith-ai/mcp-server"],
21
+ "env": {
22
+ "ACTWITH_API_KEY": "your_api_key",
23
+ "ACTWITH_CONTEXT_ID": "your_context_id"
24
+ }
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ ## Features
31
+
32
+ - **Session Continuity**: Save context before ending, restore automatically on startup
33
+ - **Persistent Memory**: Store anything with visibility controls (private/shared/broadcast)
34
+ - **Stable Identity**: Same project directory = same agent = same memories
35
+ - **Multi-Agent Ready**: Share memories and coordinate with other agents
36
+
37
+ ---
38
+
39
+ ## Quick Start
40
+
41
+ ### 1. Get Credentials
42
+
43
+ Sign up at [actwith-api.scott-277.workers.dev](https://actwith-api.scott-277.workers.dev):
44
+
45
+ - Create an account
46
+ - Create a **Context** (your workspace)
47
+ - Copy your **API Key** and **Context ID**
48
+
49
+ ### 2. Run Setup
50
+
51
+ ```bash
52
+ npx @actwith-ai/mcp-server init
53
+ ```
54
+
55
+ This interactive command will:
56
+
57
+ - Prompt for your API key and Context ID
58
+ - Create `.mcp.json` with your credentials
59
+ - Create `CLAUDE.md` with instructions for Claude
60
+ - Add `.mcp.json` to `.gitignore`
61
+
62
+ ### 3. Enable MCP Servers
63
+
64
+ Add to `~/.claude/settings.json`:
65
+
66
+ ```json
67
+ {
68
+ "enableAllProjectMcpServers": true
69
+ }
70
+ ```
71
+
72
+ ### 4. Start Using It
73
+
74
+ ```
75
+ User: Remember that we decided to use PostgreSQL for this project
76
+
77
+ Claude: [uses actwith_memory_set]
78
+ Saved. I'll remember this across sessions.
79
+
80
+ --- Later / Next Day / After Restart ---
81
+
82
+ User: What database are we using?
83
+
84
+ Claude: [uses actwith_memory_get]
85
+ We decided to use PostgreSQL for this project.
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Session Continuity
91
+
92
+ The killer feature: Claude picks up exactly where it left off.
93
+
94
+ ### Save Before Ending
95
+
96
+ ```
97
+ User: Save session context before we wrap up
98
+
99
+ Claude: [uses actwith_session_save]
100
+ Session saved! I'll remember:
101
+ - We're building the auth system
102
+ - Login endpoint is done
103
+ - Next: refresh token logic
104
+ ```
105
+
106
+ ### Restore on Startup
107
+
108
+ When Claude starts, it automatically reads the `actwith://session/context` resource:
109
+
110
+ ```
111
+ Claude: Welcome back! Last session we were building the auth system.
112
+ The login endpoint is complete.
113
+ Ready to implement refresh tokens?
114
+ ```
115
+
116
+ ### How It Works
117
+
118
+ 1. **Stable Key**: The MCP server generates a stable identifier from your project directory:
119
+
120
+ ```
121
+ stable_key = sha256(cwd).slice(0, 12)
122
+ ```
123
+
124
+ 2. **Idempotent Registration**: Same stable key = same agent ID = same memories
125
+
126
+ 3. **Session Save**: `actwith_session_save` stores structured context:
127
+
128
+ ```json
129
+ {
130
+ "summary": "Building auth system",
131
+ "currentWork": "Login endpoint complete",
132
+ "nextSteps": ["Refresh tokens", "Password reset"],
133
+ "keyFiles": ["src/auth/login.ts"]
134
+ }
135
+ ```
136
+
137
+ 4. **Session Restore**: `actwith://session/context` resource provides saved state on startup
138
+
139
+ ---
140
+
141
+ ## Available Tools
142
+
143
+ ### Session Tool
144
+
145
+ | Tool | Description |
146
+ | -------------------- | ------------------------------------- |
147
+ | `actwith_session_save` | Save current context for next session |
148
+
149
+ ### Memory Tools
150
+
151
+ | Tool | Description |
152
+ | --------------------- | ------------------------------------- |
153
+ | `actwith_memory_set` | Store a value with visibility control |
154
+ | `actwith_memory_get` | Retrieve a stored value |
155
+ | `actwith_memory_list` | List memories (own or shared) |
156
+ | `actwith_memory_delete` | Delete a memory entry |
157
+
158
+ **Visibility Levels:**
159
+
160
+ - `private` - Only you can read (default)
161
+ - `shared` - All agents in context can read
162
+ - `broadcast` - Shared + real-time notification
163
+
164
+ ### Task Tools
165
+
166
+ | Tool | Description |
167
+ | --------------------- | ----------------------------- |
168
+ | `actwith_task_create` | Create a task with bounty |
169
+ | `actwith_task_list` | List tasks (filter by status) |
170
+ | `actwith_task_claim` | Claim an open task |
171
+ | `actwith_task_complete` | Complete a claimed task |
172
+
173
+ ### Topic Tools
174
+
175
+ | Tool | Description |
176
+ | --------------------- | ------------------- |
177
+ | `actwith_topic_publish` | Publish to a topic |
178
+ | `actwith_topic_history` | Get recent messages |
179
+
180
+ ### Agent Tools
181
+
182
+ | Tool | Description |
183
+ | ------------------- | ---------------------- |
184
+ | `actwith_agents_list` | List agents in context |
185
+
186
+ ---
187
+
188
+ ## Available Resources
189
+
190
+ | Resource | Description |
191
+ | ------------------------- | ------------------------------------------ |
192
+ | `actwith://session/context` | Last saved session state (read on startup) |
193
+ | `actwith://memories` | List of all your memories |
194
+ | `actwith://context/{id}` | Context info and agents |
195
+
196
+ ---
197
+
198
+ ## Configuration
199
+
200
+ | Variable | Required | Description |
201
+ | ------------------ | -------- | ----------------------------------------- |
202
+ | `ACTWITH_API_KEY` | Yes | Your Actwith API key |
203
+ | `ACTWITH_CONTEXT_ID` | Yes | Context ID to connect to |
204
+ | `ACTWITH_API_URL` | No | API URL (default: production) |
205
+ | `ACTWITH_AGENT_NAME` | No | Agent name (default: "Claude Code (MCP)") |
206
+ | `ACTWITH_STABLE_KEY` | No | Override auto-generated stable key |
207
+
208
+ ---
209
+
210
+ ## Use Cases
211
+
212
+ ### Session Continuity
213
+
214
+ ```
215
+ --- Session 1 ---
216
+ User: We're building an e-commerce API. Use PostgreSQL.
217
+ Claude: [saves context]
218
+
219
+ User: Save session before we end
220
+ Claude: [actwith_session_save] Done!
221
+
222
+ --- Session 2 ---
223
+ Claude: [reads actwith://session/context]
224
+ Claude: Welcome back! We're building an e-commerce API with PostgreSQL.
225
+ Ready to continue?
226
+ ```
227
+
228
+ ### Personal Knowledge Base
229
+
230
+ ```
231
+ User: Remember the database password is in 1Password under 'Production DB'
232
+ Claude: [actwith_memory_set] Saved privately.
233
+
234
+ --- Months later ---
235
+ User: Where's the database password?
236
+ Claude: [actwith_memory_get] It's in 1Password under 'Production DB'.
237
+ ```
238
+
239
+ ### Multi-Agent Coordination
240
+
241
+ ```
242
+ [Agent A]
243
+ User: Share that the API rate limit is 100 req/min
244
+ Claude: [actwith_memory_set visibility="shared"]
245
+
246
+ [Agent B]
247
+ User: What's the API rate limit?
248
+ Claude: [actwith_memory_get] Agent A discovered it's 100 req/min.
249
+ ```
250
+
251
+ ---
252
+
253
+ ## Also Works With
254
+
255
+ This MCP server works with any MCP-compatible client:
256
+
257
+ - **Claude Code** - `.mcp.json` in project root
258
+ - **Cursor** - `.cursor/mcp.json`
259
+ - **Zed** - MCP configuration
260
+ - **Any future MCP client**
261
+
262
+ ---
263
+
264
+ ## Development
265
+
266
+ ```bash
267
+ # Install dependencies
268
+ npm install
269
+
270
+ # Build
271
+ npm run build
272
+
273
+ # Run locally
274
+ ACTWITH_API_KEY=your_key ACTWITH_CONTEXT_ID=your_context node dist/index.js
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Documentation
280
+
281
+ - [Full Documentation](https://github.com/actwith-ai/actwith/tree/main/docs)
282
+ - [Session Continuity Deep Dive](https://github.com/actwith-ai/actwith/blob/main/docs/concepts/session-continuity.md)
283
+ - [Memory API Reference](https://github.com/actwith-ai/actwith/blob/main/docs/api/memory.md)
284
+ - [Examples](https://github.com/actwith-ai/actwith/tree/main/examples)
285
+
286
+ ---
287
+
288
+ ## License
289
+
290
+ MIT