This is the hands-on walkthrough for the memory-lock “skill pack”. No server to deploy — memory-lock is already live at api.memlock.cn. You only open an account, get your own API key, and point your AI at it. After that, destructive actions are gated behind a 6-digit code from the mini program.
Any MCP-capable client launches a local stdio process with two variables (first required):
node /abs/path/verify-code-mcp/src/index.js MEMLOCK_API_KEY=YOUR_KEY # from Interface Info MEMLOCK_API_BASE=https://api.memlock.cn # optional, default
Install dependencies once: cd verify-code-mcp && npm install.
~/.workbuddy/.mcp.json → mcpServers (or its “add MCP” flow)claude_desktop_config.jsonShared JSON shape:
{ "mcpServers": { "verify-code": {
"command": "node",
"args": ["/abs/path/verify-code-mcp/src/index.js"],
"env": { "MEMLOCK_API_KEY": "YOUR_KEY", "MEMLOCK_API_BASE": "https://api.memlock.cn" }
} } }
E:/…/index.js are safest; in JSON backslashes need \\. Save, then fully quit and reopen the client.Ask your AI: “Which memory-lock / verify-code MCP tools do you have?” Expect exactly two:
verify_dynamic_code — validate a 6-digit dynamic code detect_high_risk_action — flag delete / transfer / reset / bulk
A healthy server logs on startup (stderr, not stdout):
[verify-code] MCP Server started, backend=https://api.memlock.cn, api_key=set
# api_key=MISSING → env not loaded; set → ready
Ask it to delete a test file. The correct behaviour:
verify_dynamic_code and only proceeds on success.If it deletes right away, the gate is not active. Check: is the key yours? did the client reload? did you hand it the current code rather than an email code? and is node an absolute path?
这篇是「技能接入包」的实操手册。不用自建服务器——记忆之锁已在 api.memlock.cn 在线。你只需开户、拿自己的 API Key、让 AI 指过去。从此删除/转账/重置这类动作,都得先过一道小程序当前 6 位口令。
支持 MCP 的客户端都只是拉起本地 stdio 进程并注入两个变量(第一个必填):
node /绝对路径/verify-code-mcp/src/index.js MEMLOCK_API_KEY=你的Key # 从「接口信息」拿 MEMLOCK_API_BASE=https://api.memlock.cn # 可选,默认值
先装一次依赖:cd verify-code-mcp && npm install。
~/.workbuddy/.mcp.json 的 mcpServers(或用它的“添加 MCP”)claude_desktop_config.json共用的 JSON 写法:
{ "mcpServers": { "verify-code": {
"command": "node",
"args": ["/绝对路径/verify-code-mcp/src/index.js"],
"env": { "MEMLOCK_API_KEY": "你的Key", "MEMLOCK_API_BASE": "https://api.memlock.cn" }
} } }
E:/…/index.js;JSON 里反斜杠要转义成 \\。保存后彻底退出并重启客户端。问 AI:“你有和记忆之锁 verify-code 相关的 MCP 工具吗?”,应当正好两个:
verify_dynamic_code — 校验 6 位动态口令 detect_high_risk_action — 识别删除/转账/重置/批量类风险
server 正常启动会打到 stderr(别当报错):
[verify-code] MCP Server started, backend=https://api.memlock.cn, api_key=set
# 若 api_key=MISSING → 环境变量没导入;set 才表示就绪
让它删一个测试文件,看它是不是会停下来:
verify_dynamic_code,通过才继续。如果它二话不说直接删了,说明人闸没生效。逐项排查:Key 是不是你自己的?客户端有没有重载?你把的是「当前动态口令」还是邮箱验证码?node 路径是不是绝对路径?