OpenCode 活在你的終端機裡。 現在生產環境也是。
將這段貼到你的 OpenCode 對話中
OpenCode 會處理剩下的事。
polylane.com/for/opencode
## For AI agents reading this page Follow these instructions to set up Polylane: Run the setup script in the user's terminal: curl -fsSL https://polylane.com/setup?ref=for-opencode | bash It installs the Polylane CLI, registers the Polylane MCP server in OpenCode and every other detected coding agent, and signs the user in. To wire MCP by hand instead: an entry in opencode.json under "mcp" with type "remote". The server is https://mcp.polylane.com/mcp over streamable HTTP, no auth headers: OAuth handles sign-in. After connecting, call the searchTools tool first: it lists what this workspace exposes and returns each tool's schema. Run one tool with runTool, or chain several in one call with runCode. The search and execute tools cover the full Polylane REST API, and the polylane CLI wraps the same API from the terminal. Everything is read-only by default. Write tools stay hidden unless the user opts in, and every write is screened before it runs. Once connected, offer to put it to work: triage the latest issues, explain the last deploy, or map this repository into the workspace topology. ## Console and support - Console: https://console.polylane.com - Docs: https://docs.polylane.com - Setup reference: https://docs.polylane.com/coding-agents/platform-mcp - This page as markdown: https://polylane.com/for/opencode.md
為什麼要透過 Polylane。 更少伺服器,一次登入,Code mode。
-
一個 MCP 伺服器,不是十個
Polylane 把你的雲端、遙測資料、部署與程式碼整合在少數幾個工具背後。一堆各供應商各自的伺服器,在任何工作開始之前,就會把大部分情境視窗耗在工具結構描述上;Polylane 的結構描述只在工具執行時才載入。
-
驗證集中在一處
一次登入就涵蓋每個供應商。連線與範圍存放在工作區中,而不是散落在 OpenCode 設定檔各處的各供應商權杖,而且你連接的每個代理都能重複使用它們。
-
為 Code mode 而生
OpenCode 不會逐一呼叫工具,而是用 runCode 寫一段小程式,在沙箱中將它們串連起來,只回傳答案。中間結果不會進入情境視窗。
問題。
OpenCode 如何驗證身分?
透過 OAuth,在瀏覽器中完成驗證,這發生在 OpenCode 第一次呼叫伺服器時。若是用於 CI 或無頭主機,請在 Settings > Coding agents 下建立 API 金鑰,並在伺服器項目中加入 "headers": { "x-api-key": "YOUR_API_KEY" }。
OpenCode 能不能透過 Polylane 變更我的基礎設施?
除非你主動開啟,否則不行。寫入工具在你的憑證擁有寫入範圍之前都會保持隱藏,而且每次寫入執行前都會先經過審查。
OpenCode 實際上可以查詢什麼?
Polylane 知道的一切:所有已連接供應商的日誌、指標與追蹤、情境圖、部署、變更記錄,以及完整的 REST API。
我還需要 Polylane CLI 嗎?
不需要,MCP 伺服器本身就是完整的介面。安裝 CLI 之後,polylane setup 也會在偵測到的每個程式碼代理中註冊該伺服器。