Harness Notes

MCP

Updated 2026-11-25,

On this page

How to connect MCP servers to each harness and what their tools can do once connected. The protocol table at the end shows which parts of the MCP specification each client supports.

Setting up a server

QuestionOpenCodechecked at 2.0.29
Add a server

Run opencode mcp add <name> --url <url> for a remote server or opencode mcp add <name> -- <command...> for a local one; --header name=value, --env name=value and --global are available. It writes to the project opencode.json(c) unless --global is given. By hand, add the server under mcp.servers.<name> (V2 no longer puts server names directly under mcp).

Transports

Local servers use stdio and remote servers use Streamable HTTP with an absolute URL. The legacy HTTP+SSE fallback from 1.x is gone, and WebSocket is not supported.

2.1.4 SDK connectClientMcp exposes client-hosted tools through an experimental WebSocket at /api/experimental/client-mcp. OpenCode remains the MCP client; this is not a general MCP-server mode or Tasks support. The host must supply tools/handlers and connection authentication.

Where configs live, and project trust

Servers can be defined in global ~/.config/opencode/opencode.json(c), project opencode.json(c) or .opencode/opencode.json(c) files found from the current directory up to the filesystem root, and the managed system directory or macOS MDM preferences, which win. A higher-precedence file replaces the whole server object with the same name rather than merging fields. Project servers connect without a trust prompt; administrators can block a server with a managed policy on integration.use for mcp:<name>.

Sign in or pass credentials

OAuth is on for every remote server unless "oauth": false: OpenCode discovers the auth server, uses PKCE, refreshes tokens and tries dynamic client registration. Sign in from /mcps or with opencode mcp auth <name>, and sign out with opencode mcp logout <name>; credentials stay out of project config. Pre-registered clients use snake_case client_id, client_secret, scope, callback_port, redirect_uri and auth_server_metadata_url; API keys go in headers or environment with {env:NAME} substitution.

Using its tools

QuestionOpenCodechecked at 2.0.29
Approve, allow or block tools

MCP tools run without asking by default because every agent starts from an allow-all base policy. Add ordered permissions rules on the action <server>_<tool> (globs allowed, resource *) with effect allow, ask or deny, globally or under agents.<id>.permissions. Choosing Allow always saves a project-scoped allow rule.

Since 2.0.30, MCP permission evaluation receives the tool arguments as metadata.input (an empty object when arguments are absent), so permission hooks can inspect the requested input.

Tool search & code mode

Code Mode is the default: MCP tools are not put on the model's native tool list but grouped by server inside the execute JavaScript tool (e.g. tools.context7.resolve_library_id(...)), so many tools don't each cost a tool slot. Set "codemode": false on a server to expose its tools directly, deny tools with <server>_* permission rules, or set "disabled": true.

Denying the execute permission turns Code Mode off.

Output size and timeouts

Timeouts are set under mcp.timeout with per-server overrides: startup 30 s (connect and initialize), catalog 30 s (listing tools, prompts, resources) and execution 12 hours (tool calls, prompts, resource reads). Tool results are truncated at tool_output.max_lines 2000 / max_bytes 51200, with the full output saved to a file for the agent. A call that passes execution fails with a timeout error.

2.2.7 built-in MCP client passes toolDefinition with outputSchema unset to SDK callTool, avoiding SDK output-schema rejection of otherwise completed server actions. Input-schema metadata is still retained. This is a result-validation choice in the concrete client, not Tasks support or an absence claim across plugins/providers. Source inspection only.

Resources

Partly

The agent can list and read server resources with the built-in list_mcp_resources and read_mcp_resource tools, and images or PDFs come back as attachments. There is no @-mention picker for MCP resources in 2.x; prompt attachments only accept file: and data: URIs.

In 2.0.30, tools, prompts, resources and resource-template catalog requests are sent only when the server advertises the corresponding capability; absent capabilities yield empty lists.

Prompts

Yes. Each prompt becomes a command named /<server>:<prompt> (names normalized to letters, digits, _ and -), and space-separated arguments fill the prompt's arguments in order. The list refreshes when the server reports prompt changes.

When a server asks you or the model

Partly

OpenCode 2.1.4 registers form and URL elicitation on its shared core client. Location-preserving callbacks publish form events consumed by TUI and desktop/web input controls. Replies carry typed field values; the backend validates its translated schema subset. Accept and cancel are mapped, with no distinct decline. URL completion follows the negotiated legacy or current flow. Headless completion remains unverified.

In 2.0.30, the client advertises elicitation.form={} and elicitation.url={}; it no longer advertises the nonstandard form.applyDefaults field. How the UI shows default values is unknown.

2.1.4 source initializes supported frontend defaults; earlier blanket frontend-default uncertainty is superseded. Source rendering paths are not passing UI probes.

Running servers

QuestionOpenCodechecked at 2.0.29
Status, enable, reconnect, debug

opencode mcp list shows each server's state (connected, pending, disabled, failed, needs authentication). In OpenCode, /mcps lets you view, connect, disconnect and authenticate servers; for a lasting change set "disabled": true or delete the entry. opencode mcp debug from 1.x no longer exists, and connect errors include the stdio server's last stderr output.

Run the harness as an MCP server

Not supported

No. OpenCode 2.x is only an MCP client and has no MCP server mode. Other tools integrate through its background server's HTTP API instead.

Protocol features

FeatureOpenCodeprotocol 2025-11-25; 2026-07-28 opt-in per server
Roots

Let a server discover the client-approved filesystem roots; this is not the server process working directory.

deprecated in the current spec

Supported

Answers roots/list with the project directory; only on legacy-era connections.

Source
Sampling

Let a server request an LLM interaction through the host, with user review and model preferences.

deprecated in the current spec

Not supported

No sampling capability is declared.

Source
Sampling with tools

Let the sampling loop invoke tools recursively; do not confuse this with ordinary server tool calls.

deprecated in the current spec

Not supported

Source
Elicitation (generic)

Server-originated MCP input requests, distinct from permission approvals, model ask-user tools, generic chat forms or MCP Apps. Check each mode and host separately.

Partly

2.1.4 source traces SDK callback Location preservation -> form.created state -> TUI FormPrompt and desktop/web SessionElicitationDock. Both form and URL modes remain partial: typed values/defaults are represented, backend checks mapped fields, and outcomes map to accept/cancel without distinct decline. No runtime UI or headless interoperability probe.

Source
Form elicitation

Collect typed property-keyed answers using the restricted elicitation schema, with accept/decline/cancel. Schema parsing, UI validation and backend answer validation are separate claims.

Partly

2.1.4 source: TUI and desktop/web forms initialize supported defaults and collect text, number/integer, choices/multiselect and booleans. Backend validation is of the translated subset, not arbitrary JSON Schema. No runtime rendering probe.

Source
URL elicitation

Direct the user to an external interaction without collecting its sensitive data. Acceptance is not completion; track legacy completion notifications separately from current MRTR retry.

Partly

External-link form returns accept or cancel. Legacy server+elicitationId completion settles pending forms; current 2026-07-28 confirms and retries without that notification. Accept does not establish external operation success.

Source
Prompts

Expose reusable, argument-aware server prompts through the client UI.

Supported

Prompts become /<server>:<prompt> commands.

Source
Resources

List and read server-provided context independently from tool execution.

Supported

Available to the agent through list_mcp_resources and read_mcp_resource.

Source
Resource templates

Discover and fill parameterized resource URIs.

Supported

Templates are listed alongside resources; the agent expands uriTemplate before reading.

Source
Argument completion

Complete prompt arguments and resource-template parameters without an LLM call.

Not supported

The connection exposes no completion call.

Source
Progress

Correlate monotonic progress with a request; UI display and timeout extension are separate behaviors.

Partly

Progress keeps long calls alive; it is not displayed.

Source
Cancellation

Cooperatively cancel in-flight protocol requests and propagate intent to the handler.

Supported

Requests carry an abort signal that cancels the in-flight request.

Source
Protocol logging

Deliver correlated server logs through MCP rather than relying on process stderr.

deprecated in the current spec

Not supported

No notifications/message handler; stdio stderr goes to the debug log instead.

Source
Subscriptions

Receive correlated updates over a long-lived request.

Partly

On 2026-07-28 connections the SDK keeps a subscriptions/listen stream for tool, prompt and resource list changes; resource-content subscriptions are not used.

Source
Multi-round-trip requests

Pause a request for sampling, elicitation, or roots input and retry it with opaque request state.

Partly

On 2026-07-28 connections the SDK retries a call after elicitation input; requires protocol set to auto or 2026-07-28, and sampling is not offered.

Source
Tasks (legacy)

Durable polling, status, result, and cancellation state from the 2025-11-25 experimental protocol era.

earlier experimental spec

Not supported

No tasks capability is declared.

Source
Tasks extension

Asynchronous tool results using io.modelcontextprotocol/tasks on 2026-07-28 connections, separate from legacy Tasks and client backgrounding.

separate protocol extension

Not supported

Source-audited at v2.1.4 (68bc26b7da1990ce10ffecfbc1e09eb13aa5d824): local, remote and attached transports share the same SDK adapter, ordinary callTool and final-result conversion. SDK 2.3.1 MRTR support is separate; the adapter installs no Tasks extension driver. Custom independent clients remain unverified.

Source
Events and agent wake-up

External updates that can trigger agent work. ChatGPT Work documents signed webhook subscriptions; Codex has a separate hosted-app event stream. Receiving an event and starting a model turn are separate capabilities.

separate protocol extension

Partly

Since 2.3.0, experimental MCP Events (SEP-3415 draft), confirmed at 2.3.2. Enable experimental.mcp_events (release default off). The concrete client advertises io.modelcontextprotocol/events and exposes events/list and events/stream only when the server advertises that extension. Notifications are correlated by stream request ID. Event-triggered automations additionally require experimental.automations and a push-capable server. No wire or agent-wake runtime probe; this does not establish Tasks support.

Source

Notes and sources

OpenCode, 32 sources
  • Elicitation refreshed at v2.1.3 (bb25a2f4a3f3f04d7c344bec0c0574ea3510b3b1), 2026-10-23; other features retain their 2.0.29/2.0.30 evidence. GitHub latest release points to 1.x, so 2.x tags were checked separately. Source evidence only, not a runtime probe.
  • Tasks extension reviewed 2026-10-24; see docs/research/evidence/mcp-tasks-other-harnesses-2026-10-24.json. Other feature ratings and sourceRevision/observedVersion retain their independently dated audits.
  • 2.2.0 source exposes otherwise Code Mode tools directly when execute is wholly denied, while retaining each tool permission filter. MCP instruction guidance switches to direct-tool guidance in that case. No new sampling, Tasks, or event-protocol support is inferred.
  • 2.2.3+ Claude Agent is a separately registered built-in provider plugin. At 2.2.7 its setup skips workspace-backed locations and environments without a process spawner; its SDK query options disable Claude settings/hooks/skills/tools/auto-memory/auto-compaction and expose OpenCode tools through mcp__opencode__*. OpenCode and Claude standalone MCP, hook and memory contracts are not interchangeable; the Claude binary/host runtime was not probed.
  • 2.3.2 MCP Events source is independently pinned; historical observedVersion/sourceRevision and other protocol ratings retain their audit scope.
Add a server, 3
Transports, 4
Where configs live, and project trust, 4
Sign in or pass credentials, 2
Approve, allow or block tools, 4
Tool search & code mode, 2
Output size and timeouts, 4
Resources, 3
Prompts, 2
When a server asks you or the model, 12
Status, enable, reconnect, debug, 3
Run the harness as an MCP server, 1