Serverdex · client guide
MCP servers for OpenCode
What OpenCode supports
from the docs, 21 November 2026Transports: stdio ("type": "local", command array) and Streamable HTTP ("type": "remote", absolute url). No SSE option is documented.. Remote servers and auth: Yes — "type": "remote" + url; OAuth (PKCE, CIMD → DCR → pre-registered client) is on by default, set "oauth": false for API-key/header credentials.. Full matrix with every client on /mcp-clients.
Where the configuration lives
- Config file: opencode.jsonc (or opencode.json) with "$schema": "https://opencode.ai/config.json"; servers go under mcp.servers — V2 does not place server names directly under mcp.
- Global (every project): ~/.config/opencode/opencode.json(c).
- Project: <project>/opencode.json(c) or <project>/.opencode/opencode.json(c); a higher-precedence project config replaces the entire server object with the same name.
- `opencode mcp add <name> --url <url>` writes to the project configuration; add --global to write to the global configuration.
- In the app, /mcps views, connects, disconnects or authenticates servers; `opencode mcp list` shows connection state from any project.
- OAuth credentials are stored outside project configuration; `opencode mcp logout <name>` removes them.
Add a server to OpenCode
Local server (stdio) — opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"everything": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-everything"],
"cwd": ".",
"environment": {
"LOG_LEVEL": "info",
"MCP_API_KEY": "{env:MCP_API_KEY}",
},
},
},
},
}Remote server (Streamable HTTP) with header credential — opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp",
"oauth": false,
"headers": {
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}",
},
},
},
},
}CLI — add a remote or local server
opencode mcp add context7 --url https://mcp.context7.com/mcp
opencode mcp add context7 --global --url https://mcp.context7.com/mcp
opencode mcp add everything -- npx -y @modelcontextprotocol/server-everything
opencode mcp add everything --env LOG_LEVEL=info -- npx -y @modelcontextprotocol/server-everything
opencode mcp listFor a specific server, open its Serverdex page: the “Connect this server” block has the config with the real package name, arguments and environment variables from the registry. Any server, any client: MCP config generator.
Hosted (remote) servers in OpenCode
- Run `opencode mcp add <name> --url https://.../mcp` from the project that should use it (add --global for every project), then `opencode mcp list` to check the connection.
- Or add it by hand under mcp.servers with "type": "remote" and an absolute Streamable HTTP "url".
- Remote servers use OAuth by default: if the list shows "needs authentication", open OpenCode, run /mcps, select the server and sign in — or run `opencode mcp auth <name>`.
- For API-key or header credentials, set "oauth": false and put the header in "headers" using {env:NAME} substitution; on the CLI pass --header 'KEY={env:NAME}' (quoted so the shell writes it literally).
- Over SSH or in a container the browser cannot reach OpenCode: copy the failed callback URL (http://127.0.0.1:<port>/callback?code=...&state=...) and paste it into the sign-in prompt.
Hosted servers that answered the Serverdex live check with no credentials at the last pass (most-starred first; full list with check times):
Browser Use
browser-use
Browser agents and stealth cloud browsers for AI: run web tasks, fill forms, extract data.
Labelhead Artist Momentum
paperclipai
Trending hip-hop artist momentum scores across four cultural dimensions.
Front-End Checklist
thedaviddias
Review frontend code and live pages against 386 quality-gated web development rules.
Context7
upstash
Up-to-date docs for AI agents
Tldraw
tldraw
Draw and visually collaborate with your agents on tldraw's canvas.
Oh My Posh Validator
JanDeDobbeleer
Validate oh-my-posh configurations and segment snippets against the official schema.
Compiler Explorer
compiler-explorer
Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
GitDiagram
ahmedkhaleel2004
Architecture diagrams, explanations and Mermaid source for public GitHub repositories.
Spree Commerce developer docs for AI agents
spree
Spree Commerce docs for AI coding agents: build headless B2B and marketplace ecommerce on its APIs.
AIHOT
KKKKhazix
Chinese AI news: search topics, explore hot events, and read daily, weekly and monthly briefs.
Finance Database
JerBouma
Equities, ETFs, indices, currencies and cryptos, categorised.
Firecrawl MCP Server
firecrawl
Firecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
Find servers for OpenCode by job or by product
Every server page carries the config in the OpenCode shape, the repository's last push and licence, and the live-check result.
Best MCP servers by categoryMCP servers by productComparisonsRemote servers answering now
What the docs say to watch for
- Use {env:NAME} for environment substitution; shell expressions such as $NAME are not expanded in JSON strings.
- Use "disabled": true to keep a server configured without connecting — there is no "enabled" field.
- Timeouts (milliseconds) under mcp.timeout or per server: startup 30 s, catalog 30 s, execution 12 hours by default.
- Tool names become <server>_<tool> (characters other than letters, numbers, _ and - are replaced with _); MCP prompts become commands named <server>:<prompt>. Code Mode is the default — set "codemode": false to expose tools directly on the provider's native tool list.
- Resources are read through the built-in list_mcp_resources and read_mcp_resource tools (permission actions opencode_list_mcp_resources / opencode_read_mcp_resource). Server instructions are appended to the system prompt inside <mcp_instructions>. Elicitation requests are shown as a form (or a link for URL requests).
- Protocol: "legacy" (default, up to revision 2025-11-25), "auto" (probes server/discover for 2026-07-28, falls back) or "2026-07-28". "pool": true shares one connection across directories (2026-07-28 connections only); a shared connection has no roots.
- OAuth client identification order: pre-registered oauth.client_id → CIMD (https://opencode.ai/oauth/opencode/client.json) → DCR; a custom redirect_uri disables CIMD. MCP tools consume model context, so add only the servers you need.
- Disconnecting a server in /mcps does not change configuration; to remove a server delete its entry from the config file where it was added.
Server not showing up or stuck on loading tools? The troubleshooting guide goes through the causes in order.
OpenCode and MCP: questions people ask
- Where is the OpenCode MCP config file?
- Config file: opencode.jsonc (or opencode.json) with "$schema": "https://opencode.ai/config.json"; servers go under mcp.servers — V2 does not place server names directly under mcp. Global (every project): ~/.config/opencode/opencode.json(c). Project: <project>/opencode.json(c) or <project>/.opencode/opencode.json(c); a higher-precedence project config replaces the entire server object with the same name. `opencode mcp add <name> --url <url>` writes to the project configuration; add --global to write to the global configuration. In the app, /mcps views, connects, disconnects or authenticates servers; `opencode mcp list` shows connection state from any project. OAuth credentials are stored outside project configuration; `opencode mcp logout <name>` removes them.
- Does OpenCode support remote (hosted) MCP servers?
- Yes. Run `opencode mcp add <name> --url https://.../mcp` from the project that should use it (add --global for every project), then `opencode mcp list` to check the connection. Or add it by hand under mcp.servers with "type": "remote" and an absolute Streamable HTTP "url". Remote servers use OAuth by default: if the list shows "needs authentication", open OpenCode, run /mcps, select the server and sign in — or run `opencode mcp auth <name>`. For API-key or header credentials, set "oauth": false and put the header in "headers" using {env:NAME} substitution; on the CLI pass --header 'KEY={env:NAME}' (quoted so the shell writes it literally). Over SSH or in a container the browser cannot reach OpenCode: copy the failed callback URL (http://127.0.0.1:<port>/callback?code=...&state=...) and paste it into the sign-in prompt. Transports per its docs: stdio ("type": "local", command array) and Streamable HTTP ("type": "remote", absolute url). No SSE option is documented.; remote and auth: Yes — "type": "remote" + url; OAuth (PKCE, CIMD → DCR → pre-registered client) is on by default, set "oauth": false for API-key/header credentials..
- Which MCP features does OpenCode support?
- Per its own documentation (read https://opencode.ai/docs/mcp-servers/): tools documented, resources documented, prompts documented, elicitation documented, roots not stated, sampling not stated. "Not stated" means the docs are silent, not that the feature is missing.
- Which MCP servers should I add to OpenCode first?
- Pick by the job you need done: the Serverdex guides rank servers by GitHub stars within each category, with last push, licence and live check for each, and the product pages list every server for a given tool (Postgres, Notion, Slack, GitHub…). The hosted servers on this page answered our credential-free MCP handshake at the last check. Then copy the config from the server's page in the OpenCode shape.
Sources
- MCP servers | OpenCode — read 21 November 2026
- Config | OpenCode — read 21 November 2026
- Intro | OpenCode — read 21 November 2026
Other clients: Claude Desktop · Claude Code · Cursor · VS Code · Cline · Windsurf · Zed · JetBrains AI Assistant · Continue · OpenAI Codex CLI · Antigravity · Hermes Agent · LM Studio · Gemini CLI.