GitHub Copilot 條碼掃描器外掛

為 GitHub Copilot 配備真正的本機條碼解碼器。它能讀取 16 種一維與二維條碼格式,並完整保留前導零,回傳精確的識別碼。

安裝 GitHub Copilot CLI 外掛

需要 Node.js 22.19 以上或 24 以上版本。

  1. 1

    在 GitHub Copilot CLI 中依序執行這兩道指令(可在第一道指令後方加上 #<release-tag> 以鎖定 GitHub Releases 上的特定標籤)。

    Shell
    copilot plugin marketplace add qrcode-ai-com/qrcode-barcode-scanner-plugin
    copilot plugin install qrcode-barcode-scanner@qrcode-ai-com
  2. 2

    啟動工作階段並確認 qrscan 已列出 scan_image。若需使用 scan_file,請在伺服器環境變數中設定 QRSCAN_MCP_ALLOWED_DIRECTORIES。

  3. 3

    試試看,請這樣詢問 GitHub Copilot:

    讀取 barcode-reference.png 中的 Code 128 條碼,並給我完整保留前導零的確切數值。

會同時安裝 qrcode-barcode-scanner 技能與本機 stdio MCP 伺服器。執行 copilot plugin uninstall qrcode-barcode-scanner 即可移除。

在 GitHub 上檢視外掛

在 GitHub Copilot 任務中運用已解碼的條碼

條碼掃描器會回傳確切的識別碼與條碼格式,讓 GitHub Copilot 能核對標籤而無需猜測數字。

在 Copilot CLI 中驗證條碼標籤

於本機解碼 Code 128、EAN-13、UPC-A 與二維條碼測試檔,完整保留確切數字與前導零。

支援選擇性 scan_file 的 stdio MCP

預設僅開放 scan_image(位元組輸入),並僅針對 QRSCAN_MCP_ALLOWED_DIRECTORIES 內的目錄啟用 scan_file。

技能安全防護,零外部查詢

將 MCP 與 SKILL.md 搭配使用,確保識別碼維持原樣字串,完全不呼叫外部零售或庫存 API。

在 GitHub Copilot 中測試條碼圖片

準備好圖片、複製請求提示詞,並比對回傳的內容。

barcode-reference.png

建立 Code 128 條碼,內容填入 STOCK-4827 並儲存為 barcode-reference.png。

請 GitHub Copilot 讀取這張圖片

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

搭配掃描器後,GitHub Copilot 會回傳確切的識別碼與格式,而非憑空猜測。

barcode-reference.png 的範例結果。

GitHub Copilot 條碼掃描器外掛常見問題

安裝方式、條碼格式、前導零保留、本機隱私與 MIT 授權說明。

先執行 copilot plugin marketplace add qrcode-ai-com/qrcode-barcode-scanner-plugin,再執行 copilot plugin install qrcode-barcode-scanner@qrcode-ai-com。

可讀取 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,另外也支援 QR Code。

會。content.text 一律以原樣字串回傳以確保前導零完整保留,且 EAN-13 報告也會解析 14 位數的 GS1 GTIN。解碼過程不會查詢任何外部零售、定價或 ISBN 資料庫。

qrscan 預設僅提供 scan_image(base64 位元組)。若要對允許的本機目錄啟用 scan_file,請在伺服器環境變數中設定 QRSCAN_MCP_ALLOWED_DIRECTORIES 並重新啟動 Copilot CLI。

兩個偵測結果都會回傳在同一份 JSON 報告中,各自標示對應的條碼格式 (symbology) 與確切的 content.text。請檢查每筆偵測結果的格式欄位,而非直接假設索引 0 就是一維條碼。

請先執行 copilot plugin uninstall qrcode-barcode-scanner,再執行 copilot plugin marketplace remove qrcode-ai-com 即可完整移除。

解碼作業完全在本機 Node.js 22.19 以上或 24 以上版本執行(Copilot 會將對話文字傳送至您設定的模型)。目前的 qrcode-barcode-scanner-plugin 與其掃描引擎版本皆免費提供並採用 MIT 授權。

繼續閱讀其他條碼掃描器指南

閱讀通訊協定指南、切換至適用於 QR Code 的 GitHub Copilot 整合,或瀏覽所有條碼整合方案。

條碼掃描器 MCP 伺服器

深入了解 stdio 傳輸機制、scan_image 與 scan_file 的差異、圖片限制與錯誤狀態。

閱讀 MCP 指南

條碼掃描器技能

檢視 SKILL.md、Node 輔助指令碼、結束碼與獨立引擎的安裝方式。

閱讀技能指南