Skip to main content
Watch: I Built an AI App Without Leaving Databricks

MCP client - Anomaly - verified

How to add an MCP server to opencode

Where to add MCP servers in opencode: mcp.servers in opencode.json(c) or .opencode/opencode.json(c) in the project, or ~/.config/opencode/opencode.json(c) globally; or opencode mcp add. Its docs list support for stdio and Streamable HTTP. They do not state SSE. It handles OAuth sign-in for remote servers.

opencode homepage - OpenCode in our tools directory - Compare all MCP clients

Kind
Coding agent
stdio
Yes
Streamable HTTP
Yes
SSE
Not stated

Add a server

Where the config lives
mcp.servers in opencode.json(c) or .opencode/opencode.json(c) in the project, or ~/.config/opencode/opencode.json(c) globally; or opencode mcp add

The example from the opencode docs, copied verbatim. Swap in your server's name, command or URL.

JSON
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "my-server": {
        "type": "local",
        "command": ["npx", "-y", "example-mcp-server"],
      },
    },
  },
}

Source: opencode.ai/v2/docs/mcp-servers

Which server?

Pick a server from the verified directory of official MCP servers. Each one lists its transport, auth and the setup snippets its vendor publishes, so you can match it to what opencode supports.

MCP support

What the opencode docs say it supports. Not stated means the docs do not say either way.

opencode MCP features, transports and OAuth, each with its source
FeatureValueSource
ToolsCalls the functions a server exposes.Yesopencode.ai/v2/docs/mcp-servers
ResourcesReads data and files a server exposes as resources.Yesopencode.ai/v2/docs/mcp-servers
PromptsOffers a server's prompt templates to the user.Yesopencode.ai/v2/docs/mcp-servers
SamplingLets a server ask the client's model for a completion.Not statedDocs do not say
RootsTells a server which directories it may work in.Not statedDocs do not say
ElicitationLets a server ask the user for input mid-task.Yesopencode.ai/v2/docs/mcp-servers
DiscoveryPicks up tools, prompts or resources a server adds or removes while connected.Not statedDocs do not say
InstructionsUses the instructions a server sends when it connects.Yesopencode.ai/v2/docs/mcp-servers
stdioStarts a local server as a subprocess.Yesopencode.ai/v2/docs/mcp-servers
Streamable HTTPConnects to a remote server over the current HTTP transport.Yesopencode.ai/v2/docs/mcp-servers
SSEConnects over the older HTTP+SSE transport.Not statedDocs do not say
OAuthSigns in to remote servers with OAuth.Yesopencode.ai/v2/docs/mcp-servers

Worth knowing

OpenCode v2 places servers under mcp.servers and uses the legacy initialize handshake by default, with an opt-in protocol setting for the 2026-07-28 MCP revision.

FAQ

Where is the opencode MCP config?

mcp.servers in opencode.json(c) or .opencode/opencode.json(c) in the project, or ~/.config/opencode/opencode.json(c) globally; or opencode mcp add. The example on this page is copied from https://opencode.ai/v2/docs/mcp-servers

Does opencode support remote MCP servers over Streamable HTTP?

Yes, per https://opencode.ai/v2/docs/mcp-servers. Its docs list support for stdio and Streamable HTTP. They do not state SSE.

Does opencode support OAuth for MCP servers?

Yes. It handles OAuth sign-in for remote servers. Source: https://opencode.ai/v2/docs/mcp-servers

Which MCP features does opencode support?

Its docs list Tools, Resources, Prompts, Elicitation and Instructions. They do not state Sampling, Roots and Discovery.

Sources

Last verified from the pages below.

Newsletter

New MCP servers, the week they ship

One email per week. New official MCP servers, the coding tools that support them and how developers wire them up.