OpenCode
Use this page to add your PolicyArc environment to OpenCode. These steps were run with OpenCode 1.14.28 on 2026-10-12. A tool call from OpenCode has not been run yet.
Config
Copy your gateway URL from the Admin Portal first. Copy your gateway URL shows where it is. Then add this to opencode.json in your project, with your URL in place of https://your-environment.example/gateway/mcp.
{
"mcp": {
"policyarc": {
"type": "remote",
"url": "https://your-environment.example/gateway/mcp",
"enabled": true
}
}
}
Steps
-
From the project directory, list your servers.
opencode mcp listYou see
policyarcmarkedneeds authentication, with your gateway URL under it. -
Sign in.
opencode mcp auth policyarcOpenCode registers itself with your environment, then opens your browser at the sign-in page of the identity provider your environment uses. After you sign in, OpenCode prints
Authentication successful!. -
Run
opencode mcp listagain. You seepolicyarcmarkedconnected.
Under Access Activity in the Admin Portal, the sign-in shows as a /register row followed by /authorize, /callback and /token rows for OpenCode's new client.
If something goes wrong
- If
opencode mcp listprintsNo MCP servers configured, run it from the directory that holdsopencode.json. - To sign out, run
opencode mcp logout policyarc.
Send feedback about this page