After this, your AI will stop before destructive actions (delete, transfer, reset) and ask for a fresh 6-digit code from the memory-lock mini program. You approve — it acts.
Any MCP-capable client starts a stdio process and injects two variables (first required):
node /abs/path/verify-code-mcp/src/index.js MEMLOCK_API_KEY=YOUR_KEY # from the mini program MEMLOCK_API_BASE=https://api.memlock.cn # optional, default
Install dependencies once: cd verify-code-mcp && npm install.
Settings → Developer → Edit Config. Merge mcpServers into claude_desktop_config.json, save, then fully quit & reopen.
{ "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" }
} } }
\\), or use forward slashes like E:/.../index.js.Cline panel → MCP Server → Configure, add verify-code with type: stdio. Save and refresh.
{ "mcpServers": { "verify-code": { "type": "stdio", "command": "node",
"args": ["/abs/path/verify-code-mcp/src/index.js"],
"env": { "MEMLOCK_API_KEY": "YOUR_KEY" } } } }
Ask your AI: “List any MCP tools related to memory-lock / verify-code.” It should answer two tools:
verify_dynamic_code — verify a 6-digit code detect_high_risk_action — is this instruction risky?
A healthy MCP server prints on startup:
node src/index.js [verify-code] MCP Server started, backend=https://api.memlock.cn, api_key=set # api_key=MISSING → env not set; 'set' = ready
GET api.memlock.cn/v1/info returns service + ICP; POST /v1/verify without a key → HTTP 401.Add this to the session or project rules:
Before irreversible/wide-impact actions (delete/rm/overwrite/reset/transfer/pay/bulk/permission change):
1) run verify-code detect_high_risk_action;
2) if high/medium: STOP, show me the exact command, ask for the current
6-digit code from the mini program, and call verify_dynamic_code;
3) act only if it verifies; otherwise refuse and explain.
装完后:你的 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。
Settings → Developer → Edit Config。把 mcpServers 合并进 claude_desktop_config.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。Cline 面板 → MCP Server → Configure,加一个 verify-code,type 用 stdio,保存后点刷新。
{ "mcpServers": { "verify-code": { "type": "stdio", "command": "node",
"args": ["/绝对路径/verify-code-mcp/src/index.js"],
"env": { "MEMLOCK_API_KEY": "你的Key" } } } }
问 AI:“列出你可用 MCP 工具里和『记忆之锁 / verify-code』有关的。” 它应回两个工具:
verify_dynamic_code — 校验 6 位动态口令 detect_high_risk_action — 判断指令是否高危
server 正常启动会打印:
node src/index.js [verify-code] MCP Server started, backend=https://api.memlock.cn, api_key=set # 若报 api_key=MISSING → env 没导入;set 才表示配好
GET api.memlock.cn/v1/info 返回服务信息与备案号;POST /v1/verify 不带 key → HTTP 401。给它设一条安全边界(粘进会话 / 项目规则):
在执行 删除/覆盖/转账/批量/改权限 这类不可逆或影响面大的操作前:
1) 先调 verify-code 的 detect_high_risk_action 判断风险;
2) 若 high/medium,先停下,把要执行的命令列给我看,
让我用「记忆之锁」小程序当前 6 位口令做 verify_dynamic_code;
3) 口令通过才执行;拿不到/过不了就拒绝并说明原因。