How to add an MCP server to OpenCode
This guide adds MCP servers to OpenCode, using Playwright MCP, Figma MCP Server and Firecrawl MCP Server from the catalog. Playwright MCP runs locally, Figma MCP Server is hosted and connects by URL, and Firecrawl MCP Server runs locally and can take an API key. Every entry goes into an OpenCode config file, and the verify section shows how to check each server. The values come from each listing's install data, and the paths come from OpenCode's own documentation.
Updated Oct 26, 2026 · Built from catalog data; how we rank and grade
Checked against OpenCode's documentation on Oct 26, 2026. Commands and config blocks are generated from the same install data as each listing page.
Before you start
- OpenCode installed and able to start.
- Node.js with npx for local servers that run through npx (check with node --version), or the runtime the server's listing names.
- An API key or account only for servers that need one; hosted servers that sign in with OAuth need an account with that service.
1. Choose a server and see what it needs
OpenCode reads both a global file and a project file, so pick which one should hold each server before you edit anything.
- Playwright MCP: runs locally, no key needed.
- Figma MCP Server: hosted, connect by URL, no key needed.
- Firecrawl MCP Server: runs locally, can take FIRECRAWL_API_KEY.
- Where OpenCode can keep a server: global (~/.config/opencode/opencode.json) and project (opencode.json). Files are merged.
2. Add a local server (Playwright MCP)
OpenCode writes the launch command as a single array under mcp, with a type of local, instead of separate command and args keys.
Add this to opencode.json in the project, or to ~/.config/opencode/opencode.json for every project opencode.json{ "$schema": "https://opencode.ai/config.json", "mcp": { "playwright-mcp": { "type": "local", "command": [ "npx", "-y", "@playwright/mcp@0.0.82" ], "enabled": true } } }3. Add a remote server (Figma MCP Server)
Figma MCP Server is a remote entry with a url and no command array.
Add this to opencode.json in the project, or to ~/.config/opencode/opencode.json for every project opencode.json{ "$schema": "https://opencode.ai/config.json", "mcp": { "figma": { "type": "remote", "url": "https://mcp.figma.com/mcp", "enabled": true } } }- If the server needs OAuth, run opencode mcp auth with the server name.
4. Keep API keys out of the file (Firecrawl MCP Server)
The Firecrawl MCP Server key is wired through an environment block named environment, using OpenCode's own brace syntax such as
{env:FIRECRAWL_API_KEY}.Add this to opencode.json in the project, or to ~/.config/opencode/opencode.json for every project opencode.json{ "$schema": "https://opencode.ai/config.json", "mcp": { "firecrawl-mcp-server": { "type": "local", "command": [ "npx", "-y", "firecrawl-mcp@3.34.1" ], "enabled": true, "environment": { "FIRECRAWL_API_KEY": "{env:FIRECRAWL_API_KEY}" } } } }Set the variable in the shell you start the host from export FIRECRAWL_API_KEY="paste-your-value-here"- Config values accept {env:VARIABLE_NAME} and {file:path}, so a token can stay in your environment. An unset variable becomes an empty string.
- OpenCode expands {env:NAME} in the config, so the value stays in your environment.
- FIRECRAWL_API_KEY (optional): Your API key for Firecrawl.
5. Restart or reload if the server does not appear
If the server is missing after you save
opencode.json, this step covers what the docs say, and what they leave out, about restarting.- The docs do not say whether editing opencode.json needs a restart.
- Each MCP server adds its tool definitions to the model's context, so enable only the ones you need.
Check that it works
OpenCode reports connection status for each server from the shell, and it has a debug command for hosted servers with sign-in trouble.
opencode mcp list- Run opencode mcp list for each server's connection status. For a remote server with sign-in trouble, opencode mcp debug <name> shows auth status and tests connectivity.
Troubleshooting
- A remote server fails to authenticate
- Run opencode mcp auth list, then opencode mcp debug <name>. Source
- An API-key server wrongly starts an OAuth sign-in
- Set "oauth": false on the entry and pass the key in headers. Source
- Too many tools bloat the context
- Disable the server's tools globally with a tools glob and enable them only for the agents that need them. Source
Security notes
- A local server runs with your user account's permissions and can do whatever you can on that machine; read what it does before you add it (MCP's security guidance says the same).
- A remote server receives what the agent sends it. Check who runs it and what the service does with your data.
- Config values accept {env:VARIABLE_NAME} and {file:path}, so a token can stay in your environment. An unset variable becomes an empty string.
- Agent Market does not grade security yet, so a listing page shows no security grade today; read the server's source and permissions yourself (see How we grade security).
Servers and skills in this guide
To go further, browse the listings that name OpenCode as a supported host, or follow a guide for one specific tool.
- 1Playwright MCP
microsoftOfficial
Playwright Tools.
★ 38.6KLast active Oct 22, 2026Local (stdio)Claude Code, Codex, VS Code, Cursor +2
AFreshness: A–Security: not graded yet - 2Figma MCP Server
mcp.figma.comOfficial
The Figma MCP server brings Figma design context directly into your AI workflow.
★ 2.1KLast active Oct 20, 2026Remote (HTTP)Claude Code, VS Code, Cursor, Windsurf
AFreshness: A–Security: not graded yet - 3Firecrawl MCP Server
firecrawlOfficial
Firecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
★ 7.7KLast active Oct 23, 2026Local (stdio), Remote (HTTP)Claude Code, VS Code, Codex, Cursor +2
AFreshness: A–Security: not graded yet
Related
Sources
- MCP servers | OpenCode · fetched Oct 26, 2026
- Config | OpenCode · fetched Oct 26, 2026
- CLI | OpenCode · fetched Oct 26, 2026
Cite this page
How to add an MCP server to OpenCode. Agent Mart. https://agentmart.dev/guides/add-mcp-server-opencode (last updated 2026-10-26)