OpenCode

Bring production into OpenCode. It answers from your real logs, traces and deploys.

Signs you in, connects your stack and registers the MCP server in OpenCode.

OpenCode runs whichever model you point it at. Polylane gives that model production evidence: logs, metrics and traces from every provider you connect, deploys, and the context graph of your stack. OpenCode already uses code mode for MCP servers, so Polylane's large results stay out of the context window either way.

OpenCode · checkout-edge

> why is checkout returning 502s since this morning?

polylane · searchcheckout errors, recent deploys

polylane · runToolqueryLogs · checkout-edge 5xx, last 6h

polylane · searchcheckout-edge deploys and config changes

The 502s started at 09:14, two minutes after deploy 9f3c2a1 cut the hd-prod Hyperdrive pool from 50 connections to 5. Requests queue for a connection and time out at the edge.

Fix: put max_connections back to 50 in wrangler.jsonc. Want me to make the change?

Critical latency degradation in checkout-edge worker · issue already open in Polylane

Set up Polylane in OpenCode

OpenCode's own CLI adds remote servers, so you don't have to edit JSON by hand.

  1. 1

    Add the server

    Leave off --global to write it to the current project's config instead. polylane setup adds the same remote entry to ~/.config/opencode/opencode.json, editing opencode.jsonc in place if that's the file you have.

    Terminal
    opencode mcp add polylane --global --url https://mcp.polylane.com/mcp
  2. 2

    Sign in

    Remote servers use OAuth by default. Run /mcps in OpenCode, select polylane and sign in, or start the same flow from a shell with opencode mcp auth polylane.

  3. 3

    Use an API key instead

    For CI, set "oauth": false on the entry and add "headers": { "x-api-key": "{env:POLYLANE_API_KEY}" }, so the key stays in the environment instead of the file.

  4. 4

    Check it worked

    opencode mcp list shows polylane as connected. Ask the agent to call searchTools and it lists the tools your workspace exposes.

Try it on a slow query

You ask
> Our Postgres p95 doubled this afternoon. Use Polylane to find the queries that got slower and the code that sends them.
What happens
  1. 1OpenCode asks Polylane for the database's query insights and latency issues over the afternoon.
  2. 2It searches the repository for the slowest query's text and the commit that last changed it.
What comes back
You get the queries ranked by how much slower they got, when each one changed, and the file and commit that issue them, so the model you chose is working from measurements, not guesses.

Things to ask OpenCode

> What's failing in staging right now?

Open issues and error patterns for the staging resources, newest first.

> Which of our services talk to Stripe?

External dependencies come from the context graph and real request logs.

> Is the payments deployment healthy?

Resource health for the Kubernetes workload, with any open issue on it.

> Explain the last investigation on the API.

OpenCode reads Polylane's investigation and summarises its evidence.

One server for your whole stack.

Polylane connects your clouds, observability tools, code and chat into a context graph and serves it over one MCP server. OpenCode gets three tools: searchTools finds the right one, runTool calls it, and runCode chains several in Polylane's sandbox so raw logs and metrics stay out of the context window. How the MCP server works · What code mode is

OpenCode
Polylane MCP
  • searchTools find the right tool
  • runTool call one
  • runCode chain many

Frequently asked questions

Does Polylane care which model OpenCode uses?

No. The server speaks MCP over streamable HTTP and the work happens on Polylane's side, so any model OpenCode supports can call it. Smaller models benefit most from runCode, which returns one answer instead of raw data.

Where does OpenCode store the Polylane sign-in?

Outside your project configuration. OpenCode stores OAuth credentials separately and refreshes them; opencode mcp logout polylane clears them so you can switch accounts.

OpenCode is running over SSH. How do I sign in?

Start the sign-in, approve it in a browser on your laptop, then copy the callback page's URL from the address bar and paste it into OpenCode's sign-in prompt.

Will my comments in opencode.jsonc survive polylane setup?

Yes. The CLI edits opencode.jsonc in place with the same parser OpenCode uses, so comments and formatting are kept. It skips a file OpenCode itself couldn't parse.

Go further

Other agents

Try it with OpenCode. Ask it about production today.