Skip to main content
Glama

shared-memory-mcp

一个独立的、stdio 传输的 MCP 记忆服务。它把记忆写入调用者自己指定的目录,程序仓库与记忆数据分离,因此可以把这套能力分享给朋友,而不分享你的项目源码和现有记忆。

设计边界

  • 仓库只放 MCP 程序、启动脚本、配置模板和通用策略。

  • 每个使用者都有自己的 MDCG_ROOT,默认是 ~/.shared-memory-mcp/memory;辅助状态默认放在同目录旁的隐藏 runtime 目录。

  • 记忆目录不在 Git 仓库内,也不会自动扫描当前项目目录。

  • 不要把 business/memory/、~/.dsh/、Harness 会话、日志、令牌或 .env 复制到本仓库。

  • 本仓库保留 MIT 授权文件;当前运行代码基于本机使用的 @furongjun1999/dsh-memory 0.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,并替换:

  1. args 中仓库的绝对路径;

  2. cwd 中仓库的绝对路径;

  3. MDCG_ROOT 为朋友自己的私有记忆目录;

  4. 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 tools
cgB

灵枢认知图唯一入口(38 op:写/读/审/护/演化/元认知/预测/白箱/验证态 status/三元组反查 edges…)。完整 op/参数语义:cg(op="help", query="<op 名 | 参数名 | 工具名>")

NameRequiredDescriptionDefault
aNo
bNo
kNo返回条数(sustain pool_bench…
opYesroute|read|write|verify|review|protect|identity|consistency|metacognition|self_state|evolution|sustain|scrub|predict|causal|forget|goal|task|recent|state_event|info|index_code|index_doc|ref|whitebox|theory|link|session|ingest|export|maintain|consolidate|insight|ccg|status|edges|audit|help
tsNo
capNo
ccgNoCCG 六要素编译器入参:{action, no…
hitNo
idsNo
newNo
oldNo
outNo
pidNoreview decide 的提案 id
refNo
seqNo
setNo
tagNo
bm25No
factNo
goalNo
keepNo
kindNocondition_gap|layer_shift|general
metaNo
modeNolist|show
nameNo
noteNotask op:本轮备注(change 是计划变…
packNo
pathNoindex_code/index_doc 的目录…
peerNo
planNo
roleNouser|assistant|tool-output|command
rootNo
ruleNo
seedNo
slotNo
sortNo取值随 op 变化,完整枚举见 op=help
tagsNo标签(cap:xxx 会作为 route 的建议…
textNorecent op 的事件文本
viewNo
applyNo
batchNo
childNo
cluesNo
depthNo
editsNo
forceNorestore 强制(忽略前置条件:墓碑等)
gatedNo
kindsNo
layerNoanchor|structural|knowledge|contextual|self
limitNogoal/recent 的返回条数;read 的…
poolsNo
pruneNo
queryNoread 的查询
rootsNo
sinceNo
stateNopending|verified|falsified
swarmNo
traitNo
untilNo
writeNo
actionNo取值随 op 变化,完整枚举见 op=help
changeNo
dedupeNo
intentNoroute 的查询意图
issuesNo问题清单(红队打回理由)
markerNo
memoryNosucceeded|failed|blocked|partial
offsetNo
parentNo
prefixNo
reasonNo原因;consolidate contextua…
resultNo
sourceNoconsolidate|verify|manual
windowNo
contentNowrite 的内容(建议含 CCG 5 要素注释…
contextNo当前情境
doc_refNo
dry_runNosustain heal / scrub:只列动…
excludeNo
granteeNo
grantorNo
horizonNo
lexicalNo
messageNo
missingNo
node_idNo节点 id
queriesNo
redteamNopass|reject
sessionNoread(search/recall 分支):会…
subjectNolink evidence:按主体过滤(如 ag…
v_typesNov1|v2|v3
verdictNo取值随 op 变化,完整枚举见 op=help
boundaryNo
categoryNo
deadlineNo
decisionNoaccept|reject|edit|merge
end_timeNo时间算子:查询窗终点(缺省该侧=无界)
entry_idNo
evidenceNoverify 的证据;state_event:出…
max_rowsNo
min_confNo
negativeNo
orderingNo
overrideNo覆盖/删除受保护节点需显式 override=t…
patternsNo
positionNorecord|reflect|verify|output|sustain
prefixesNo
priorityNo
questionNo
relationNosplit_from|extracted_from|merged_from|refined_from|source
sample_nNo
semanticNo
start_idNo
strategyNostratified|risk|random
subjectsNo
validityNo
verdictsNo
aeis_rootNo
auto_healNo
conditionNo
directionNoout|in
entry_idsNo
max_filesNo
max_itemsNo
max_nodesNo
min_deltaNo
min_mergeNo
neighborsNo
questionsNo
skip_dirsNo
statementNo
subsystemNo
time_axisNo时间算子轴:effective(效力轴,read…
timestampNo
acceptanceNo
auto_scrubNo
basis_textNo
conditionsNogoal op:生效条件
depends_onNo
done_limitNo
importanceNo重要性 0-1
max_eventsNo
merge_intoNo
session_idNo
start_timeNo时间算子:查询窗起点(ISO8601/时间戳)。…
subject_idNo取值随 op 变化,完整枚举见 op=help
valid_fromNo双时间轴**起点**(ISO8601,如 202…
action_hintNo
aggregationNoby_relation|by_parent|by_child
auto_evolveNo
bypass_gainNo
consistencyNo
contract_idNo
exclude_docNo检索面排除 doc_ 索引节点(会话日志切片;默…
goal_statusNoactive|done|dropped
incrementalNo
ledger_onlyNo
min_clusterNo
min_jaccardNo
on_conflictNoreject|defer|record
peer_theoryNo
recent_daysNo
sensitivityNo
snapshot_idNo
task_statusNoactive|blocked|done|dropped
valid_untilNo双时间轴**终点**(ISO8601):此刻后不…
window_daysNo
active_limitNo
allow_evolveNo
blindspot_idNo
content_kindNocode|image_desc|text|permission|work_done|work_wip|ccg_marks|hyperedge
derived_fromNo
end_operatorNogt|gte|eq|lte|lt
expand_nodesNo
max_branchesNo
min_severityNoinfo|low|medium|high
peer_versionNo
position_mapNo
sample_limitNo
signers_fileNo
source_layerNo
subject_kindNoself|user|role|agent
target_layerNo
task_runningNo
auto_flywheelNo
beat_intervalNo
budget_tokensNoread 的 token 预算
heal_intervalNo
prune_dry_runNo
actual_node_idNo
check_strengthNohoop|smoking_gun|doubly_decisive
include_recentNo
min_importanceNo
overwrite_liveNo
peer_signatureNo
relation_typesNo
scrub_intervalNo
start_operatorNogt|gte|eq|lte|lt
status_summaryNo
condition_spaceNo条件空间
evolve_intervalNo
importance_hintNo
include_contentNo
include_historyNo
include_partialNo
requested_layerNo
declared_charterNo
excerpt_strategyNo
predicted_node_idNo
require_conditionsNo
verification_basisNo验证基底
non_applicable_conditionsNo不适用条件

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It hints at mutation-related ops such as write, protect, forget, and evolution, but does not disclose permissions, destructive effects, reversibility, protected-node constraints, or return behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is two sentences, front-loaded with the sole-entry-point role and operation families, followed by the help discovery instruction. It is dense but appropriately sized with no wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 212-parameter multi-op gateway with no output schema and no annotations, the description is very sparse. It points to op=help but does not provide return information, per-op behavior, or enough standalone detail to invoke most operations correctly without an extra help call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 29% across 212 parameters, so the schema cannot fully document itself. The description partially compensates by naming op and query and showing the help lookup pattern, but it does not explain most parameter meanings directly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies the resource clearly as the sole entry point to the Lingzhu cognitive graph and enumerates 38 operation families including write/read/review/protect/evolution. It does not mention the sibling tool stg, so sibling differentiation is absent, but the core purpose is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit discovery guidance: call cg(op="help", query="<op name | parameter name | tool name>") for complete op and parameter semantics. This is clear context for how to proceed, though it does not state when-not to use the tool or explain alternatives beyond being the sole entry point.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

stgC

语义时空图 5 op:relation|timeline|anchors|consistency|state_chain。完整 op/参数语义:cg(op="help", query="<op 名 | 参数名 | 工具名>")

NameRequiredDescriptionDefault
aNo
bNo
opYesrelation|timeline|anchors|consistency|state_chain
bboxNo
descNo
slotNo
layerNo限定层
limitNo返回条数
historyNo
sessionNotimeline 的会话视图开关(归因维度,与授…
subjectNostate_chain 的主体(省略=不过滤)
time_axisNo
time_windowNo
include_retiredNo

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden, and it discloses nothing: no read-vs-write characterization, no side effects, no auth or rate-limit notes, and no indication whether state_chain or consistency mutate graph state. The op names hint at intent but behavior remains opaque.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, no filler, with the op enumeration front-loaded. The structure is efficient, though the second sentence substitutes a lookup pointer for content rather than adding substance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter, multi-op tool with no annotations and no output schema, the description is far too thin to call correctly without a preliminary help lookup. The cg help pointer prevents total failure but leaves the definition dependent on an external call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 14 parameters and only 36% schema description coverage, the description must compensate, yet it offers no parameter meaning at all — it only says to query cg(op="help") for param semantics. Parameters like a, b, bbox, slot, time_axis, and include_retired are entirely undocumented in both places.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

It names the resource (semantic spatiotemporal graph) and enumerates the five allowed ops, so an agent knows the tool's domain. But it never says what any op actually does, and the op list merely restates the enum already present in the schema, leaving purpose vague beyond the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to pick stg over the sibling cg, nor when to use relation vs timeline vs consistency. The only routing hint is a self-referential pointer to cg(op="help"), which pushes the decision to a second call rather than informing selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.0
    • First observedcg
    • First observedstg

TDQS

C2.9/5.0

Scored across 2 tools

Disambiguation2/5

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.

Naming Consistency4/5

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.

Tool Count3/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables 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.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides 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.
    4
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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.
    36 npm
    1
    MIT