Connect Memory Lock to Qwen Office

~5 min · Qwen Office · Remote MCP

如何把记忆之锁接入千问办公

约 5 分钟 · 千问办公 · 远程 MCP

Qwen Office takes a different kind of MCP server: a remote URL, not a local process. So there is nothing to download and no Node.js to install — you write four lines in the chat box and you are done. Memory Lock now speaks that protocol too.

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

1 · Get your API key

Open the WeChat memory-lock mini program → Interface Info tab and copy your API Key (new accounts get a 7-day trial automatically).

The key page also shows the rolling current dynamic code. That is the number you read out later — it is not the same as an email or login code.

2 · Add a custom MCP server in Qwen Office

No downloadable package and no install method to pick. Open Qwen Office and type the server info straight into the chat box — it is not a form wizard you click through. Paste these four lines:

Custom MCP server info:
Server name: memory-lock
Server URL: https://api.memlock.cn/v1/mcp
Transport type: Streamable HTTP
Header: Authorization = Bearer <your API Key>

It attaches automatically once sent. After that, ask it whether the server is connected — no restart needed.

If it says “connected” but a tool call still comes back 401, the header is the problem.
Memory Lock expects the header to read Authorization=Bearer yourKey. If you enter the key alone without the Bearer prefix, Qwen Office fills it in for you — but this varies between versions, and some builds still treat it as missing credentials and return 401 outright. So type it in full: Bearer followed by one space, then your key.

3 · Confirm both tools are exposed

After saving, ask in the chat: “Which memory-lock 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

If it shows zero tools or reports the server as unreachable, check the URL for a stray space or a missing /v1/mcp, then make sure the key was copied in full.

4 · Inject the rule (critical — don’t skip)

Wiring up the tools is not the same as having a gate. Memory Lock only acts when it is called, so you still have to tell Qwen Office when to use it. Paste this into the chat:

From now on, treat “delete file”, “delete folder”, “wipe data”,
“bulk delete”, “transfer funds” and “reset / overwrite” as high-risk actions.

When you hit one of these, follow these three steps — none may be skipped:
1. First list out exactly what you intend to do (command, path, scope)
2. Call memory-lock to check whether it counts as a high-risk action
3. Stop and ask me for the current 6-digit dynamic code;
   once I read it out, call the tool to verify —
   only proceed if it comes back verified.

Wording differs across versions and models; details omitted here.

Rules tend to get “forgotten”. As a conversation grows, an earlier injected rule can get diluted. Two fixes: ① re-paste the rule at the start of every new conversation (most reliable); ② put it in Qwen Office’s persistent system prompt / agent persona rather than only in the chat.

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 out the code; the agent calls verify_dynamic_code and only proceeds on success.

If it deletes right away, the rule never took effect. Check: did you actually send the step-4 rule? is the key yours? did you hand it the current dynamic code rather than an email code?

Why this is different from the local pack

WorkBuddy, Claude Desktop and Doubao run the skill pack as a local process on your machine. Qwen Office doesn’t accept that form. With the remote endpoint, the tool call travels over HTTPS to api.memlock.cn — the code is verified server-side, and only a SHA-256 hash of the code is ever written to the log. No plaintext code is stored.

Done. Your Qwen Office agent now stops and asks for the dynamic code on your phone before destructive actions.

千问办公只接受一种 MCP:远程 URL 型,不跑本地进程。所以这里不需要下载接入包、不用装 Node.js —— 在对话框里写四行就完事。记忆之锁已经支持这种协议。

期望效果:「我的千问办公 Agent 在删数据 / 付款 / 重置前,会先停下来等我核对手机上的动态口令。」

第 1 步 · 拿到 API Key

微信打开 「记忆之锁」 小程序 → 切到底部「接口信息」页,复制你的API Key(新用户注册即送 7 天体验期)。

接口信息页里还有一个滚动的「当前动态口令」,那是后面要念给 AI 的数字 —— 别和邮箱验证码、登录验证码混淆。

第 2 步 · 在千问办公里写入自定义 MCP 服务

不用下载接入包,也没有「安装方式」要选。打开千问办公,直接把这四行写进对话框发出去 —— 这不是点一栏填一栏的表单向导:

自定义 MCP 服务器信息:
服务名称:memory-lock
Server URL:https://api.memlock.cn/v1/mcp
传输类型:Streamable HTTP
请求头:Authorization = Bearer 你的API Key

发出即自动挂载生效,之后问它一句服务是否已连上即可,不需要重启。

如果提示「已连接」,但调用工具仍报 401,问题就出在请求头上。
记忆之锁要求收到的请求头是 Authorization=Bearer 你的Key —— 只写 Key、不带 Bearer 前缀,千问办公会自动补齐,但版本不同可能仍会被判为缺少凭据,直接返回 401。因此建议完整录入Bearer 后面一个空格。

第 3 步 · 验证两个工具都挂上了

保存后回到对话框问一句:「你有哪些 memory-lock 的 MCP 工具?」 应该正好是两个:

verify_dynamic_code     — 校验 6 位动态口令
detect_high_risk_action  — 识别 删除/转账/重置/批量 类动作

如果显示 0 个工具或提示连不上,先检查 URL 有没有多打空格或少了 /v1/mcp,再检查 Key 有没有复制完整。

第 4 步 · 注入规则(关键,别跳过)

挂上工具 ≠ 自动拦截。 记忆之锁的机制是「被调用才生效」,你还得告诉千问办公在什么情况下要用它。把下面这段直接贴进对话框:

从现在起,把「删除文件」、「删除文件夹」、「清空数据」、
「批量删除」、「转账」、「重置覆盖」当作高危操作。

遇到这类操作,必须按下面三步走,一步都不能跳:
1. 先把你准备做什么完整列给我看(命令、路径、影响范围)
2. 调用 memory-lock 检测是否属于高危动作
3. 停下来,向我索要当前的 6 位动态口令;
   我报出后调用工具校验,只有返回通过,你才能执行。

版本不同、模型不同,回复内容略有差异,此处略。

规则容易「失忆」:对话轮次一多,前面注入的规则可能被稀释。两个应对办法 —— ① 每开一个新对话重新贴一次(最稳);② 把规则写进千问办公的持久化系统提示 / 智能体人设里,而不是只写在对话里。

第 5 步 · 演练一次高危拦截

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

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

如果它二话不说直接删了,说明规则没生效。逐项排查:第 4 步规则有没有真的发给它?Key 是不是你自己的?有没有把「当前动态口令」误用成邮箱验证码?

和本地接入包有什么不同

WorkBuddy、Claude Desktop、豆包走的是装在本机的本地进程;千问办公不收这种形式。改用远程端点后,工具调用经 HTTPS 直达 api.memlock.cn,口令在服务端校验,落库的只有 SHA-256 哈希 —— 明文口令不存储。

提示:口令校验不通过,先确认配置里用的 API Key 就是当前登录邮箱对应的那个。