memgate-mcp 2026.11.21 → 2026.11.24

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/FEATURES.md ADDED
@@ -0,0 +1,81 @@
1
+ # MemGate / MemSteward — Feature Guide
2
+
3
+ Governed memory for LLM agents: the agent remembers, the memory stays clean, and everything is auditable. One kernel, four deployment shapes.
4
+
5
+ ## 1. Memory core (LandingStore)
6
+
7
+ - **Triple-signature entries** — every memory is an (object, action, actual) triple with kind/source metadata, so recall is structured, not fuzzy string matching.
8
+ - **Write path** — admission quality gate -> single-writer protocol -> hard persistence (JSON on disk, crash-safe, survives restart). No background rewrite of your data.
9
+ - **Read path** — **signature-gated recall** (query by object|action keys), hybrid semantic + BM25 retrieval, plus a liveness gate: cold entries are not injected into context, never silently deleted.
10
+ - **Timeline queries** — recall_recent(hours), recall_by_time(start, end), timeline() digest.
11
+ - **Embeddings** — pluggable local embedding backend with a KV cache (EmbedCache) so repeated queries cost nothing.
12
+
13
+ ## 2. Quality pipeline (why "governance-grade")
14
+
15
+ - **Admission gate** — echo fragments, ultra-short and junk writes are quarantined automatically before they ever land in the store.
16
+ - **Quarantine + verdicts** — suspicious entries are flagged, not deleted; verification criteria score outcomes.
17
+ - **Feedback loop** — good-mode feedback lands in LandingStore.feedback with revoke support.
18
+ - **Ledger** — every write is traceable through the governance ledger tool. Better to remember less than to remember wrong.
19
+
20
+ ## 3. Liveness decay (memories age)
21
+
22
+ - Entries carry a liveness value that decays over time (default decay factor 0.9, configurable floor).
23
+ - Older memories fade from recall automatically instead of piling up forever.
24
+ - hold(entry) keeps an entry alive (liveness = 1.0) when it matters.
25
+
26
+ ## 4. Governance tool surface (OpenClaw plugin)
27
+
28
+ Four tools out of the box: governance_preflight / governance_ledger / governance_deposit / governance_recall. Plus a Python bridge with 13 subcommands (deposit, recall, digest, ingest, commit, preflight, ledger, constraints, depscan, version, compact, restore, ping) usable from CLI, oneshot, or serve mode. The plugin wires two OpenClaw slots (memory + contextEngine) and ships a three-tier (hot/warm/cold) memory ingest.
29
+
30
+ ## 5. MCP tool surface (memgate-mcp)
31
+
32
+ One MCP server, any host: Claude Code, Cursor, Copilot Studio, Windsurf, Cline, Zed.
33
+
34
+ - memgate_deposit(obj, act, actual, kind, source) — store one governed memory
35
+ - memgate_recall(query, top_k) — signature/keyword recall with scores
36
+ - memgate_stats() — store statistics
37
+ - memgate_compact() — drop redundancy
38
+
39
+ Python >= 3.9, **zero third-party dependencies** (stdlib + shipped kernel). Config: one JSON block in your host config (see config/mcp-config-examples.md).
40
+
41
+ ## 6. Python SDK
42
+
43
+ from memsteward import Memory
44
+ mem = Memory('memory.json')
45
+ mem.deposit('player', 'mining', 'found diamond', kind='experience')
46
+ hits = mem.recall('mining', top_k=5)
47
+ mem.recall_recent(hours=24); mem.timeline(hours=24)
48
+ mem.decay(0.99) # liveness aging
49
+ mem.hold(entry_id) # keep alive
50
+ mem.quarantine(entry_id) # flag low quality
51
+
52
+ Advanced surface (MemStewardLocal): quarantine, distillation, concept space, panoramic/rolling planners, mechanism learner/advisor, zero-intrusion observation wrapper.
53
+
54
+ ## 7. Performance (measured)
55
+
56
+ | Metric | MemSteward | Mem0 | Zep | LangChain |
57
+ |---|---|---|---|---|
58
+ | write | **0.01ms** | 50ms | 100ms | 20ms |
59
+ | retrieve | **<1ms** | 200ms | 300ms | 100ms |
60
+ | quality gate | yes | no | no | no |
61
+ | liveness decay | yes | no | partial | no |
62
+ | fully local | yes | yes | no | partial |
63
+ | Chinese-native tokenizer | yes | partial | partial | partial |
64
+
65
+ ## 8. Privacy and security
66
+
67
+ - All data stays on your machine (MEMSTEWARD_HOME, default ~/.memsteward/). No cloud sync, no telemetry upload.
68
+ - Every write passes the quality gate; single-writer protocol prevents concurrent pollution.
69
+ - Contract first: out-of-contract writes stop for review instead of landing silently.
70
+
71
+ ## 9. Versions and compatibility
72
+
73
+ - Product family: CalVer (YYYY.MM.DD, one release line for all editions). SDK: SemVer (0.x = API may change; 1.0 freezes).
74
+ - VERSIONS.json binds plugin/sdk/bridge protocol/embedding fingerprint; verify with: python3 src/bridge_cli.py version
75
+ - OpenClaw pluginApi >= 2026.9.4; bridge protocol 3; Python >= 3.9.
76
+
77
+ ## 10. License
78
+
79
+ Elastic License 2.0 (SPDX: Elastic-2.0): free for internal and commercial use; do not offer the software itself as a hosted/managed service to third parties; patents licensed with the software (suit terminates); trademarks not licensed with the code. Patent boundaries: PATENTS.md.
80
+
81
+ Deeper documentation: each edition ships a MANUAL.md (promise list + verification contract), a HISTORY.md, and a MANIFEST.md (parts list). The local edition also ships a full capability index (CAPABILITY_INDEX.md).
package/HISTORY.md ADDED
@@ -0,0 +1,23 @@
1
+ # D-MCP Edition · History
2
+
3
+ - **Project opened 2026-11-21 22:40** (decision: "start, manage the platform well, no mess"): strategic call = MCP is the de-facto standard for AI coding platforms (Claude Code / Cursor / Copilot / Windsurf / Cline / Zed all covered); one MCP surface unlocks the whole ecosystem — more leverage than one plugin per host.
4
+ - Shape decision: join the **middleware family** (alongside A/B/C, family management), no separate stovepipe — reuse the family production/listing separation, VERSIONS binding, and registration gate.
5
+ - Implementation decision: **zero third-party dependencies**, hand-rolled MCP stdio (family self-sufficiency philosophy); kernel driven in-process (works offline); semantics mirror the B edition REST surface.
6
+ - 2026-11-21 23:0x smoke all green (handshake / four tools / error code -32601), see test/test_mcp.py.
7
+
8
+ ## Correction record (2026-11-21 22:5x, opened after the question "0.1.0 does not look right")
9
+
10
+ - **Original text**: VERSIONS.json / server version = 0.1.0
11
+ - **Root cause**: opening the project casually started a new semver line, violating the family versioning rule (VERSIONS-3tier.md, decided 2026-11-17: version format YYYY.MM.DD, three lines increment independently); the same day the A/B lines were already drifting (npm 0.2.x forced by re-release, GHCR 0.1.2 an ad-hoc in-tree number) — three lines, three eras = confirmed version drift
12
+ - **Current ruling**: the D edition first number = **2026.11.21** (family scheme, and legal semver for npm); **all lines standardize on YYYY.MM.DD going forward** — published npm 0.2.x / GHCR 0.1.2 are immutable; from the next release they rejoin the line
13
+ - **Impact**: all D management files (VERSIONS.json / mcp_server.py / manual) updated; A/B listing artifacts unchanged
14
+ - **Open items**: the B line next release uses 2026.11.x; the npm line next release likewise rejoins (the version jump is the drift zero point)
15
+ - **2026-11-22 listing package built**: 73 files + memgate-mcp-2026.11.21.tgz (350KB), smoke all green; added package.json + bin/memgate-mcp.js launcher; MANIFEST version corrected 0.1.0 -> 2026.11.21.
16
+
17
+ ## Correction record (2026-11-22)
18
+
19
+ - License statement corrected: the top-level LICENSE had mistakenly held old commercial-license text; that day it first rejoined the unified statement, then switched to Elastic License 2.0 per plan A (see next entry).
20
+
21
+ ## Correction record (2026-11-22)
22
+
23
+ - License switched again: everything under **Elastic License 2.0** (SPDX: Elastic-2.0) — standard terms, free internal and commercial use, no offering the software itself as a hosted/managed service to third parties, patents licensed with the software (suit terminates), trademarks not licensed with code. The previous Unified Statement v1.3 wording is retired.
package/MANUAL.md ADDED
@@ -0,0 +1,32 @@
1
+ # MemGate MCP (D-MCP Edition) Manual
2
+
3
+ **In one line**: connect governed memory (audited writes/reads, quality gates, statistical ledgers) to any MCP-capable AI platform — Claude Code, Cursor, Copilot Studio, Windsurf, Cline, Zed, one surface for all.
4
+
5
+ ## What it solves
6
+
7
+ AI assistants and coding agents keep scattered memories: cross-project pollution, no audit, fast forgetting. MemGate MCP provides **governed memory access**: every entry carries an object-action-content triple signature, passes the quality gate, and enters the statistical ledger.
8
+
9
+ ## Quick start
10
+
11
+ # 1. smoke self-test (should print SMOKE ALL GREEN)
12
+ python3 test/test_mcp.py
13
+
14
+ # 2. connect a host (Claude Desktop example; see config/mcp-config-examples.md)
15
+ # paste the config JSON into claude_desktop_config.json, restart the host
16
+
17
+ ## Tool surface (same-source semantics with the Plugin Edition (A) / Complete Edition (B))
18
+
19
+ - **memgate_deposit(obj, act, actual, kind, source)** — store one governed memory
20
+ - **memgate_recall(query, top_k)** — recall by signature/keyword (with scores)
21
+ - **memgate_stats()** — memory store statistics
22
+ - **memgate_compact()** — compact (drop redundancy)
23
+
24
+ ## Environment
25
+
26
+ - Python >= 3.9, **zero third-party dependencies** (stdlib + shipped kernel)
27
+ - MEMGATE_HOME: memory store directory (default ~/.memgate-mcp) — multi-project isolation = one directory per project
28
+ - family relationship: the kernel is single-source with the Complete Edition (B) (sync_kernel.sh link); production changes go back to the family single source
29
+
30
+ ## Version
31
+
32
+ 2026.11.21 (2026-11-21, family YYYY.MM.DD scheme) — MCP 2025-06-18, four-tool surface, smoke test shipped.
package/README.md CHANGED
@@ -1,35 +1,29 @@
1
- # MemGate MCP(D-MCP版)说明书
1
+ # MemGate MCP (D-MCP Edition)
2
2
 
3
- **一句话**:把治理级记忆(存取留痕/质量门/统计账)接到任何支持 MCP 的 AI 平台——
4
- Claude Code、Cursor、Copilot Studio、Windsurf、Cline、Zed 一线全收。
3
+ **In one line**: connect governed memory (audited writes/reads, quality gates, statistical ledgers) to any MCP-capable AI platform — Claude Code, Cursor, Copilot Studio, Windsurf, Cline, Zed, one surface for all.
5
4
 
6
- ## 它解决什么
5
+ ## Quick start
7
6
 
8
- AI 助手/编码代理的记忆各自为政:跨项目污染、无审计、忘得快。
9
- MemGate MCP 提供**治理过的记忆存取**:每个条目带对象-动作-内容三元组签名,过质量门,入统计账。
10
-
11
- ## 快速开始
12
-
13
- # 1. 冒烟自测(应打印 SMOKE ALL GREEN)
7
+ # 1. smoke self-test (should print SMOKE ALL GREEN)
14
8
  python3 test/test_mcp.py
15
9
 
16
- # 2. 接入宿主(以 Claude Desktop 为例,详见 config/mcp-config-examples.md)
17
- # 把配置 JSON 填入 claude_desktop_config.json,重启宿主
18
- # npm 安装后也可以直接用随包启动器:"command": "memgate-mcp"
10
+ # 2. connect a host (Claude Desktop example; see config/mcp-config-examples.md)
11
+ # paste the config JSON into claude_desktop_config.json, restart the host
12
+ # after npm install the shipped launcher works too: "command": "memgate-mcp"
19
13
 
20
- ## 工具面(与 A-插件版/B-完整版同源语义)
14
+ ## Tool surface (same-source semantics with the Plugin Edition (A) / Complete Edition (B))
21
15
 
22
- - **memgate_deposit(obj, act, actual, kind, source)** — 存一条治理记忆
23
- - **memgate_recall(query, top_k)** — 按签名/关键词召回(带分数)
24
- - **memgate_stats()** — 记忆库统计
25
- - **memgate_compact()** — 压实(清冗余)
16
+ - **memgate_deposit(obj, act, actual, kind, source)** — store one governed memory
17
+ - **memgate_recall(query, top_k)** — recall by signature/keyword (with scores)
18
+ - **memgate_stats()** — memory store statistics
19
+ - **memgate_compact()** — compact (drop redundancy)
26
20
 
27
- ## 环境
21
+ ## Environment
28
22
 
29
- - Python >= 3.9,**零第三方依赖**(stdlib + 随包 kernel)
30
- - MEMGATE_HOME:记忆库目录(默认 ~/.memgate-mcp)——多项目隔离=每项目配不同目录
31
- - 与家族关系:工具面与 A-插件版/B-完整版同源语义(deposit/recall/stats/compact)
23
+ - Python >= 3.9, **zero third-party dependencies** (stdlib + shipped kernel)
24
+ - MEMGATE_HOME: memory store directory (default ~/.memgate-mcp) — multi-project isolation = one directory per project
25
+ - family relationship: tool semantics are same-source with the Plugin Edition (A) / Complete Edition (B) (deposit/recall/stats/compact)
32
26
 
33
- ## 版本
27
+ ## Version
34
28
 
35
- 2026.11.21(2026-11-21,家族 YYYY.MM.DD 制)——MCP 2025-06-18,四工具面,冒烟件随包。
29
+ 2026.11.21 (2026-11-21, family YYYY.MM.DD scheme) — MCP 2025-06-18, four-tool surface, smoke test shipped.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memgate-mcp",
3
- "version": "2026.11.21",
3
+ "version": "2026.11.24",
4
4
  "description": "MemGate MCP server (D-MCP edition): governance-grade memory (deposit/recall/stats/compact) for any MCP host - Claude Code, Cursor, Copilot Studio, Windsurf, Cline, Zed. Zero third-party dependencies.",
5
5
  "type": "commonjs",
6
6
  "license": "Elastic-2.0",
@@ -16,9 +16,10 @@
16
16
  "VERSIONS.json",
17
17
  "README.md",
18
18
  "MANIFEST.md",
19
- "说明书.md",
20
- "历史脉络.md",
21
- "LICENSE"
19
+ "MANUAL.md",
20
+ "HISTORY.md",
21
+ "LICENSE",
22
+ "FEATURES.md"
22
23
  ],
23
24
  "engines": {
24
25
  "python": ">=3.9",
@@ -34,6 +35,13 @@
34
35
  "memory",
35
36
  "governance",
36
37
  "model-context-protocol",
37
- "memgate"
38
+ "memgate",
39
+ "claude-code",
40
+ "cursor",
41
+ "copilot",
42
+ "mcp-server",
43
+ "agent-memory",
44
+ "long-term-memory",
45
+ "mem0-alternative"
38
46
  ]
39
- }
47
+ }
@@ -1,19 +0,0 @@
1
- # D-MCP版 · 历史脉络
2
-
3
- - **2026-11-21 22:40 立项**(用户拍板「开工,做好平台管理 不要乱」):战略判断=MCP 已是 AI 编码平台事实标准
4
- (Claude Code/Cursor/Copilot/Windsurf/Cline/Zed 全收),一套 MCP 面解锁整个生态,杠杆大于逐家插件。
5
- - 形态决策:入**中间件家族**(A/B/C 之侧,家族管理制),不另起炉灶——沿用家族的生产/上架分离、VERSIONS 绑定、登记门。
6
- - 实现决策:**零第三方依赖**手搓 MCP stdio(家族自足哲学),kernel 进程内直驱(离线可用),语义镜 B 版 REST。
7
- - 2026-11-21 23:0x 冒烟全绿(握手/四工具/错法码 -32601),见 test/test_mcp.py。
8
-
9
- ## ⚠️ 更正记录(2026-11-21 22:5x,用户质询「0.1.0 不太对吧」后立)
10
-
11
- - **原文**:VERSIONS.json/服务器版本号 = 0.1.0
12
- - **根因**:立项随手开 semver 新线,违反家族治理规则(VERSIONS-3tier.md 2026-11-17 拍板:版本号格式 YYYY.MM.DD,三线独立递增);且当天 A/B 线已裸奔(npm 0.2.x=重发逼号、GHCR 0.1.2=树里随手号),三条线三个朝代=版本漂移实锤
13
- - **现行判定**:D 版首号=**2026.11.21**(家族制,且为合法 semver 兼容 npm);**今后全线统一 YYYY.MM.DD**——已发的 npm 0.2.x/GHCR 0.1.2 动不了(不可变),下一代发布起归队
14
- - **影响面**:D 全部管理件(VERSIONS.json/mcp_server.py/说明书)已改;A/B 在架件不变
15
- - **未完成待办**:B 线下次发布用 2026.11.x;npm 线下次发布同样归队(版本跳跃即漂移归零点)
16
- - **2026-11-22 上架包建成**:73 件+memgate-mcp-2026.11.21.tgz(350KB),冒烟全绿;新增 package.json+bin/memgate-mcp.js 启动器;MANIFEST 版号勘误 0.1.0→2026.11.21。
17
- ## ⚠️ 更正记录(2026-11-22)
18
-
19
- - 许可声明勘误:顶层 LICENSE 误置旧版「MemGate Commercial License」,已归队 **MemSteward 全件统一许可声明 v1.3**(全件依 AI Research Source License 1.3 授权,全文见 kernel/core/LICENSE);kernel/core/LICENSE 1.2→1.3 同步归队。
@@ -1,34 +0,0 @@
1
- # MemGate MCP(D-MCP版)说明书
2
-
3
- **一句话**:把治理级记忆(存取留痕/质量门/统计账)接到任何支持 MCP 的 AI 平台——
4
- Claude Code、Cursor、Copilot Studio、Windsurf、Cline、Zed 一线全收。
5
-
6
- ## 它解决什么
7
-
8
- AI 助手/编码代理的记忆各自为政:跨项目污染、无审计、忘得快。
9
- MemGate MCP 提供**治理过的记忆存取**:每个条目带对象-动作-内容三元组签名,过质量门,入统计账。
10
-
11
- ## 快速开始
12
-
13
- # 1. 冒烟自测(应打印 SMOKE ALL GREEN)
14
- python3 test/test_mcp.py
15
-
16
- # 2. 接入宿主(以 Claude Desktop 为例,详见 config/mcp-config-examples.md)
17
- # 把配置 JSON 填入 claude_desktop_config.json,重启宿主
18
-
19
- ## 工具面(与 A-插件版/B-完整版同源语义)
20
-
21
- - **memgate_deposit(obj, act, actual, kind, source)** — 存一条治理记忆
22
- - **memgate_recall(query, top_k)** — 按签名/关键词召回(带分数)
23
- - **memgate_stats()** — 记忆库统计
24
- - **memgate_compact()** — 压实(清冗余)
25
-
26
- ## 环境
27
-
28
- - Python >= 3.9,**零第三方依赖**(stdlib + 随包 kernel)
29
- - MEMGATE_HOME:记忆库目录(默认 ~/.memgate-mcp)——多项目隔离=每项目配不同目录
30
- - 与家族关系:kernel 单源同 B-完整版(sync_kernel.sh 链),生产改动回家族单源
31
-
32
- ## 版本
33
-
34
- 2026.11.21(2026-11-21,家族 YYYY.MM.DD 制)——MCP 2025-06-18,四工具面,冒烟件随包。