Learn the WorkBuddy / Claude / Cline skill pack

~6 min · WorkBuddy · Claude · Cline

快来学习 WorkBuddy / Claude / Cline 技能接入包

约 6 分钟 · WorkBuddy · Claude · Cline

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.

Outcome: “Before my AI deletes / pays / resets, it stops and asks me for the current code on my phone.”

1 · Get your own API key (~20 s)

  1. Open the WeChat memory-lock mini program (register with email / WeChat if new).
  2. Switch to the Interface Info tab at the bottom.
  3. Copy the API Key shown there. It belongs only to you.
Know your code source: the key page shows the rolling current dynamic code. Do not confuse it with the one-time email/login code.

2 · Run verify-code next to the pack

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.

3 · Register it in your client

Client
Where
WorkBuddy
Merge into ~/.workbuddy/.mcp.jsonmcpServers (or its “add MCP” flow)
Claude Desktop
Settings → Developer → Edit Config → claude_desktop_config.json
Cline (VS Code)
MCP panel → Config, add a stdio server

Shared 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" }
    } } }
Windows: forward slashes like E:/…/index.js are safest; in JSON backslashes need \\. Save, then fully quit and reopen the client.

4 · Confirm both tools are exposed

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

5 · Rehearse the human gate

Ask it to delete a test file. The correct behaviour:

  1. Agent says “this is a destructive delete” and stops.
  2. It shows the command and asks you for the current code from the mini program.
  3. You read it aloud; the agent calls 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?

Done. From now on your AI stops and asks for your phone code before destructive actions.

这篇是「技能接入包」的实操手册。不用自建服务器——记忆之锁已在 api.memlock.cn 在线。你只需开户、拿自己的 API Key、让 AI 指过去。从此删除/转账/重置这类动作,都得先过一道小程序当前 6 位口令。

期望效果:「我的 AI 在删数据 / 付款 / 重置前,会先停下来找你拿手机上的当前码。」

第 1 步 · 拿你自己的 API Key(约 20 秒)

  1. 微信打开 「记忆之锁」 小程序(新用户用邮箱或微信注册)。
  2. 切到底部「接口信息」那一页。
  3. 复制页上显示的 API Key——它只属于你。
记牢码源:接口信息页里有滚动的「当前动态口令」。别和邮箱/登录用的一次性验证码混起来。

第 2 步 · 让 verify-code 在接入包旁跑起来

支持 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

第 3 步 · 在客户端里登记

客户端
在哪配
WorkBuddy
合并进 ~/.workbuddy/.mcp.jsonmcpServers(或用它的“添加 MCP”)
Claude Desktop
Settings → Developer → Edit Config → claude_desktop_config.json
Cline(VS Code)
MCP 面板 → Config,加一个 stdio 服务

共用的 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" }
    } } }
Windows 建议写正斜杠,如 E:/…/index.js;JSON 里反斜杠要转义成 \\。保存后彻底退出并重启客户端。

第 4 步 · 确认两个工具都在

问 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 才表示就绪

第 5 步 · 演练一次「人闸」

让它删一个测试文件,看它是不是会停下来:

  1. Agent 先说“这是删除类高危操作”并停下
  2. 把要执行的命令列给你,请你去小程序取「当前动态口令」。
  3. 你把 6 位码念给它;它调 verify_dynamic_code,通过才继续。

如果它二话不说直接删了,说明人闸没生效。逐项排查:Key 是不是你自己的?客户端有没有重载?你把的是「当前动态口令」还是邮箱验证码?node 路径是不是绝对路径?

完成。以后你的 AI 想删东西、付款、重置前,会先停下等你用手机取当前码——你说行,它才动手。