Continue 条形码扫描器 MCP 配置

为 Continue 配备真正的本地条形码解码器,支持识别 16 种一维与二维条形码格式,原样返回准确编号与前导零。

在 Continue YAML 中添加 qrscan

需要 Node.js 22.19+ 或 24+。

  1. 1

    使用 cn CLI 时,将该 mcpServers 配置项添加到 ~/.continue/config.yaml;在 IDE 工作区中,则可将其保存为 .continue/mcpServers/qrscan.yaml。

    Text
    name: QR Code and Barcode Scanner
    version: 0.3.5
    schema: v1
    mcpServers:
      - name: qrscan
        type: stdio
        command: npx
        args:
          - --yes
          - --ignore-scripts
          - "@qrcode-ai-com/qrcode-barcode-scanner-mcp"
        env:
          QRSCAN_MCP_ALLOWED_DIRECTORIES: /absolute/path/to/images
        connectionTimeout: 60000
  2. 2

    将 Continue 切换至 Agent 模式(或在无头 cn -p 命令中传入 --allow scan_file),确认 qrscan 在 60 秒超时窗口内成功加载。

  3. 3

    测试一下,向 Continue 提问:

    请读取 barcode-reference.png 中的 Code 128 条形码,并返回完整编码值,务必保留前导零。

Continue 仅支持配置 MCP 服务器(无 Skill 目录)。设置 connectionTimeout: 60000 可为首次 npx 拉取依赖留出一分钟时间,避免触发 Continue 默认的 20 秒超时。

在 npm 查看 MCP 包

在 Continue 任务中使用解码后的条形码

条形码扫描器返回准确的编码值与条码格式,让 Continue 精准核对标签而不再猜测数字。

在 Agent 模式下校验条码标签

在 Continue 中本地解码 Code 128、EAN-13、UPC-A 及二维条码测试样本,完整保留每一位数字和前导零。

CLI 与工作区 YAML 路径区分

cn CLI 请将 qrscan 写入 ~/.continue/config.yaml,IDE 工作区配置则可存放在 .continue/mcpServers/qrscan.yaml。

无头 cn -p 自动化脚本

搭配 --allow scan_file 运行 cn -p 执行可复现的标签校验,将商品信息查询留给外部业务系统处理。

在 Continue 中实测条形码图片

准备好图片,复制示例请求,再核对返回的解码内容。

barcode-reference.png

生成 Code 128 条形码,填入 STOCK-4827 并保存为 barcode-reference.png。

让 Continue 读取图片

Text
Read barcode-reference.png with Barcode Scanner.
Return the complete identifier as text and its format.
Preserve leading zeros. Do not run external lookups.
If the tool is unavailable or detects nothing, report that
instead of guessing.
预期结果 · Code 128
STOCK-4827

接入扫描器后,Continue 会返回准确的条形码编号及其格式,而不再依赖猜测。

barcode-reference.png 的示例输出结果。

Continue 条形码扫描器 MCP 配置常见问题

安装路径、条形码格式、前导零保留、本地隐私保护及 MIT 许可说明。

不需要。Continue 仅支持配置 MCP 服务器且无 Skill 目录,因此只需在 YAML 配置中添加 stdio MCP 服务器(@qrcode-ai-com/qrcode-barcode-scanner-mcp)即可。

cn CLI 从 ~/.continue/config.yaml 读取 mcpServers 配置,并会忽略工作区内的 .continue/mcpServers/ 文件;Continue IDE 工作区则可以将配置存放在 .continue/mcpServers/qrscan.yaml。

首次使用 npx 启动时会从 npm 下载 MCP 软件包与原生解码引擎,耗时可能超过 Continue 默认的 20 秒上限。设置 60,000 毫秒可为首次启动预留完整一分钟。

支持解码 16 种条形码格式:Code 128、Code 39、Code 93、EAN-13(含图书 ISBN)、EAN-8、UPC-A、UPC-E、ITF、Codabar、Telepen、GS1 DataBar、GS1 DataBar Expanded、Data Matrix、PDF417、Aztec 和 MaxiCode,同时也支持二维码。

是的。content.text 始终以原样字符串返回并完整保留前导零,EAN-13 报告还会同步解析 14 位 GS1 GTIN。解码过程不会查询任何外部零售、价格或 ISBN 数据库。

Continue 仅在 Agent 模式下调用 MCP 工具。在无头 cn -p 命令中,请在指定 --config ~/.continue/config.yaml 的同时显式添加 --allow scan_file 以放行工具调用。

从 ~/.continue/config.yaml 中删去 qrscan 条目,或直接移除 .continue/mcpServers/qrscan.yaml 即可。解码通过开源 MIT 许可的 @qrcode-ai-com/qrcode-barcode-scanner-mcp 在本地 Node.js 22.19+ 或 24+ 运行,免费开放且独立于 QR Code AI 付费套餐。

继续阅读其他条形码扫描器指南

阅读协议指南、切换到 Continue 二维码指南,或浏览所有条形码集成方案。

条形码扫描器 Skill

查阅 SKILL.md、Node 辅助脚本、退出码说明以及独立的原生引擎配置方式。

阅读 Skill 指南