Short answer
Run OpenCode against your server in a pytest test and assert on the recorded tool calls. With SineFrame M3:
- Install the M3 CLI with uv tool install sf-m3-cli, then run m3 init and m3 setup.
- Select the opencode harness and a provider-prefixed model, such as anthropic/, openai/ or opencode/.
- Provide the matching key: ANTHROPIC_API_KEY, OPENAI_API_KEY or OPENCODE_API_KEY.
- Assert on the recorded call with expect(result).to_have_tool_call(...).
- Pin the version with m3 test --runtime managed --harness opencode@VERSION=MODEL.
How does M3 run OpenCode?
M3 drives OpenCode through a native adapter named opencode. It starts OpenCode’s server with opencode serve, creates a session, and connects your MCP server to it. Startup and session creation each have their own timeout, and the MCP timeout applies per server.
The managed runtime downloads the OpenCode version you name from its GitHub releases; on Linux, settings choose the C library and CPU variant. Settings from your own OpenCode installation are not copied into the test.
Pinning uses the same harness selector as the other agents: --runtime managed with opencode@VERSION=MODEL.
Which credentials does OpenCode need?
M3 chooses the key from the model’s provider prefix: a model starting with opencode/ uses OPENCODE_API_KEY, openai/ uses OPENAI_API_KEY, and anthropic/ uses ANTHROPIC_API_KEY. Map a different source variable with credential_env or --credential-env, and only the variables you map reach the agent.
Why does OpenCode call MCP servers more often?
With the same model, Claude Haiku 5.5, OpenCode scored 82.0% across 21 MCP servers, against 65.4% for Claude Code. On servers that do something no agent has a built-in tool for, the agents were within a few points of each other. The difference was on servers that overlap a built-in tool: OpenCode 66.3%, Claude Code 34.5%.
In 1,239 trials OpenCode never called a built-in web search tool; its only web built-in was webfetch. For a question that needs a search, your MCP server is the only search it has, which is why it scored 96% on the Exa server while Claude Code and Codex scored 11%. On file and shell servers every agent has a built-in alternative, and OpenCode’s lead shrinks to between 8 and 37 points.
- 21 servers, same model: OpenCode 82.0%, Claude Code 65.4%.
- Should-call trials where OpenCode skipped the server: 16.1% (Claude Code 36.5%, Codex 44.5%).
- Exa search server: OpenCode 96%, Claude Code and Codex 11%.
What should I know about OpenCode traces?
OpenCode returns a turn in one response, so a turn that times out has no messages or tool calls in its trace. Give agent tests a timeout with room to spare. Its observations are timestamped when M3 receives them rather than on the agent’s own clock.
Agent-driven elicitation is documented for Codex and Pi, not OpenCode, and m3 lint’s harness rules cover Claude Code and Codex. Test those paths through Codex or Pi.
Frequently asked questions
- Is OpenCode better at using MCP servers than Claude Code?
- With the same model it called servers more often in our runs, 82.0% against 65.4% across 21 servers, mostly because it has no built-in web search to fall back on. On servers no agent has a built-in alternative for, the two were close.
- Which models can I test OpenCode with?
- Any model OpenCode supports, named with its provider prefix. M3 uses the prefix to decide which API key to pass: anthropic/, openai/, or opencode/.
Related
Try it on your own MCP server
SineFrame M3 is free and open source (Apache-2.0). Direct tests need no model or API key, and runs stay on your machine unless you publish them.