suture-mcp 0.1.1 → 0.2.0-rc.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
@@ -1,9 +1,9 @@
1
- # suture-mcp (Beta)
1
+ # suture-mcp (0.2 Release Candidate)
2
2
 
3
3
  Persistent structured memory for AI agents. Suture is an MCP-native, zero-infra memory substrate that stores curated local context in SQLite, then exposes it through model-agnostic tools and CLI hooks.
4
4
 
5
5
  > [!IMPORTANT]
6
- > **Beta Status:** Suture is currently in local-first beta. Expect breaking changes to the database schema and tool definitions. **Do not use for highly sensitive production credentials.**
6
+ > **Release Candidate Status:** Suture is preparing the `v0.2.0` stable local-core release. The current candidate keeps the beta privacy boundary: local SQLite by default, no hosted sync by default, and no raw repository upload. **Do not use for highly sensitive production credentials.**
7
7
 
8
8
  ## Quickstart
9
9
 
@@ -15,45 +15,86 @@ npx suture-mcp@beta setup
15
15
 
16
16
  The setup flow checks the local runtime, previews the state directory and MCP config, shows the safe project index plan, lets you toggle durable project facts with the keyboard, runs indexing, then ends on a value dashboard with estimated token savings and curation activity.
17
17
 
18
- For agents, CI, and scripted installs:
18
+ ### Try Suture once with `npx`
19
+
20
+ Use this path when you want to test Suture without installing a persistent CLI:
19
21
 
20
22
  ```bash
21
23
  npx suture-mcp@beta setup --yes --project /path/to/project --dir /path/to/suture-data
22
- suture-mcp index /path/to/project --apply-safe --json
23
- suture-mcp stats --json
24
+ npx suture-mcp@beta stats --dir /path/to/suture-data
24
25
  ```
25
26
 
26
- Until the npm beta tag is published, use the GitHub fallback with an explicit package command:
27
+ `npx` downloads and runs the package for that command. It does not guarantee a lasting `suture` command on your PATH after the command exits.
27
28
 
28
- ```bash
29
- npm exec --yes --package github:AlejandroZmtZ/suture-mcp -- suture-mcp setup
30
- ```
29
+ ### Install the CLI for agents
31
30
 
32
- If npm reports `spawn sh ENOENT` on native dependency install, set the lifecycle script shell explicitly and retry:
31
+ Use this path when MCP agents need to launch Suture repeatedly:
33
32
 
34
33
  ```bash
35
- npm config set script-shell /bin/sh
36
- npm exec --yes --package github:AlejandroZmtZ/suture-mcp -- suture-mcp doctor
34
+ npm install -g suture-mcp@beta
35
+ suture setup --yes --project /path/to/project --dir /path/to/suture-data
36
+ suture configure-agents --project /path/to/project --dir /path/to/suture-data --agents codex,gemini,claude,cursor,vscode,continue
37
+ suture stats --dir /path/to/suture-data
37
38
  ```
38
39
 
39
- The printed MCP config is ready to paste into your agent:
40
+ Installed CLI is recommended for real agent use because generated MCP configs can rely on:
40
41
 
41
42
  ```json
42
43
  {
43
44
  "mcpServers": {
44
45
  "suture": {
45
- "command": "suture-mcp",
46
+ "command": "suture",
46
47
  "args": ["serve", "--dir", "/path/to/suture-data"]
47
48
  }
48
49
  }
49
50
  }
50
51
  ```
51
52
 
53
+ If you intentionally want an agent to launch through `npx`, use:
54
+
55
+ ```json
56
+ {
57
+ "mcpServers": {
58
+ "suture": {
59
+ "command": "npx",
60
+ "args": ["-y", "suture-mcp@beta", "serve", "--dir", "/path/to/suture-data"]
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ That works, but startup depends on npm/cache behavior and can be slower than an installed CLI.
67
+
68
+ Until the npm beta tag is published, use the GitHub fallback with an explicit package command:
69
+
70
+ ```bash
71
+ npm exec --yes --package github:AlejandroZmtZ/suture-mcp -- suture setup
72
+ ```
73
+
74
+ If npm reports `spawn sh ENOENT` on native dependency install, set the lifecycle script shell explicitly and retry:
75
+
76
+ ```bash
77
+ npm config set script-shell /bin/sh
78
+ npm exec --yes --package github:AlejandroZmtZ/suture-mcp -- suture doctor
79
+ ```
80
+
81
+ Or let Suture write supported local agent configs for you:
82
+
83
+ ```bash
84
+ suture configure-agents --project /path/to/project --dir /path/to/suture-data --agents codex,gemini,claude,cursor,vscode,continue
85
+ ```
86
+
87
+ This creates timestamped `.bak-suture-*` backups before editing config files. For a preview without writing:
88
+
89
+ ```bash
90
+ suture configure-agents --project /path/to/project --dir /path/to/suture-data --agents all --dry-run
91
+ ```
92
+
52
93
  Once connected:
53
94
 
54
95
  - **Remember:** Ask your agent to "remember this decision: we are using SQLite for persistence."
55
96
  - **Search:** Ask "what did we decide about persistence?"
56
- - **Stats:** Run `suture-mcp stats` to see estimated cached tokens, avoided rereads, indexed files, curation actions, and cost savings.
97
+ - **Stats:** Run `suture stats` to see estimated cached tokens, avoided rereads, indexed files, curation actions, and cost savings.
57
98
 
58
99
  ## Beta Install Validation
59
100
 
@@ -68,15 +109,32 @@ npx suture-mcp@beta stats --dir /path/to/shared-suture-state
68
109
 
69
110
  The second setup should report an existing substrate, apply zero duplicate facts, skip unchanged files, and show avoided reread tokens in the stats dashboard. That is the expected second-agent path for Claude, Codex, Cursor, or any other MCP-capable client using the same state directory.
70
111
 
71
- ## Beta Safety & Limitations
112
+ ### Codex MCP Validation
72
113
 
73
- Suture is in **local-first beta**. It is designed with a defense-in-depth security posture, but please note these limitations:
114
+ For a safe Codex test, validate Suture with a disposable state directory and an isolated Codex config first:
115
+
116
+ ```bash
117
+ node dist/cli.js setup --yes --project /home/alex/suture-mcp --dir /tmp/suture-codex-qa --json
118
+ node dist/cli.js configure-agents --project /home/alex/suture-mcp --dir /tmp/suture-codex-qa --agents codex --dry-run --json
119
+
120
+ rm -rf /tmp/codex-suture-qa-home
121
+ mkdir -p /tmp/codex-suture-qa-home
122
+ CODEX_HOME=/tmp/codex-suture-qa-home codex mcp add suture -- suture-mcp serve --dir /tmp/suture-codex-qa
123
+ CODEX_HOME=/tmp/codex-suture-qa-home codex mcp list
124
+ CODEX_HOME=/tmp/codex-suture-qa-home codex mcp get suture
125
+ ```
126
+
127
+ This route does not modify your real `~/.codex/config.toml`. After you intentionally add Suture to your real Codex config, start a new Codex session so the MCP server list is loaded fresh.
128
+
129
+ ## Release Candidate Safety & Limitations
130
+
131
+ Suture is in **local-first release-candidate validation**. It is designed with a defense-in-depth security posture, but please note these limitations:
74
132
 
75
133
  - **Secret Detection:** Suture uses a regex-based scanner to block obvious API keys (OpenAI, AWS, etc.) and `.env` secrets. This is **best-effort** and not a replacement for a dedicated DLP solution.
76
- - **Privacy:** Data stays on your machine in a local SQLite database. There is no cloud sync or telemetry in the beta.
134
+ - **Privacy:** Data stays on your machine in a local SQLite database. There is no cloud sync or telemetry in the local-core release.
77
135
  - **Disabled Tools:** The `import` tool is explicitly disabled in beta to prevent unsafe database restores.
78
136
  - **Native Dependencies:** Uses `better-sqlite3` and `tree-sitter`. Installation may require a working Node.js build environment (GXX/Xcode) on some systems.
79
- - **Breaking Changes:** Schema migrations are supported, but we recommend regular `transfer` exports of critical memory during beta.
137
+ - **Breaking Changes:** Schema migrations are supported, but we recommend regular `transfer` exports of critical memory until `v0.2.0` exits release-candidate validation.
80
138
 
81
139
  ## Current Capabilities
82
140
 
@@ -93,7 +151,7 @@ Suture is in **local-first beta**. It is designed with a defense-in-depth securi
93
151
 
94
152
  ```bash
95
153
  npm install -g suture-mcp
96
- suture-mcp setup --project /path/to/project --dir /path/to/state
154
+ suture setup --project /path/to/project --dir /path/to/state
97
155
  ```
98
156
 
99
157
  For local development:
@@ -109,7 +167,7 @@ npm test
109
167
  Start the server over stdio:
110
168
 
111
169
  ```bash
112
- suture-mcp serve --dir /path/to/state
170
+ suture serve --dir /path/to/state
113
171
  ```
114
172
 
115
173
  Example MCP client configuration (Note: Use absolute paths; many clients do not expand `~`):
@@ -118,7 +176,7 @@ Example MCP client configuration (Note: Use absolute paths; many clients do not
118
176
  {
119
177
  "mcpServers": {
120
178
  "suture": {
121
- "command": "suture-mcp",
179
+ "command": "suture",
122
180
  "args": ["serve", "--dir", "/home/user/.suture"]
123
181
  }
124
182
  }
@@ -128,18 +186,22 @@ Example MCP client configuration (Note: Use absolute paths; many clients do not
128
186
  ## CLI
129
187
 
130
188
  ```bash
131
- suture-mcp setup [--project <path>] [--dir <state>] [--yes] [--json]
132
- suture-mcp init [--dir <path>]
133
- suture-mcp serve [--dir <path>]
134
- suture-mcp viz [--dir <state>] [--port <port>]
135
- suture-mcp doctor [--dir <state>] [--json]
136
- suture-mcp index <project> [--dir <state>] [--apply-safe] [--json]
137
- suture-mcp hook session-start --project <path> --session <id> [--client <name>] [--format text|json|claude-json]
138
- suture-mcp hook pre-compact --project <path> --session <id> [--client <name>] [--json]
139
- suture-mcp hook post-compact --project <path> --session <id> [--client <name>] [--summary <text>|--summary-file <path>] [--json]
140
- suture-mcp hook status --project <path> --session <id> [--client <name>] [--json]
141
- suture-mcp stats [--dir <state>] [--json] [--model-profile conservative|standard|premium]
142
- suture-mcp recall [--dir <state>]
189
+ suture setup [--project <path>] [--dir <state>] [--yes] [--json]
190
+ suture setup [--project <path>] [--dir <state>] [--configure-agents] [--agents codex,gemini,claude,cursor,vscode,windsurf,cline,continue,vibe|all]
191
+ suture init [--dir <path>]
192
+ suture configure-agents [--project <path>] [--dir <state>] [--agents codex,gemini,claude,cursor,vscode,windsurf,cline,continue,vibe|all] [--dry-run] [--json]
193
+ suture serve [--dir <path>]
194
+ suture viz [--dir <state>] [--port <port>]
195
+ suture export --out <path> [--encrypted] [--json] [--passphrase-env <name>]
196
+ suture state encryption status [--dir <state>] [--json]
197
+ suture doctor [--dir <state>] [--json]
198
+ suture index <project> [--dir <state>] [--apply-safe] [--json]
199
+ suture hook session-start --project <path> --session <id> [--client <name>] [--format text|json|claude-json]
200
+ suture hook pre-compact --project <path> --session <id> [--client <name>] [--json]
201
+ suture hook post-compact --project <path> --session <id> [--client <name>] [--summary <text>|--summary-file <path>] [--json]
202
+ suture hook status --project <path> --session <id> [--client <name>] [--json]
203
+ suture stats [--dir <state>] [--json] [--model-profile conservative|standard|premium]
204
+ suture recall [--dir <state>]
143
205
  ```
144
206
 
145
207
  `index` previews by default. Persistence requires `--apply-safe`.
@@ -153,10 +215,97 @@ Beta indexing is deliberately conservative: manifest/config/script/test/code-sym
153
215
  Run the local dashboard against a Suture state directory:
154
216
 
155
217
  ```bash
156
- suture-mcp viz --dir /path/to/suture-data
218
+ suture viz --dir /path/to/suture-data
157
219
  ```
158
220
 
159
- The viz server binds only to `127.0.0.1`. It prints a one-time local URL containing a random token, and all `/api/*` routes require that token. The dashboard uses local assets only, so it does not load graph code from a CDN.
221
+ The viz server binds only to `127.0.0.1`. It prints a one-time local session URL, sends the token to APIs with `x-suture-viz-token`, and all `/api/*` routes require that token. This protects browser/API access, not a compromised OS user. The dashboard uses local assets only, so it does not load graph code from a CDN.
222
+
223
+ ### Encrypted Exports
224
+
225
+ Plain SQLite remains the beta default. For a portable protected backup, export active memory to an encrypted artifact:
226
+
227
+ ```bash
228
+ suture export --encrypted --out /tmp/suture-export.enc.json
229
+ ```
230
+
231
+ For CI or scripted flows, provide the passphrase through an environment variable:
232
+
233
+ ```bash
234
+ SUTURE_EXPORT_PASSPHRASE='change-me' suture export --encrypted --out /tmp/suture-export.enc.json --json
235
+ ```
236
+
237
+ Check the current live-state encryption posture:
238
+
239
+ ```bash
240
+ suture state encryption status --dir /path/to/suture-data
241
+ ```
242
+
243
+ Live SQLite encryption and encrypted import are not enabled in this beta pass.
244
+
245
+ ### Agent Auto-Configuration
246
+
247
+ `configure-agents` adds the Suture MCP server to supported local agent config files. It is best for installed CLI usage where the agent can repeatedly launch `suture serve` or `suture-mcp serve` from PATH. For one-off `npx` testing, keep the MCP command as `npx` with args `["-y", "suture-mcp@beta", "serve", "--dir", "..."]` instead of writing an installed-command config.
248
+
249
+ - Codex: `~/.codex/config.toml`, using `[mcp_servers.suture]`.
250
+ - Gemini CLI: `<project>/.gemini/settings.json`, using `mcpServers.suture`.
251
+ - Claude Code: `<project>/.mcp.json`, using `mcpServers.suture`.
252
+ - Cursor: `<project>/.cursor/mcp.json`, using `mcpServers.suture`.
253
+ - VS Code / Copilot: `<project>/.vscode/mcp.json`, using `servers.suture`.
254
+ - Windsurf: `~/.codeium/windsurf/mcp_config.json`, using `mcpServers.suture`.
255
+ - Cline: `~/.cline/data/settings/cline_mcp_settings.json`, using `mcpServers.suture`.
256
+ - Continue: `<project>/.continue/mcpServers/suture-mcp.yaml`, using a standalone `mcpServers` block.
257
+ - Mistral Vibe: `~/.vibe/config.toml`, using `[[mcp_servers]]` with `transport = "stdio"`.
258
+
259
+ `all` configures every supported host. Use `--dry-run` first if you want to inspect every file Suture would touch.
260
+ For real writes, pass an explicit `--agents` list or `--agents all`; omitting the flag is limited to dry-run previews so user-home configs are not changed accidentally.
261
+
262
+ Example:
263
+
264
+ ```bash
265
+ suture configure-agents \
266
+ --project /home/alex/fronterre-assessment-platform \
267
+ --dir /home/alex/.suture/fronterre-assessment-platform \
268
+ --agents codex,gemini,claude,cursor,vscode,continue
269
+ ```
270
+
271
+ Native installation also writes a project-local instruction pack so the harness knows how to use Suture as a memory substrate immediately after MCP reload:
272
+
273
+ ```bash
274
+ suture configure-agents \
275
+ --project /home/alex/fronterre-assessment-platform \
276
+ --dir /home/alex/.suture/fronterre-assessment-platform \
277
+ --agents codex,gemini,cursor \
278
+ --native \
279
+ --dry-run
280
+
281
+ suture configure-agents \
282
+ --project /home/alex/fronterre-assessment-platform \
283
+ --agents codex,gemini,cursor \
284
+ --verify \
285
+ --json
286
+ ```
287
+
288
+ Native integration is intentionally conservative:
289
+
290
+ - MCP launch config is schema-aware and backed up before writes.
291
+ - Instruction files are project-local by default.
292
+ - User-home writes happen only for clients whose MCP config is user-scoped.
293
+ - Agents should reload or start a new session after install.
294
+ - The tool guide is also available at `suture://resources/tool-guide`.
295
+
296
+ You can also run setup and configure agents in one pass:
297
+
298
+ ```bash
299
+ suture setup \
300
+ --project /home/alex/fronterre-assessment-platform \
301
+ --dir /home/alex/.suture/fronterre-assessment-platform \
302
+ --configure-agents \
303
+ --agents codex,gemini,claude,cursor,vscode,continue
304
+ ```
305
+
306
+ Restart each agent after changing MCP config. Claude Code may prompt for project-scoped MCP approval the first time it sees `.mcp.json`.
307
+
308
+ Ollama, llama.cpp, and LM Studio are model runtimes/providers rather than MCP hosts. Use Suture through an MCP-capable harness that can call those models, such as Continue, Cline, Mistral Vibe, Open WebUI, or another MCP client. ChatGPT custom connectors, Le Chat connectors, and Open WebUI's native MCP path generally require a remote Streamable HTTP MCP endpoint, which is separate from Suture's local stdio server.
160
309
 
161
310
  ## Multi-Agent Sharing
162
311
 
@@ -166,7 +315,7 @@ Suture memory is shared by state directory, not by model provider. Configure eve
166
315
  {
167
316
  "mcpServers": {
168
317
  "suture": {
169
- "command": "suture-mcp",
318
+ "command": "suture",
170
319
  "args": ["serve", "--dir", "/path/to/shared-suture-state"]
171
320
  }
172
321
  }
@@ -194,6 +343,25 @@ Recommended integration pattern for a new harness:
194
343
  4. Call `curate` periodically or after compaction. Suture also runs event-based curation after `remember`, accepted discovery/indexing changes, and discovery apply.
195
344
  5. Keep raw transcripts out of durable memory.
196
345
 
346
+ ### Sleep-Time Maintenance
347
+
348
+ Suture uses existing hook workflows to run bounded local maintenance after compaction and status-safe idle checks. The sleep-time cycle records an audit event, plans maintenance, refreshes local retrieval indexes when the runtime has index access, and avoids automatic destructive invalidation unless an explicit maintenance apply is requested.
349
+
350
+ ### Semantic Retrieval
351
+
352
+ Suture keeps deterministic FTS5 retrieval and adds a local vector reranker over FTS5 candidates. The default vectorizer is offline and provider-free, so search quality improves without sending project memory to an external embedding service. Project-scoped searches pass project identity through FTS and vector reranking before results are returned.
353
+
354
+ ### Maintenance Automation
355
+
356
+ Manual tools remain available, and the safer automated flow is:
357
+
358
+ ```bash
359
+ suture maintenance plan --project-id <project-id> --allow-invalidation --json
360
+ suture maintenance apply --plan <plan-id> --actions <comma-separated-action-ids> --json
361
+ ```
362
+
363
+ Maintenance plans can propose retain, promote, archive, invalidate, and reindex actions. Only selected action IDs are applied, and invalidation removes search indexes and writes an audit row instead of hard-deleting records.
364
+
197
365
  ## Security Boundaries
198
366
 
199
367
  Suture is local-first by default. It is designed to avoid storing raw prompt transcripts and to reject obvious secrets before persistence.
@@ -213,22 +381,24 @@ These protections are defense-in-depth, not a replacement for a dedicated secret
213
381
  The open-core path is straightforward:
214
382
 
215
383
  - Free local package: single-user memory, discovery, CLI hooks, and visualization.
216
- - Paid team layer: encrypted sync, shared project maps, audit logs, policy controls, hosted backups, and admin review.
384
+ - Paid team layer: encrypted metadata sync, reviewed shared project maps, audit logs, policy controls, hosted backups, and admin review.
217
385
  - Enterprise layer: SSO, retention controls, compliance exports, private deployment, and model/harness fleet observability.
218
386
 
387
+ Team sync is governed by a strict data boundary: memory summaries, provenance, project identity, schema versions, maintenance audit, reviewed project facts, and harness fleet status are eligible for encrypted metadata sync. Raw repository files remain local unless a premium hosted workspace is explicitly approved and acknowledges raw repository upload.
388
+
219
389
  The product moat is not a single model integration. It is trusted, portable, policy-aware memory that follows the work across tools.
220
390
 
221
- ## Publishing Beta
391
+ ## Publishing Release Candidates
222
392
 
223
- Publish beta builds with an npm dist tag instead of asking users to install from Git:
393
+ Publish release candidates with an npm dist tag instead of asking users to install from Git:
224
394
 
225
395
  ```bash
226
396
  npm --cache /tmp/suture-npm-cache pack --dry-run
227
397
  npm whoami
228
- npm publish --tag beta
398
+ npm publish --tag rc
229
399
  ```
230
400
 
231
- Keep the beta promise narrow and excellent: frictionless terminal setup, local-only privacy, safe project indexing, honest estimated savings, and structured evidence-backed substrate over generated markdown summaries.
401
+ Keep the `v0.2.0` promise narrow and excellent: frictionless terminal setup, local-only privacy, safe project indexing, honest estimated savings, and structured evidence-backed substrate over generated markdown summaries.
232
402
 
233
403
  Before publishing, run:
234
404