在 Chrome 中啟用 WebMCP
Chrome 為 WebMCP 提供本機測試 flag。Relaunch 瀏覽器後變更才會生效。
chrome://flags/#enable-webmcp-testing開啟 WebMCP flag
將 chrome://flags/#enable-webmcp-testing 貼到 Chrome 網址列,然後按下 Enter。
將 flag 設為 Enabled
Chrome 會直接開啟 WebMCP 測試 flag。請在下拉式選單中選擇 Enabled。
使用 Relaunch 重新啟動 Chrome
按一下 flags 頁面底部的 Relaunch 按鈕,讓 Chrome 重新啟動並啟用 WebMCP。
返回並再次檢查
Chrome Relaunch 後重新開啟此頁面。上方的支援檢查現在應該能找到 document.modelContext。
如果仍未偵測到 WebMCP
找不到 API 不一定表示瀏覽器不支援 WebMCP。下結論前,請先檢查執行環境。
使用 Relaunch 完整重新啟動 Chrome
變更 flag 後必須 Relaunch 瀏覽器;只重新整理分頁不會生效。
使用 HTTPS 或 localhost
WebMCP API 只會在安全內容中公開。一般 HTTP 頁面無法通過檢查。
檢查頁面內容
跨來源 iframe 需要 tools 權限,停用來源隔離的頁面無法使用 WebMCP。
如果沒有該 flag,請更新 Chrome
flag 的可用性會隨 Chrome 開發進度變化。請使用最新的 Chrome 版本,並在 Chrome Status 查看目前推出進度。
支援檢查會尋找 document.modelContext.registerTool。它不會偵測 AI Agent、驗證 tools 權限,也不會確認目前頁面是否已註冊 tools。
試用支援 WebMCP 的頁面
檢查通過後,開啟一個示範或開發工具,查看它公開的結構化操作。
Chrome WebMCP 常見問題
Chrome 支援 WebMCP 嗎?
從 Chrome 149 起,Chrome 透過 Origin Trial 提供 WebMCP;本機開發和測試也可以使用 chrome://flags/#enable-webmcp-testing flag。
如何在 Chrome 中啟用 WebMCP?
在 Chrome 中開啟 chrome://flags/#enable-webmcp-testing,將 WebMCP for testing 設為 Enabled,然後 Relaunch 瀏覽器。接著返回此頁面,檢查 document.modelContext 是否可用。
為什麼啟用 flag 後仍未偵測到 WebMCP?
請確認 Chrome 已完整 Relaunch,重新載入頁面,並使用 HTTPS 或 localhost。如果停用來源隔離,或權限政策阻止嵌入式 frame 使用 tools,WebMCP 也可能無法使用。
檢查成功是否表示已安裝 AI Agent?
不是。檢查只確認此頁面可以存取 WebMCP 瀏覽器 API,不會偵測 AI Agent、確認 tools 權限,也不能證明頁面已註冊任何 tools。