集成
Continue
在 Continue 中两分钟完成 zn-gate 配置:将其添加为 MCP 服务器,以及 zn-gate 在该环境中不覆盖的范围。
快速开始(无需编程)
-
检查是否已安装 Node.js。 打开终端(在大多数编辑器中:菜单 Terminal → New Terminal;或使用计算机自带的终端应用),输入
node --version并按回车。如果看到版本号(18 或更高),继续下一步。如果看到 "command not found",请从 nodejs.org 安装 LTS 版本,然后重启 VS Code(或你使用的编辑器)。 -
打开 Continue 的配置文件(
config.yaml;在 Continue 面板中,打开设置并选择编辑配置)。 -
粘贴以下内容:
mcpServers: - name: zn-gate type: stdio command: npx args: ["-y", "zn-gate", "mcp"]如果文件中已有
mcpServers:列表,只需将- name: zn-gate条目添加到其中。 -
保存文件。zn-gate 的工具仅在 Continue 的 Agent 模式下可用。
状态:以上步骤依据 Continue 的文档编写;我们尚未在 Continue 中亲自验证。
zn-gate 在 Continue 中保护什么,不保护什么
在 Continue 中,zn-gate 以 MCP 服务器的形式工作:智能体可以请求它检查提示词、工具调用或工具结果(analyze_prompt、check_tool_call、check_tool_result)。由智能体决定何时调用这些工具,因此仅靠这一点并不是自动防护。
| 在 Continue 中 | |
|---|---|
| 智能体可用的 zn-gate 检查(MCP) | 是 |
| 你的其他 MCP 服务器检查提示词注入和密钥 | 是,如果你按下文进行包装 |
阻止读取 .env 和凭据文件 |
否 |
| 从 shell 输出和文件内容中移除密钥 | 否 |
| 阻止将密钥粘贴到聊天中 | 否 |
我们在 Continue 的文档中未发现智能体钩子,因此 zn-gate 在该环境中只能以 MCP 服务器的方式工作。在 Continue 中,zn-gate 不会阻止读取你的 .env 或凭据文件,也不会从 shell 输出或文件内容中移除密钥。如果你目前需要这些功能,请在 Claude Code、Codex CLI、Cursor 或 OpenCode 中使用 zn-gate:参见 compat.md。
技术参考
配置位置
你的 Continue config.yaml(mcpServers 为列表),或项目中 .continue/mcpServers/ 目录下的文件(该目录中的独立文件还需要在顶部包含 name、version 和 schema)。
检查其他 MCP 服务器的输出
要检查你在 Continue 中使用的其他 MCP 服务器的输出,请通过 zn-gate 启动每个本地服务器:将其命令替换为 npx,并在其原始命令和参数前加上 -y zn-gate shield --。例如,通过 uvx mcp-server-fetch 启动的服务器将变为:
mcpServers:
- name: fetch
type: stdio
command: npx
args: ["-y", "zn-gate", "shield", "--", "uvx", "mcp-server-fetch"]
此后,该服务器的每个结果在被智能体看到之前都会经过提示词注入检查,并且 zn-gate 能识别的密钥会被移除。zn-gate init 会为 Claude Desktop、Claude Code、Cursor、Codex 和 OpenCode 自动执行此操作,但不会修改 Continue 的设置。
Continue 文档
- Continue 中的 MCP:https://docs.continue.dev/customize/deep-dives/mcp