@memstack/mcp 0.6.4 → 0.7.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/README.md CHANGED
@@ -10,7 +10,7 @@ npm install -g @memstack/mcp
10
10
 
11
11
  ## Quick Start
12
12
 
13
- Add to your MCP client config (~/.claude/mcp.json or .cursor/mcp.json):
13
+ Add to your MCP client config (`~/.config/opencode/`, `~/.claude/mcp.json`, or `.cursor/mcp.json`):
14
14
 
15
15
  ```json
16
16
  {
@@ -101,6 +101,8 @@ The MCP server exposes these tools to the agent:
101
101
  |---|---|
102
102
  | `memory_process` | Store with auto-enrichment (importance, tags) |
103
103
  | `memory_store` | Store a memory |
104
+ | `memory_store_batch` | Store multiple memories in one call (batched embeddings) |
105
+ | `memory_get` | Get a single memory by ID |
104
106
  | `memory_retrieve` | Retrieve memories by query, strategy, time range |
105
107
  | `memory_compile_context` | Assemble token-budgeted LLM-ready context |
106
108
  | `memory_summarize` | Compress old interactions via LLM |
@@ -109,6 +111,10 @@ The MCP server exposes these tools to the agent:
109
111
  | `memory_merge` | Merge multiple memories into one |
110
112
  | `memory_stats` | Memory diagnostics (counts, types, importance) |
111
113
  | `memory_delete` | Delete a single memory |
114
+ | `memory_delete_many` | Delete multiple memories by ID |
115
+ | `memory_touch` | Bump a memory's recency without changing its content |
116
+ | `memory_export` | Export a memory snapshot for backup/migration |
117
+ | `memory_import` | Import memories from a snapshot produced by `memory_export` |
112
118
  | `memory_health` | Check storage/LLM/embedding connectivity |
113
119
  | `memory_dry_run_prune` | Preview what would be pruned |
114
120
 
@@ -119,12 +125,35 @@ The MCP server exposes these tools to the agent:
119
125
  | `memory://{actorId}/context` | Compiled LLM context as markdown |
120
126
  | `memory://{actorId}/stats` | Actor memory stats as JSON |
121
127
 
128
+ ## Input handling
129
+
130
+ Tool arguments are normalized and validated before storage:
131
+
132
+ - `memory_store` / `memory_process` reject an empty or missing `content` with a tool error instead of creating a blank memory.
133
+ - Non-string `content` is coerced to a string; `importance` is clamped to `0.0–1.0`; empty tags are dropped; `actorId` is trimmed.
134
+ - `memory_import` with an empty `memories` array returns `{ "imported": 0 }` (flagged `isError`) instead of throwing.
135
+ - `memory_import` preserves each memory's original `createdAt`, so it round-trips exactly with `memory_export`.
136
+ - `memory_prune` / `memory_dry_run_prune` reject unknown strategy `type` values with a clear error.
137
+
122
138
  ## Prompts
123
139
 
124
140
  | Prompt | Description |
125
141
  |---|---|
126
142
  | `memory_context` | Auto-injected memory context for current actor |
127
143
 
144
+ ## Transport
145
+
146
+ By default `memstack-mcp` speaks MCP over **stdio** — the client spawns it as a subprocess (the Quick Start config above). This is the right choice for one agent per process (opencode, Claude Code, Claude Desktop, Cursor, etc.).
147
+
148
+ For a shared memory server reachable by multiple agents/processes over the network, run it in **Streamable HTTP** mode instead:
149
+
150
+ ```bash
151
+ memstack-mcp --http --port 3939
152
+ # MCP endpoint: http://localhost:3939/mcp
153
+ ```
154
+
155
+ HTTP mode is stateless (`sessionIdGenerator: undefined` per the MCP spec) — each request gets a fresh protocol handshake, but all requests share one underlying MemStack instance, so storage connections aren't reopened per call. Point any Streamable-HTTP-capable MCP client at `http://host:3939/mcp`.
156
+
128
157
  ## Actor persistence
129
158
 
130
159
  By default, all memories belong to the `"default"` actor. Set `MEMSTACK_ACTOR` to identify the agent:
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node