memoryintelligence-mcp 0.2.5__tar.gz → 0.2.8__tar.gz

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.

Potentially problematic release.


This version of memoryintelligence-mcp might be problematic. Click here for more details.

Files changed (23) hide show
  1. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/CHANGELOG.md +131 -0
  2. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/PKG-INFO +51 -7
  3. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/README.md +50 -6
  4. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/pyproject.toml +1 -1
  5. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/__init__.py +1 -1
  6. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/cli.py +174 -14
  7. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/client.py +87 -6
  8. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/config.py +2 -2
  9. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/server.py +355 -17
  10. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/.gitignore +0 -0
  11. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/CONTRIBUTING.md +0 -0
  12. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/LICENSE +0 -0
  13. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/__main__.py +0 -0
  14. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/embedder.py +0 -0
  15. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/indexer.py +0 -0
  16. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/keys.py +0 -0
  17. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/local_index.py +0 -0
  18. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/localreads.py +0 -0
  19. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/paths.py +0 -0
  20. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/recall_guard.py +0 -0
  21. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/scrub.py +0 -0
  22. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/umo_format.py +0 -0
  23. {memoryintelligence_mcp-0.2.5 → memoryintelligence_mcp-0.2.8}/src/mi_mcp/vault.py +0 -0
@@ -3,6 +3,137 @@
3
3
  All notable changes to `memoryintelligence-mcp` are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/); this project uses [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [0.2.8] — 2026-08-04
7
+
8
+ ### Added — `mi-mcp doctor` tells you when you're behind
9
+ Doctor reported the binary, PATH, wrapper, key, allowlist, vault and wiring — and
10
+ not one word about **which version it was running**. So the most common way to be
11
+ broken was invisible: a user on 0.2.5 asking why the workspace tools "don't exist",
12
+ when they exist fine and the install is two releases old.
13
+
14
+ Doctor now checks PyPI and reports as its **first** line:
15
+
16
+ ```
17
+ [✗] version 0.2.5 installed, 0.2.8 available — `uv tool upgrade memoryintelligence-mcp && mi-mcp wire`
18
+ ```
19
+
20
+ Details that matter:
21
+
22
+ - **The upgrade command matches how you actually installed it** — `uv tool` /
23
+ `pipx` / `pip`, detected from the interpreter's location. Suggesting `pip` to a
24
+ uv-tool user is a dead end; on a Homebrew Python, `pip` may not exist at all
25
+ and is PEP-668 externally-managed regardless.
26
+ - **`mi-mcp wire` is in the suggestion on purpose.** Upgrading across 0.2.6 without
27
+ re-wiring leaves your config pointing at a server id that no longer announces
28
+ itself, and the tools silently disappear.
29
+ - **Out of date never fails doctor's exit code** — behind is not broken, and scripts
30
+ that gate on `mi-mcp doctor` must not start failing the day a release lands.
31
+ - **Unreachable PyPI reports "latest unknown", never "up to date".** Offline is not
32
+ evidence of being current.
33
+ - **Opt out** with `--no-version-check` or `MI_MCP_NO_VERSION_CHECK=1`. Then **no
34
+ request is made at all** — not a request whose answer is ignored. The check is an
35
+ anonymous PyPI index fetch, the same one any install performs.
36
+
37
+ It reads the **simple index** (PEP 691), not `/pypi/<project>/json`. The aggregate
38
+ endpoint is CDN-cached and was observed serving a stale version for minutes after
39
+ 0.2.7 published — a doctor reading it would confidently tell a user they were
40
+ current when they were two releases behind, which is precisely the bug this check
41
+ exists to prevent.
42
+
43
+ ## [0.2.7] — 2026-08-03
44
+
45
+ ### Added — `mi_ask` / `mi_list` take a `workspace_id` (#385 UC2)
46
+ Symmetric with `mi_capture` (one mental model: *omit = personal, pass an id = that
47
+ workspace*). Omit it and the read is personal, byte-for-byte as before — no wrapper,
48
+ no extra key, no extra round-trip. Pass a workspace you belong to and the read is
49
+ scoped to it; a workspace you do **not** belong to is refused rather than silently
50
+ downgraded to personal, so the scope a result reports is never a lie.
51
+
52
+ Two things specific to this surface:
53
+
54
+ - **A workspace read never comes from the on-device index.** `MI_MCP_LOCAL=1`
55
+ serves reads locally, and the local index has no workspace concept — answering
56
+ from it would return personal memories under a workspace label. A workspace
57
+ target forces the cloud path, the same way advanced filters already do.
58
+ - **The result says whether other members' memories are actually included.**
59
+ Server-side workspace read-isolation (`MI_WORKSPACE_READ_ISOLATION`) is **off by
60
+ default**, and with it off a member-targeted read returns exactly what a personal
61
+ read returns. The scope block therefore carries `member_wide_reads`
62
+ (`true` / `false` / `"unknown"`), read from the server's own `/health`
63
+ capabilities and cached per process. When it is not `true` on a multi-member
64
+ workspace the block also carries a `note` telling the agent not to claim it
65
+ searched the whole team. **Without this, `shared: true, member_count: 4` on an
66
+ owner-scoped read is an overclaim waiting to be repeated to a user.**
67
+
68
+ Requires an API server new enough to advertise
69
+ `capabilities.workspace_read_isolation` in `/health`; older servers report
70
+ `"unknown"` rather than a guess. The remote MCP surface reports the same field
71
+ (read directly from the flag, since it runs inside the API process), so both
72
+ surfaces describe a workspace read the same way.
73
+
74
+ ### Added — `mi_capture(workspace_id=…)` — workspace routing actually works (#385 UC1)
75
+ Routing a capture to a specific workspace was **documented as shipped and was not
76
+ implemented on this surface**. The backend has honored it since #736/#385 and the
77
+ REMOTE MCP sends it — but the local package had no way to *express* a target:
78
+ `mi_capture` had no `workspace_id` argument and `MIClient.capture()` sent no
79
+ routing header. `mi_workspaces` (added in 0.2.6) listed workspaces the tools then
80
+ could not capture into, and its description told agents to pass the workspace ULID
81
+ as `scope_id`, which routes nothing (`scope`/`scope_id` is the separate governance-scope
82
+ axis, sent in the request body). Now:
83
+
84
+ - **`mi_capture(content, workspace_id?, confirm?)`** routes the capture. Omit
85
+ `workspace_id` and the capture goes to your home workspace exactly as before —
86
+ personal is still the default, and an untargeted capture costs no extra API call.
87
+ - **A shared-workspace write is gated.** Targeting a workspace with more than one
88
+ member without `confirm=true` returns `{"status": "confirm_required", …}` and
89
+ **saves nothing** — a single silent call can never post a memory into a team
90
+ space. Solo and personal captures need no confirm.
91
+ - **Every routed capture names where it landed** — the response carries
92
+ `destination: {workspace_id, name, role, shared, member_count}`.
93
+ - **A workspace you are not a member of is refused, not silently downgraded** to
94
+ personal, so a reported destination is never a lie. Authorization itself stays
95
+ server-side; this mirrors it so the feedback is accurate.
96
+
97
+ This matches the remote surface's contract (`mi_capture` there already took
98
+ `workspace_id` + `confirm`), so both MCP surfaces now route captures identically.
99
+
100
+ Note on the wire: the target is sent as a **header**, and the API has two names for
101
+ it depending on the auth plane — `X-MI-Workspace` (API-key plane, which this package
102
+ uses) and `X-Workspace-Id` (JWT plane, what the remote sends). The client sends both,
103
+ so routing is correct on either plane.
104
+
105
+ ## [0.2.6] — 2026-08-03
106
+
107
+ ### Changed — the local server is now named `mi-local` (#1320)
108
+ The local stdio server announced itself as `Server("memoryintelligence")` and
109
+ `mi-mcp setup`/`wire` registered it under the config key `memoryintelligence` —
110
+ while the REMOTE MCP surface (`api.memoryintelligence.io/v1/mcp`) announces
111
+ `memoryintelligence-remote` but is typically added to claude.ai/Desktop under
112
+ the display name "memoryintelligence". On any client hosting both, the two
113
+ surfaces were indistinguishable and tool calls silently resolved to the wrong
114
+ one: during a 2026-08-02 debug, the local server's tools masqueraded as the
115
+ remote's, and `mi_workspaces` "didn't exist" because the remote was never
116
+ called. The local server now announces `mi-local` and wires under that key.
117
+
118
+ **Migration is automatic and guarded**: re-running `mi-mcp setup` or
119
+ `mi-mcp wire` renames an existing `memoryintelligence` (or pre-0.1.8
120
+ `memory-intelligence`) config entry to `mi-local` — but ONLY when that entry
121
+ points at the mi-mcp launcher (`run-mi-mcp.sh`, `python -m mi_mcp`, or the
122
+ `mi-mcp` binary). An identically-named entry pointing anywhere else is left
123
+ untouched. `mi-mcp doctor` detects a pending rename and tells you to run
124
+ `mi-mcp wire`. Idempotent — re-running is always safe.
125
+
126
+ Which server am I talking to? The local announces `mi-local` (7 tools by
127
+ default, 11 with `MI_MCP_FULL=1`); the remote announces
128
+ `memoryintelligence-remote` (4 tools).
129
+
130
+ ### Added — `mi_workspaces` (tool-surface parity with the remote, #1320)
131
+ The remote surface added `mi_workspaces` for workspace routing; the local
132
+ package now has it too, in the default surface: lists the workspaces you can
133
+ capture into (id, name, your role, member count) via `GET /v1/workspaces` —
134
+ the same endpoint the remote calls, so "does mi_workspaces exist" answers the
135
+ same on both surfaces. Default surface is now 7 tools; the full surface is 11.
136
+
6
137
  ## [0.2.5] — 2026-07-24
7
138
 
8
139
  ### Fixed — capture now works on Claude Desktop / claude.ai connector / Cowork
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memoryintelligence-mcp
3
- Version: 0.2.5
3
+ Version: 0.2.8
4
4
  Summary: MCP server for MemoryIntelligence — give Claude a memory you own, set up in one command
5
5
  Project-URL: Homepage, https://memoryintelligence.io
6
6
  Project-URL: Repository, https://github.com/somewhere11/memoryintelligence-mcp
@@ -86,10 +86,37 @@ And four things that make it more than a notepad:
86
86
  - **Owned** — memories are portable structured objects in *your* account, not locked in a model.
87
87
  - **Private** — capture is opt-in per project; PII is redacted from what the agent sees.
88
88
 
89
- > Set `MI_MCP_FULL=1` for the full surface (`mi_upload`, `mi_verify`, `mi_forget`,
89
+ > The default surface is 7 tools (also `mi_upload`, `mi_verify`, `mi_forget`,
90
+ > `mi_workspaces`). Set `MI_MCP_FULL=1` for the full 11-tool surface (adds
90
91
  > `mi_batch`, `mi_explain`, `mi_match`, `mi_account`). Tools outside the active
91
92
  > surface are rejected at the call boundary, not just hidden.
92
93
 
94
+ ### Capturing into a shared workspace
95
+
96
+ By default every capture is **personal** — it lands in your home workspace and
97
+ nobody else sees it. To put one in a team space, name it:
98
+
99
+ > *"List my workspaces."* → `mi_workspaces`
100
+ > *"Save that to Somewhere Inc."* → `mi_capture(workspace_id=…)`
101
+
102
+ Two rules keep a shared space from filling up by accident:
103
+
104
+ - **A workspace with more than one member needs an explicit confirm.** The first
105
+ call returns a preview — *"this posts to Somewhere Inc, visible to 4 members"* —
106
+ and **saves nothing**. Only after you say yes does the agent re-call with
107
+ `confirm=true`. A fresh chat can't inherit that approval.
108
+ - **Every capture tells you where it went**, and a workspace you don't belong to is
109
+ refused rather than quietly saved somewhere else.
110
+
111
+ Reading works the same way — `mi_ask` and `mi_list` take the same `workspace_id`:
112
+
113
+ > *"What did the team decide about billing?"* → `mi_ask(workspace_id=…)`
114
+
115
+ Omit it and you search your own memories. One caveat worth knowing: whether a
116
+ workspace read returns *other members'* memories is a server-side setting that is
117
+ **off by default**. The result's `scope` block reports `member_wide_reads` so the
118
+ assistant can tell you what it actually searched instead of assuming.
119
+
93
120
  ## How it works
94
121
 
95
122
  ```
@@ -132,7 +159,7 @@ and never leaves your machine except to authenticate.
132
159
  redacts PII from what the agent sees (your own portal shows it raw).
133
160
  - **stdio only — no open port.** Runs as a local subprocess; networked transports are
134
161
  disabled in this version (they return with OAuth 2.1 + TLS later).
135
- - **Off switch.** Clear `opt-in-paths`, or remove the `memoryintelligence` entry from
162
+ - **Off switch.** Clear `opt-in-paths`, or remove the `mi-local` entry from
136
163
  your config to fully unwire.
137
164
 
138
165
  Found a vulnerability? [SECURITY.md](SECURITY.md) — report privately to connect@somewheremedia.com.
@@ -147,7 +174,7 @@ Found a vulnerability? [SECURITY.md](SECURITY.md) — report privately to connec
147
174
  |----------|---------|-------------|
148
175
  | `MI_API_KEY` | — | Resolved by the launcher from Keychain / keyfile — don't set inline in configs |
149
176
  | `MI_BASE_URL` | `https://api.memoryintelligence.io` | API base URL |
150
- | `MI_MCP_FULL` | _(off)_ | `1` exposes all 10 tools; otherwise the 3 core |
177
+ | `MI_MCP_FULL` | _(off)_ | `1` exposes all 11 tools; otherwise the 7-tool default surface |
151
178
  | `MI_VAULT` | `~/Somewhere` (set by `wire`) | Local `.umo` vault — `wire`/`setup` point it at `~/Somewhere` so it's shared with the MemorySpace Desktop app. Unwired fallback is `~/MemoryIntelligence`; an explicit value here always wins. |
152
179
  | `MI_DEFAULT_SCOPE` · `MI_DEFAULT_RETENTION` · `MI_DEFAULT_PII_HANDLING` | `user` · `meaning_only` · `extract_and_redact` | Governance defaults |
153
180
 
@@ -158,7 +185,7 @@ Found a vulnerability? [SECURITY.md](SECURITY.md) — report privately to connec
158
185
  | `MemoryIntelligence` | the brand |
159
186
  | `memoryintelligence-mcp` | the PyPI package (`pip install`) |
160
187
  | `mi-mcp` | the command you run (`mi-mcp setup`) |
161
- | `memoryintelligence` | the server id in your MCP config |
188
+ | `mi-local` | the server id in your MCP config — distinct from the REMOTE MCP surface, which announces `memoryintelligence-remote` (#1320). `memoryintelligence` (≤0.2.5) is legacy; `mi-mcp wire` renames it |
162
189
  | `MI_*` | env vars / Keychain service |
163
190
 
164
191
  **On disk** — one namespace:
@@ -195,10 +222,27 @@ Never paste the key into an MCP client config.
195
222
 
196
223
  **Repair / inspect without re-running setup:**
197
224
  ```bash
198
- mi-mcp doctor # checks binary, PATH, key, wiring, opt-in, vault path
225
+ mi-mcp doctor # checks version, binary, PATH, key, wiring, opt-in, vault path
199
226
  mi-mcp status # wired surfaces + opt-in allowlist
200
227
  mi-mcp wire --dry-run # preview wiring changes
201
228
  ```
229
+
230
+ **Staying current.** `doctor` compares your installed version against PyPI and
231
+ prints the upgrade command for how you actually installed it:
232
+
233
+ ```
234
+ [✗] version 0.2.5 installed, 0.2.8 available — `uv tool upgrade memoryintelligence-mcp && mi-mcp wire`
235
+ ```
236
+
237
+ Run `mi-mcp wire` after any upgrade — 0.2.6 renamed the server, and a config left
238
+ pointing at the old id loses its tools silently. The check is an anonymous PyPI
239
+ index fetch; skip it entirely with `--no-version-check` or
240
+ `MI_MCP_NO_VERSION_CHECK=1`, and it fails quietly when you're offline.
241
+
242
+ **Which server am I talking to?** The local server announces `mi-local`; the
243
+ remote MCP surface announces `memoryintelligence-remote`. The local default
244
+ surface is 7 tools; the remote is 4 — if the tool list doesn't match what you
245
+ expect, the client resolved the other surface (#1320).
202
246
  </details>
203
247
 
204
248
  <details>
@@ -209,7 +253,7 @@ VS Code / Copilot read a different config than Claude: servers live under `"serv
209
253
  it, or add per-workspace `.vscode/mcp.json`:
210
254
 
211
255
  ```json
212
- { "servers": { "memoryintelligence": { "type": "stdio", "command": "mi-mcp" } } }
256
+ { "servers": { "mi-local": { "type": "stdio", "command": "mi-mcp" } } }
213
257
  ```
214
258
 
215
259
  Then open Copilot Chat in **Agent** mode — the memory tools only appear there.
@@ -47,10 +47,37 @@ And four things that make it more than a notepad:
47
47
  - **Owned** — memories are portable structured objects in *your* account, not locked in a model.
48
48
  - **Private** — capture is opt-in per project; PII is redacted from what the agent sees.
49
49
 
50
- > Set `MI_MCP_FULL=1` for the full surface (`mi_upload`, `mi_verify`, `mi_forget`,
50
+ > The default surface is 7 tools (also `mi_upload`, `mi_verify`, `mi_forget`,
51
+ > `mi_workspaces`). Set `MI_MCP_FULL=1` for the full 11-tool surface (adds
51
52
  > `mi_batch`, `mi_explain`, `mi_match`, `mi_account`). Tools outside the active
52
53
  > surface are rejected at the call boundary, not just hidden.
53
54
 
55
+ ### Capturing into a shared workspace
56
+
57
+ By default every capture is **personal** — it lands in your home workspace and
58
+ nobody else sees it. To put one in a team space, name it:
59
+
60
+ > *"List my workspaces."* → `mi_workspaces`
61
+ > *"Save that to Somewhere Inc."* → `mi_capture(workspace_id=…)`
62
+
63
+ Two rules keep a shared space from filling up by accident:
64
+
65
+ - **A workspace with more than one member needs an explicit confirm.** The first
66
+ call returns a preview — *"this posts to Somewhere Inc, visible to 4 members"* —
67
+ and **saves nothing**. Only after you say yes does the agent re-call with
68
+ `confirm=true`. A fresh chat can't inherit that approval.
69
+ - **Every capture tells you where it went**, and a workspace you don't belong to is
70
+ refused rather than quietly saved somewhere else.
71
+
72
+ Reading works the same way — `mi_ask` and `mi_list` take the same `workspace_id`:
73
+
74
+ > *"What did the team decide about billing?"* → `mi_ask(workspace_id=…)`
75
+
76
+ Omit it and you search your own memories. One caveat worth knowing: whether a
77
+ workspace read returns *other members'* memories is a server-side setting that is
78
+ **off by default**. The result's `scope` block reports `member_wide_reads` so the
79
+ assistant can tell you what it actually searched instead of assuming.
80
+
54
81
  ## How it works
55
82
 
56
83
  ```
@@ -93,7 +120,7 @@ and never leaves your machine except to authenticate.
93
120
  redacts PII from what the agent sees (your own portal shows it raw).
94
121
  - **stdio only — no open port.** Runs as a local subprocess; networked transports are
95
122
  disabled in this version (they return with OAuth 2.1 + TLS later).
96
- - **Off switch.** Clear `opt-in-paths`, or remove the `memoryintelligence` entry from
123
+ - **Off switch.** Clear `opt-in-paths`, or remove the `mi-local` entry from
97
124
  your config to fully unwire.
98
125
 
99
126
  Found a vulnerability? [SECURITY.md](SECURITY.md) — report privately to connect@somewheremedia.com.
@@ -108,7 +135,7 @@ Found a vulnerability? [SECURITY.md](SECURITY.md) — report privately to connec
108
135
  |----------|---------|-------------|
109
136
  | `MI_API_KEY` | — | Resolved by the launcher from Keychain / keyfile — don't set inline in configs |
110
137
  | `MI_BASE_URL` | `https://api.memoryintelligence.io` | API base URL |
111
- | `MI_MCP_FULL` | _(off)_ | `1` exposes all 10 tools; otherwise the 3 core |
138
+ | `MI_MCP_FULL` | _(off)_ | `1` exposes all 11 tools; otherwise the 7-tool default surface |
112
139
  | `MI_VAULT` | `~/Somewhere` (set by `wire`) | Local `.umo` vault — `wire`/`setup` point it at `~/Somewhere` so it's shared with the MemorySpace Desktop app. Unwired fallback is `~/MemoryIntelligence`; an explicit value here always wins. |
113
140
  | `MI_DEFAULT_SCOPE` · `MI_DEFAULT_RETENTION` · `MI_DEFAULT_PII_HANDLING` | `user` · `meaning_only` · `extract_and_redact` | Governance defaults |
114
141
 
@@ -119,7 +146,7 @@ Found a vulnerability? [SECURITY.md](SECURITY.md) — report privately to connec
119
146
  | `MemoryIntelligence` | the brand |
120
147
  | `memoryintelligence-mcp` | the PyPI package (`pip install`) |
121
148
  | `mi-mcp` | the command you run (`mi-mcp setup`) |
122
- | `memoryintelligence` | the server id in your MCP config |
149
+ | `mi-local` | the server id in your MCP config — distinct from the REMOTE MCP surface, which announces `memoryintelligence-remote` (#1320). `memoryintelligence` (≤0.2.5) is legacy; `mi-mcp wire` renames it |
123
150
  | `MI_*` | env vars / Keychain service |
124
151
 
125
152
  **On disk** — one namespace:
@@ -156,10 +183,27 @@ Never paste the key into an MCP client config.
156
183
 
157
184
  **Repair / inspect without re-running setup:**
158
185
  ```bash
159
- mi-mcp doctor # checks binary, PATH, key, wiring, opt-in, vault path
186
+ mi-mcp doctor # checks version, binary, PATH, key, wiring, opt-in, vault path
160
187
  mi-mcp status # wired surfaces + opt-in allowlist
161
188
  mi-mcp wire --dry-run # preview wiring changes
162
189
  ```
190
+
191
+ **Staying current.** `doctor` compares your installed version against PyPI and
192
+ prints the upgrade command for how you actually installed it:
193
+
194
+ ```
195
+ [✗] version 0.2.5 installed, 0.2.8 available — `uv tool upgrade memoryintelligence-mcp && mi-mcp wire`
196
+ ```
197
+
198
+ Run `mi-mcp wire` after any upgrade — 0.2.6 renamed the server, and a config left
199
+ pointing at the old id loses its tools silently. The check is an anonymous PyPI
200
+ index fetch; skip it entirely with `--no-version-check` or
201
+ `MI_MCP_NO_VERSION_CHECK=1`, and it fails quietly when you're offline.
202
+
203
+ **Which server am I talking to?** The local server announces `mi-local`; the
204
+ remote MCP surface announces `memoryintelligence-remote`. The local default
205
+ surface is 7 tools; the remote is 4 — if the tool list doesn't match what you
206
+ expect, the client resolved the other surface (#1320).
163
207
  </details>
164
208
 
165
209
  <details>
@@ -170,7 +214,7 @@ VS Code / Copilot read a different config than Claude: servers live under `"serv
170
214
  it, or add per-workspace `.vscode/mcp.json`:
171
215
 
172
216
  ```json
173
- { "servers": { "memoryintelligence": { "type": "stdio", "command": "mi-mcp" } } }
217
+ { "servers": { "mi-local": { "type": "stdio", "command": "mi-mcp" } } }
174
218
  ```
175
219
 
176
220
  Then open Copilot Chat in **Agent** mode — the memory tools only appear there.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "memoryintelligence-mcp"
7
- version = "0.2.5"
7
+ version = "0.2.8"
8
8
  description = "MCP server for MemoryIntelligence — give Claude a memory you own, set up in one command"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -1,3 +1,3 @@
1
1
  """MI MCP Server — MemoryIntelligence tools for Claude."""
2
2
 
3
- __version__ = "0.2.5"
3
+ __version__ = "0.2.8"
@@ -41,11 +41,39 @@ from pathlib import Path
41
41
  from . import __version__, paths
42
42
  from .config import load_opt_in_paths
43
43
 
44
- SERVER_KEY = "memoryintelligence"
45
- # Pre-0.1.8 server ids we replace on wire so an upgrade leaves no orphaned entry.
46
- # (0.1.7 and earlier registered the server as "memory-intelligence" — the one
47
- # dash-seam that didn't match the brand/package "memoryintelligence".)
48
- LEGACY_SERVER_KEYS = ("memory-intelligence",)
44
+ # "mi-local" (#1320): the local stdio server's config id. It was
45
+ # "memoryintelligence" through 0.2.5, which collided with the REMOTE MCP surface
46
+ # (announced "memoryintelligence-remote" but added to claude.ai/Desktop under the
47
+ # display name "memoryintelligence") — on a client hosting both, the two were
48
+ # indistinguishable and tool calls silently resolved to the wrong surface.
49
+ SERVER_KEY = "mi-local"
50
+ # Older server ids we migrate on wire so an upgrade leaves no orphaned entry:
51
+ # "memoryintelligence" — 0.1.8 … 0.2.5 (renamed to "mi-local" in 0.2.6, #1320)
52
+ # "memory-intelligence" — 0.1.7 and earlier
53
+ # Migration is GUARDED: an entry under a legacy id is only removed/renamed when it
54
+ # actually points at the mi-mcp launcher (see _is_mi_launcher_entry) — an entry a
55
+ # user pointed elsewhere (e.g. a remote connector they named "memoryintelligence")
56
+ # is never touched.
57
+ LEGACY_SERVER_KEYS = ("memoryintelligence", "memory-intelligence")
58
+
59
+
60
+ def _is_mi_launcher_entry(entry: object) -> bool:
61
+ """True when a client-config server entry points at OUR launcher.
62
+
63
+ Recognizes every shape mi-mcp has ever written: the run-mi-mcp.sh wrapper
64
+ (Code/Cursor/VS Code), the sandbox-safe ``python -m mi_mcp`` Desktop entry,
65
+ and a bare ``mi-mcp`` binary path. Anything else is not ours to migrate.
66
+ """
67
+ if not isinstance(entry, dict):
68
+ return False
69
+ blob = " ".join(
70
+ [str(entry.get("command", "")), *(str(a) for a in (entry.get("args") or []))]
71
+ )
72
+ return (
73
+ "run-mi-mcp" in blob
74
+ or "mi_mcp" in blob
75
+ or blob.rstrip().endswith("mi-mcp")
76
+ )
49
77
 
50
78
  # Wrapper rendered by `wire`. __MI_MCP_BIN__ is replaced with the absolute path
51
79
  # to the mi-mcp binary (resolved at wire time) so the host can spawn it even
@@ -187,9 +215,18 @@ def _wire_code_via_cli(home: Path, wrapper: Path, dry_run: bool) -> bool:
187
215
  print(f" would run: {' '.join(add_cmd)}")
188
216
  return True
189
217
  # idempotent + migrate: drop any existing entry — current id AND the legacy
190
- # pre-0.1.8 ids — before re-adding, so an upgrade leaves no orphan.
191
- for key in (SERVER_KEY, *LEGACY_SERVER_KEYS):
192
- subprocess.run([claude, "mcp", "remove", key], capture_output=True, text=True)
218
+ # ids — before re-adding, so an upgrade leaves no orphan. Legacy ids are only
219
+ # removed when `claude mcp get` shows they point at OUR launcher (#1320): a
220
+ # server the user registered under "memoryintelligence" that isn't mi-mcp
221
+ # (e.g. the remote connector) must not be deleted out from under them.
222
+ subprocess.run([claude, "mcp", "remove", SERVER_KEY], capture_output=True, text=True)
223
+ for key in LEGACY_SERVER_KEYS:
224
+ g = subprocess.run([claude, "mcp", "get", key], capture_output=True, text=True)
225
+ blob = (g.stdout or "") + (g.stderr or "")
226
+ # "mi-mcp" also matches the wrapper's "run-mi-mcp.sh".
227
+ if g.returncode == 0 and ("mi-mcp" in blob or "mi_mcp" in blob):
228
+ subprocess.run([claude, "mcp", "remove", key], capture_output=True, text=True)
229
+ print(f" migrated legacy id {key} → {SERVER_KEY}")
193
230
  r = subprocess.run(add_cmd, capture_output=True, text=True)
194
231
  if r.returncode != 0:
195
232
  print(f" ! claude mcp add failed ({r.stderr.strip()[:160]}); falling back to file")
@@ -303,17 +340,39 @@ def do_wire(home: Path, surfaces: list[str], dry_run: bool,
303
340
  cfg_key = _surface_key(s)
304
341
  cfg = _load_json(cfg_path)
305
342
  servers = cfg.setdefault(cfg_key, {})
306
- # Migrate: drop any pre-0.1.8 id (e.g. "memory-intelligence") so the
307
- # rename to "memoryintelligence" doesn't leave a duplicate/orphan entry.
308
- migrated = [k for k in LEGACY_SERVER_KEYS if servers.pop(k, None) is not None]
343
+ # Migrate: drop any legacy id ("memoryintelligence" ≤0.2.5, or the
344
+ # pre-0.1.8 "memory-intelligence") so the rename to "mi-local" (#1320)
345
+ # doesn't leave a duplicate/orphan entry. GUARDED: only entries that
346
+ # point at the mi-mcp launcher are ours to migrate — a legacy-named
347
+ # entry the user pointed elsewhere is left exactly as it is.
348
+ migrated, foreign = [], []
349
+ # Keep the first migrated entry's contents: a ≤0.2.5 user's overrides
350
+ # (MI_VAULT, MI_MCP_OPT_IN_ALL) live under the LEGACY key, and the
351
+ # desktop branch below reads `prior` to preserve exactly those. Popping
352
+ # without remembering silently reset them on upgrade (Copilot, #1326).
353
+ legacy_prior = None
354
+ for k in LEGACY_SERVER_KEYS:
355
+ if k not in servers:
356
+ continue
357
+ if _is_mi_launcher_entry(servers[k]):
358
+ popped = servers.pop(k)
359
+ if legacy_prior is None:
360
+ legacy_prior = popped
361
+ migrated.append(k)
362
+ else:
363
+ foreign.append(k)
309
364
  if migrated:
310
365
  print(f" {s:8} migrated id {', '.join(migrated)} → {SERVER_KEY}")
366
+ if foreign:
367
+ print(f" {s:8} left {', '.join(foreign)} untouched — not an mi-mcp launcher entry")
311
368
  # Build this surface's entry. capture_anywhere is tri-state: True enables,
312
369
  # False disables, None preserves the current setting (so a plain re-wire
313
370
  # never silently flips a capture choice the user made).
314
371
  env: dict[str, str] = {}
315
372
  if s == "desktop":
316
- prior = servers.get(SERVER_KEY)
373
+ # A mi-local entry wins; else the legacy entry we just migrated —
374
+ # so a ≤0.2.5 upgrade carries its env forward instead of resetting it.
375
+ prior = servers.get(SERVER_KEY) or legacy_prior
317
376
  prior_env = prior.get("env") if isinstance(prior, dict) else None
318
377
  # D7: point the local .umo vault at the MemorySpace Desktop vault (~/Somewhere) so
319
378
  # both surfaces resolve ONE vault. The shell wrapper used to set this at launch;
@@ -393,9 +452,75 @@ def cmd_wire(argv: list[str]) -> int:
393
452
  return 0
394
453
 
395
454
 
455
+ #: PyPI project name — the package this CLI ships as.
456
+ PYPI_PROJECT = "memoryintelligence-mcp"
457
+
458
+ #: Set truthy to skip doctor's release check entirely (no network call at all).
459
+ NO_VERSION_CHECK_ENV = "MI_MCP_NO_VERSION_CHECK"
460
+
461
+
462
+ def _version_tuple(v: str) -> tuple:
463
+ """`"0.2.10"` → `(0, 2, 10)` for ordering. Non-numeric parts sort as -1.
464
+
465
+ Deliberately not `packaging.version` — it is not a declared dependency, and a
466
+ doctor check must never be the thing that fails to import.
467
+ """
468
+ parts: list = []
469
+ for chunk in (v or "").strip().split("."):
470
+ digits = "".join(c for c in chunk if c.isdigit())
471
+ parts.append(int(digits) if digits else -1)
472
+ return tuple(parts)
473
+
474
+
475
+ def _latest_pypi_version(project: str = PYPI_PROJECT, timeout: float = 2.0) -> str | None:
476
+ """Newest version on PyPI, or None if it cannot be determined. Never raises.
477
+
478
+ Uses the **simple index** (PEP 691), NOT ``/pypi/<project>/json``. Learned the
479
+ hard way on 2026-08-04: minutes after 0.2.7 published, the aggregate JSON
480
+ endpoint was still serving a cached ``0.2.5`` while the simple index was already
481
+ correct. A doctor that reads the stale endpoint would tell a user they are
482
+ up to date when they are not — the exact failure this check exists to prevent.
483
+ """
484
+ import urllib.request
485
+
486
+ url = f"https://pypi.org/simple/{project}/"
487
+ req = urllib.request.Request(
488
+ url,
489
+ headers={
490
+ "Accept": "application/vnd.pypi.simple.v1+json",
491
+ "User-Agent": f"mi-mcp/{__version__}",
492
+ },
493
+ )
494
+ try:
495
+ with urllib.request.urlopen(req, timeout=timeout) as resp: # noqa: S310 (fixed https URL)
496
+ versions = json.loads(resp.read().decode("utf-8")).get("versions") or []
497
+ except Exception:
498
+ return None # offline, DNS, timeout, 5xx, schema change — all "unknown"
499
+ real = [v for v in versions if _version_tuple(v) != (-1,)]
500
+ return max(real, key=_version_tuple) if real else None
501
+
502
+
503
+ def _upgrade_command() -> str:
504
+ """The upgrade command for THIS install, not a generic guess.
505
+
506
+ `pip` is wrong for most installs of this package and is not even present on
507
+ some machines (Homebrew python is PEP-668 externally-managed), so guessing
508
+ costs the user a failed command and a detour. Detect from the interpreter's
509
+ location instead.
510
+ """
511
+ prefix = str(Path(sys.prefix).resolve())
512
+ if f"{os.sep}uv{os.sep}tools{os.sep}" in prefix + os.sep:
513
+ return f"uv tool upgrade {PYPI_PROJECT}"
514
+ if f"{os.sep}pipx{os.sep}venvs{os.sep}" in prefix + os.sep or os.environ.get("PIPX_HOME"):
515
+ return f"pipx upgrade {PYPI_PROJECT}"
516
+ return f"{Path(sys.executable).name} -m pip install --upgrade {PYPI_PROJECT}"
517
+
518
+
396
519
  def cmd_doctor(argv: list[str]) -> int:
397
520
  ap = argparse.ArgumentParser(prog="mi-mcp doctor")
398
521
  ap.add_argument("--home", default=os.environ.get("HOME"))
522
+ ap.add_argument("--no-version-check", action="store_true",
523
+ help="skip the PyPI release check (no network call)")
399
524
  args = ap.parse_args(argv)
400
525
  home = Path(args.home)
401
526
 
@@ -407,6 +532,31 @@ def cmd_doctor(argv: list[str]) -> int:
407
532
  ok = False
408
533
  print(f" [{'✓' if good else '✗'}] {label}" + (f" {detail}" if detail else ""))
409
534
 
535
+ # Release check FIRST — being two versions behind explains most "the tool
536
+ # doesn't have X" reports, and it is the one thing nothing else surfaces.
537
+ # Non-critical: out of date is not broken, so it never fails doctor's exit code.
538
+ # Opt out with --no-version-check or MI_MCP_NO_VERSION_CHECK=1; the call is an
539
+ # anonymous PyPI index fetch (same as any install) and is skipped entirely then.
540
+ skip_vc = args.no_version_check or os.environ.get(
541
+ NO_VERSION_CHECK_ENV, ""
542
+ ).strip().lower() in ("1", "true", "yes", "on")
543
+ if skip_vc:
544
+ check("version", True, f"{__version__} (release check skipped)", critical=False)
545
+ else:
546
+ latest = _latest_pypi_version()
547
+ if latest is None:
548
+ # Unknown is NOT "up to date" — say so rather than imply green.
549
+ check("version", True,
550
+ f"{__version__} installed — could not reach PyPI, latest unknown",
551
+ critical=False)
552
+ elif _version_tuple(latest) > _version_tuple(__version__):
553
+ check("version", False,
554
+ f"{__version__} installed, {latest} available — "
555
+ f"`{_upgrade_command()} && mi-mcp wire`",
556
+ critical=False)
557
+ else:
558
+ check("version", True, f"{__version__} (latest)", critical=False)
559
+
410
560
  bin_path = _mi_mcp_bin()
411
561
  check("mi-mcp binary", Path(bin_path).exists(), bin_path)
412
562
 
@@ -465,10 +615,20 @@ def cmd_doctor(argv: list[str]) -> int:
465
615
  for s, p in _surface_paths(home).items():
466
616
  servers = _load_json(p).get(_surface_key(s), {})
467
617
  wired = SERVER_KEY in servers
468
- legacy = [k for k in LEGACY_SERVER_KEYS if k in servers]
618
+ # #1320 migration detection: a legacy id ("memoryintelligence" ≤0.2.5,
619
+ # "memory-intelligence" ≤0.1.7) counts only when its entry actually points
620
+ # at the mi-mcp launcher — an identically-named entry the user pointed at
621
+ # something else (e.g. the remote connector) is not ours and is ignored.
622
+ legacy = [
623
+ k for k in LEGACY_SERVER_KEYS
624
+ if k in servers and _is_mi_launcher_entry(servers[k])
625
+ ]
469
626
  detail = str(p) if wired else "(not wired)"
470
627
  if legacy and not wired:
471
- detail = f"legacy id {', '.join(legacy)} present — run `mi-mcp wire` to migrate"
628
+ detail = (f"legacy id {', '.join(legacy)} points at the mi-mcp launcher — "
629
+ f"run `mi-mcp wire` to rename it to {SERVER_KEY} (#1320)")
630
+ elif legacy:
631
+ detail += f" (stale legacy id {', '.join(legacy)} also present — `mi-mcp wire` cleans it up)"
472
632
  check(f"{s} wired", wired, detail, critical=False)
473
633
 
474
634
  # #1135 — the escalated-user failure this check exists to catch in ONE