Connect OpenCode to Agent Authority
Connect OpenCode to SecureAuth Agent Authority
Open-source AI coding assistant in the terminal. Once connected, OpenCode reaches every tool your organization has approved through a single governed endpoint — every call authenticated, policy-checked, and audited.
Setup
- Add the MCP server — Add the following to
opencode.jsonin your project (or~/.config/opencode/opencode.jsonfor global):
{
"mcp": {
"secureauth": {
"type": "remote",
"url": "https://your-gateway-url/gateway/mcp"
}
}
}- Authenticate
opencode mcp auth secureauth- Start OpenCode
opencodeThe agent is auto-registered on first connect.
Connecting to just one MCP?To stay under an agent's tool limit, point the URL at a single MCP —
/gateway/mcp/{slug}instead of/gateway/mcp. Grab the exact URL from the resource's detail page; see Scope a connection to one MCP.
Next steps
- Create a policy — control which tools OpenCode can call.
- Monitor activity — watch its tool calls appear in the dashboard and audit log.
- Audit log — filter and search every tool call OpenCode makes.