@memstack/mcp 0.5.0 → 0.7.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.
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
  {
@@ -80,6 +80,7 @@ SQLITE_PATH=./memory.db
80
80
  | `ANTHROPIC_API_KEY` | Anthropic (summarization) |
81
81
  | `MEMSTACK_OPENAI_BASE_URL` | Custom API endpoint (DeepSeek, etc.) |
82
82
  | `MEMSTACK_LLM_MODEL` | Model override |
83
+ | `MEMSTACK_EMBED_ON_STORE` | Auto-embed on store (default: true) |
83
84
  | `MEMSTACK_ACTOR` | Default actor ID |
84
85
 
85
86
  At least one of `OPENAI_API_KEY` or `ANTHROPIC_API_KEY` must be set. Anthropic preferred if both are set.
@@ -100,6 +101,8 @@ The MCP server exposes these tools to the agent:
100
101
  |---|---|
101
102
  | `memory_process` | Store with auto-enrichment (importance, tags) |
102
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 |
103
106
  | `memory_retrieve` | Retrieve memories by query, strategy, time range |
104
107
  | `memory_compile_context` | Assemble token-budgeted LLM-ready context |
105
108
  | `memory_summarize` | Compress old interactions via LLM |
@@ -108,6 +111,10 @@ The MCP server exposes these tools to the agent:
108
111
  | `memory_merge` | Merge multiple memories into one |
109
112
  | `memory_stats` | Memory diagnostics (counts, types, importance) |
110
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` |
111
118
  | `memory_health` | Check storage/LLM/embedding connectivity |
112
119
  | `memory_dry_run_prune` | Preview what would be pruned |
113
120
 
@@ -118,12 +125,35 @@ The MCP server exposes these tools to the agent:
118
125
  | `memory://{actorId}/context` | Compiled LLM context as markdown |
119
126
  | `memory://{actorId}/stats` | Actor memory stats as JSON |
120
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
+
121
138
  ## Prompts
122
139
 
123
140
  | Prompt | Description |
124
141
  |---|---|
125
142
  | `memory_context` | Auto-injected memory context for current actor |
126
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
+
127
157
  ## Actor persistence
128
158
 
129
159
  By default, all memories belong to the `"default"` actor. Set `MEMSTACK_ACTOR` to identify the agent:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memstack/mcp",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "MCP server for MemStack — AI agent memory via Model Context Protocol",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,8 @@
30
30
  "homepage": "https://github.com/isiomaC/memstack",
31
31
  "dependencies": {
32
32
  "@modelcontextprotocol/sdk": "^1.0.0",
33
- "@memstack/core": "0.5.0"
33
+ "@memstack/config-env": "0.7.0",
34
+ "@memstack/core": "0.7.0"
34
35
  },
35
36
  "devDependencies": {
36
37
  "tsup": "^8.0.0",
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node