shared-memory-mcp
shared-memory-mcp
一个独立的、stdio 传输的 MCP 记忆服务。它把记忆写入调用者自己指定的目录,程序仓库与记忆数据分离,因此可以把这套能力分享给朋友,而不分享你的项目源码和现有记忆。
设计边界
仓库只放 MCP 程序、启动脚本、配置模板和通用策略。
每个使用者都有自己的
MDCG_ROOT,默认是~/.shared-memory-mcp/memory;辅助状态默认放在同目录旁的隐藏 runtime 目录。记忆目录不在 Git 仓库内,也不会自动扫描当前项目目录。
不要把
business/memory/、~/.dsh/、Harness 会话、日志、令牌或.env复制到本仓库。本仓库保留 MIT 授权文件;当前运行代码基于本机使用的
@furongjun1999/dsh-memory0.9.17 MCP 运行时,并保留上游归因信息。
Related MCP server: Qoopia
环境要求
Python 3.10 或更高版本
不需要安装第三方 Python 依赖即可运行 stdio MCP
DeepSeek Harness、Claude Code、Codex CLI 等支持 stdio MCP 的宿主
本地验证
python3 scripts/smoke_test.py该命令使用临时空记忆目录,只验证 MCP initialize 握手,不读取你的项目记忆。
启动 MCP
MDCG_ROOT="$HOME/.shared-memory-mcp/memory" \
python3 scripts/run_mcp.py不设置 MDCG_ROOT 时,启动脚本会使用 ~/.shared-memory-mcp/memory,并自动设置独立的 MDCG_AUX_ROOT、MDCG_STATE_ROOT、MDCG_DATA_ROOT。如果要让多人共享同一份记忆,必须改成远程、带认证和命名空间隔离的 MCP 服务;不要通过共享本地目录或把你的记忆文件提交到 Git 来实现。
DeepSeek Harness 配置
复制 dsh/cordis.patch.example.yml 中的配置到 Harness profile 的 cordis.patch.yml,并替换:
args中仓库的绝对路径;cwd中仓库的绝对路径;MDCG_ROOT为朋友自己的私有记忆目录;MDCG_ACTOR为朋友自己的标识。
建议先保持 MDCG_MCP_SURFACE: kernel,确认能启动后再按需切换到 full。不同 Harness 版本的 MCP 配置字段可能略有差异,但核心是以 stdio 方式运行 scripts/run_mcp.py。
直接运行协议探针
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"manual","version":"0.1.0"}}}' \
| python3 scripts/run_mcp.py目录说明
md_cg/ MCP 记忆运行时源码
data/policy.json 通用策略,不包含个人记忆
scripts/run_mcp.py 使用独立记忆根目录启动服务
scripts/smoke_test.py 空目录握手自检
dsh/ DeepSeek Harness 配置模板Available Tools
2 toolscgB
灵枢认知图唯一入口(38 op:写/读/审/护/演化/元认知/预测/白箱/验证态 status/三元组反查 edges…)。完整 op/参数语义:cg(op="help", query="<op 名 | 参数名 | 工具名>")
Inputs: op (required), a, b, k, +208 more.
stgC
语义时空图 5 op:relation|timeline|anchors|consistency|state_chain。完整 op/参数语义:cg(op="help", query="<op 名 | 参数名 | 工具名>")
Inputs: op (required), a, b, bbox, +10 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
Both tools are op-dispatch mega-tools whose domains (cognitive graph vs. semantic spatiotemporal graph) overlap in graph/relation/edge concepts, making it hard to know which entry point to use. With 38 hidden ops in cg and 5 in stg, an agent must first call help to disambiguate, which is a poor tool-set boundary.
The two names cg and stg follow a consistent short-lowercase-abbreviation convention with no mixing of styles. They are not self-descriptive verb_noun names, but consistency is strong.
Two tools is thin for a server with this much implied functionality, and cg alone hides 38 operations behind a single tool. The op-dispatch design may be intentional, but at the tool level it feels compressed and forces discovery through a help op.
The descriptions suggest broad coverage: cg spans write/read/audit/protect/evolve/metacognition/predict/validation/edges, and stg covers relation/timeline/anchors/consistency/state_chain. Minor uncertainty remains because actual op semantics are hidden behind cg(op="help"), but the surface appears fairly complete for a shared-memory graph domain.
Maintenance
Related MCP Connectors
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Private memory, scratchpads, context export/restore and task handoff for AI agents.
Person-owned AI memory: portable context for any MCP client.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables each user to have a private, per-user memory store that persists across AI tools, allowing them to store, recall, search, list, and delete memories via MCP.-
- AlicenseNot gradedqualityBmaintenanceProvides persistent memory for AI agents via MCP, enabling agents to store and access notes, files, and session context across sessions and clients while under user control.4MIT
- AlicenseAqualityCmaintenanceEnables concurrent terminal sessions or other MCP clients on the same machine to register, exchange messages, check inboxes/replies, and coordinate tasks through file-based storage without a daemon or network port.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables any MCP stdio client to share one local, evidence-backed project memory store, letting agents record verified facts and task outcomes, retrieve a token-budgeted context packet, and review, approve, or invalidate entries before they become active. Also supports handoff capsules and evidence-freshness recovery so stale or disputed memory is surfaced rather than silently reused.51 npm3MIT