Skip to main content

Overview

MCP (Model Context Protocol) servers add external tools to OpenCode. Configure local command-based servers or remote HTTP servers with optional OAuth authentication.

Local MCP Server

Local Server Options

Remote MCP Server

Remote Server Options

OAuth Configuration

Per-Agent MCP Tools

Restrict MCP tools to specific agents:
This disables MCP tools globally but enables them only for the researcher agent.

Registry Shorthand

In registry component manifests, remote MCP servers use URL shorthand:
This expands to { "type": "remote", "url": "https://...", "enabled": true }.

See Also