superlocalmemory 3.6.12 → 3.6.13

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to SuperLocalMemory V3 will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.6.13] - 2026-06-14 — Hotfix: MCP server failed to start after upgrade
9
+
10
+ ### Fixed
11
+
12
+ - **MCP server (`slm mcp`) failed to start in Claude Desktop / Cursor right after an upgrade** with errors like `Unexpected token 'S', "SuperLocal"... is not valid JSON`. The one-time post-upgrade banner (and the data-migration notice) were written to **stdout**, which corrupts the MCP stdio JSON-RPC stream on the first `slm mcp` launch after a version change. The banner now goes to **stderr** and is skipped entirely on the `slm mcp` path, so stdout carries only JSON-RPC. Added a regression test. (Anyone hit by this on 3.6.12: `pip install -U superlocalmemory` / `npm i -g superlocalmemory` then restart your MCP client.)
13
+
8
14
  ## [3.6.12] - 2026-06-14 — Distributed-ready + stability fixes
9
15
 
10
16
  Makes SuperLocalMemory work correctly across a LAN / distributed deployment (issues #39, #40) and fixes a set of stability and security defects. Default single-machine behavior is unchanged.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlocalmemory",
3
- "version": "3.6.12",
3
+ "version": "3.6.13",
4
4
  "description": "Information-geometric agent memory with mathematical guarantees. 4-channel retrieval, Fisher-Rao similarity, zero-LLM mode, EU AI Act compliant. Works with Claude, Cursor, Windsurf, and 17+ AI tools.",
5
5
  "keywords": [
6
6
  "ai-memory",
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "superlocalmemory"
3
- version = "3.6.12"
3
+ version = "3.6.13"
4
4
  description = "Information-geometric agent memory with mathematical guarantees"
5
5
  readme = "README.md"
6
6
  license = {text = "AGPL-3.0-or-later"}
@@ -79,33 +79,46 @@ def main() -> None:
79
79
  from superlocalmemory.cli.json_output import _get_version
80
80
  _ver = _get_version()
81
81
 
82
+ # v3.6.13 (CRITICAL): the `mcp` stdio transport requires stdout to carry
83
+ # ONLY JSON-RPC. The post-upgrade banner + migration notice below must NEVER
84
+ # run on that path, or the first post-upgrade `slm mcp` launch pollutes
85
+ # stdout and the MCP client (Claude Desktop / Cursor) rejects the stream as
86
+ # "not valid JSON". Skip the whole block for `mcp`; the next human `slm`
87
+ # command emits the banner (to stderr) and writes the version marker.
88
+ _is_mcp_stdio = len(sys.argv) >= 2 and sys.argv[1] == "mcp"
89
+
82
90
  # One-time post-upgrade banner — silent for fresh installs and
83
91
  # same-version runs. Guarded against I/O errors internally.
84
- from superlocalmemory.cli.version_banner import check_and_emit_upgrade_banner
85
- if check_and_emit_upgrade_banner(_ver):
86
- # First post-upgrade invocation: apply the data-dir migration if
87
- # it's safe. When the previous-version daemon is still running
88
- # we defer the next daemon start picks it up.
89
- try:
90
- import logging as _logging
91
- from pathlib import Path as _P
92
- from superlocalmemory.migrations.v3_4_25_to_v3_4_26 import (
93
- migrate_if_safe as _migrate_if_safe,
94
- )
95
- _data = _P(_os.environ.get("SLM_DATA_DIR")
96
- or _P.home() / ".superlocalmemory")
97
- _res = _migrate_if_safe(_data)
98
- if _res.get("status") == "deferred":
92
+ if not _is_mcp_stdio:
93
+ from superlocalmemory.cli.version_banner import check_and_emit_upgrade_banner
94
+ if check_and_emit_upgrade_banner(_ver):
95
+ # First post-upgrade invocation: apply the data-dir migration if
96
+ # it's safe. When the previous-version daemon is still running
97
+ # we defer — the next daemon start picks it up.
98
+ try:
99
+ import logging as _logging
100
+ from pathlib import Path as _P
101
+ from superlocalmemory.migrations.v3_4_25_to_v3_4_26 import (
102
+ migrate_if_safe as _migrate_if_safe,
103
+ )
104
+ _data = _P(_os.environ.get("SLM_DATA_DIR")
105
+ or _P.home() / ".superlocalmemory")
106
+ _res = _migrate_if_safe(_data)
107
+ if _res.get("status") == "deferred":
108
+ print(
109
+ " note: data migration deferred — the running SLM "
110
+ "daemon will apply it on its next restart.",
111
+ file=sys.stderr,
112
+ )
113
+ except Exception as _mig_exc:
114
+ import logging as _logging
115
+ _logging.getLogger(__name__).warning(
116
+ "v3.4.26 migrate_if_safe failed: %s — run `slm doctor`", _mig_exc,
117
+ )
99
118
  print(
100
- " note: data migration deferredthe running SLM "
101
- "daemon will apply it on its next restart."
119
+ " note: data migration check failed run `slm doctor` to diagnose.",
120
+ file=sys.stderr,
102
121
  )
103
- except Exception as _mig_exc:
104
- import logging as _logging
105
- _logging.getLogger(__name__).warning(
106
- "v3.4.26 migrate_if_safe failed: %s — run `slm doctor`", _mig_exc,
107
- )
108
- print(" note: data migration check failed — run `slm doctor` to diagnose.")
109
122
 
110
123
  parser = argparse.ArgumentParser(
111
124
  prog="slm",
@@ -167,8 +167,12 @@ def check_and_emit_upgrade_banner(current: str) -> bool:
167
167
  if read_marker_version() == current:
168
168
  return False
169
169
 
170
- sys.stdout.write(_banner(prior, current))
171
- sys.stdout.flush()
170
+ # v3.6.13 (CRITICAL): write to STDERR, never stdout. On the `slm mcp`
171
+ # stdio transport, ANY stdout byte that isn't JSON-RPC corrupts the
172
+ # stream and the MCP client (e.g. Claude Desktop) rejects every
173
+ # message as "not valid JSON". The banner is a human notice → stderr.
174
+ sys.stderr.write(_banner(prior, current))
175
+ sys.stderr.flush()
172
176
  write_marker_version(current)
173
177
  return True
174
178
  finally:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: superlocalmemory
3
- Version: 3.6.12
3
+ Version: 3.6.13
4
4
  Summary: Information-geometric agent memory with mathematical guarantees
5
5
  Author-email: Varun Pratap Bhardwaj <admin@superlocalmemory.com>
6
6
  License: AGPL-3.0-or-later