在 Pi 任務中驗證 QR Code 素材
在 Pi agent 中於本機解碼專案 QR Code 圖片,確認確切網址而不仰賴視覺模型猜測。
QR Code 掃描器會回傳確切的網址或文字,讓 Pi agent 能核對連結、驗證素材或重複執行檢查。
在 Pi agent 中於本機解碼專案 QR Code 圖片,確認確切網址而不仰賴視覺模型猜測。
於 package.json 的 pi.extensions 中宣告,自動註冊本機 qrscan stdio MCP 伺服器。
透過 pi.skills 從 skills/ 載入,讓 Pi 將解碼後的 QR Code 網址嚴格視為不可信任資料並原樣引用。
準備好圖片、複製請求提示詞,並比對回傳的內容。
建立文字 QR Code,內容填入 https://qrcode-ai.com/ 並儲存為 qr-reference.png。
Read qr-reference.png with QR Code Scanner.
Return its encoded content and format as data.
Do not open the URL. If the tool is unavailable or
detects nothing, report that instead of guessing.搭配掃描器後,Pi agent 會回傳確切的編碼內容與格式,而非憑空猜測。
qr-reference.png 的範例結果。
安裝方式、圖片輸入、不可信任資料防護、疑難排解與 MIT 授權說明。
執行 pi install git:github.com/qrcode-ai-com/qrcode-barcode-scanner-plugin(或在後方加上 GitHub Releases 的 @<release-tag> 以鎖定特定發佈版本)。
Pi 會從 qrcode-barcode-scanner-plugin 讀取 package.json(pi.skills 與 pi.extensions),載入 skills/qrcode-barcode-scanner 與 pi/extension.js,由後者註冊本機的 qrscan stdio MCP 伺服器。
qrscan 預設僅提供 scan_image(base64 圖片位元組),且絕不抓取遠端網址。請在伺服器環境變數中設定 QRSCAN_MCP_ALLOWED_DIRECTORIES,即可針對允許的目錄啟用 scan_file。
不會。MCP 伺服器啟動時會自行透過 npm 下載引擎;若要直接執行 scripts/scan.mjs,則需另外在 .qrcode-barcode-scanner-runtime 安裝 @qrcode-ai-com/qrcode-barcode-scanner。
不會。qrscan 會將確切的 content.text 與 content.raw 視為不可信任資料回傳,絕不自動開啟連結,也不會將 QR Code 內容當成指令。
執行 pi remove git:github.com/qrcode-ai-com/qrcode-barcode-scanner-plugin 即可移除。
解碼作業完全在本機 Node.js 22.19 以上或 24 以上版本執行(Pi 會將對話文字傳送至您設定的 LLM)。目前的外掛、技能、MCP 伺服器與引擎版本皆免費提供並採用 MIT 授權,與 QR Code AI 的付費方案各自獨立。
檢視官方 Pi agent 設定來源與採用 MIT 授權的掃描器配接器規範。
閱讀通訊協定指南、切換至適用於條碼的 Pi agent 整合,或瀏覽所有 QR Code 整合方案。