Guides

Best MCP Servers for OpenCode

OpenCode is built for terminal-first work. It does not need a plugin to read your files or run your tests. The gap MCP fills is narrower: context that lives outside the project directory, primarily the current state of the libraries you are building against.

That is where Context7 fits. It gives OpenCode a way to pull live documentation mid-session, so its answers reflect the API you are shipping against — not a training-time approximation of it.

Recommended OpenCode MCP Servers

OpenCode supports local and remote MCP servers, and those tools show up alongside its built-in tools. That is powerful. It also means every extra server competes for attention.

Use the smallest set that improves your actual day. These categories are the ones that tend to earn their place.

Context7

Up-to-date library documentation and code examples

Use Context7 when the agent is about to touch a package API and you do not want it guessing from memory. It resolves the library, then pulls focused docs and examples for the exact topic.

How Context7 keeps AI tools current

GitHub MCP servers

Issues, pull requests, repository metadata, and hosted code context

This is useful when the real task lives outside the files: a PR comment, a failing workflow, an issue description, or a release note someone forgot to paste into the prompt.

Filesystem MCP servers

Local files, generated artifacts, and project inspection

Filesystem access is basic, but still worth being deliberate about. Give the agent the paths it needs, keep the permissions scoped, and avoid treating the whole machine as context.

Browser and search MCP servers

Fresh web information, changelogs, examples, and vendor docs

Good for fresh facts: a changelog, a release announcement, an issue thread, or a vendor page that changed after the model was trained. Less useful for things already covered by your docs server.

Memory and knowledge MCP servers

Project decisions, long-running work, and repeated team context

Memory is valuable when it stores decisions you would otherwise repeat: why a migration is blocked, which convention the team chose, or what failed last time. It gets messy fast if everything is saved forever.

Database MCP servers

Schema inspection, query debugging, and operational data

Useful when the schema is the truth and the application code is only a hint. Let the agent inspect tables or sample safe data before it writes migrations, joins, or analytics queries.

API and SaaS MCP servers

Workflow automation across tools like Slack, Linear, Notion, or cloud providers

Add these only when they are part of the engineering workflow. A ticketing tool, incident dashboard, or deployment system can be valuable context; a random SaaS integration usually is not.

Keep The Context Budget In Mind

Every MCP server you add is a tool OpenCode has to consider when deciding what to do. That is not free. Too many choices slow things down, increase context usage, and make it harder for the agent to pick the right path — especially in a terminal environment where clarity matters.

A lean setup works better than a comprehensive one. One documentation server, one source of project workflow context if you need it, and nothing else until a specific gap makes itself obvious.

For Context7, the common OpenCode setup command is:

npx ctx7 setup --opencode

Once it is running, prompt OpenCode to check documentation before touching any library-dependent code. The payoff shows up in migrations, generated clients, framework conventions, and SDK configuration — anywhere the version details actually matter.

The pattern that holds up: terminal-native and explicit. Current docs for libraries. Source-control context when the task starts from a PR or issue. Database and browser tools only when the task genuinely needs them.

FAQ

What MCP server should OpenCode users add for documentation?

Use Context7 when OpenCode needs up-to-date package documentation, framework APIs, or examples for the specific library you are using.

How do I install Context7 for OpenCode?

Run npx ctx7 setup --opencode to configure the Context7 MCP server automatically. For headless or CI environments, use npx ctx7 setup --opencode --api-key YOUR_API_KEY. You can also add it manually to your opencode.json or ~/.opencode/config.json file.

How many MCP servers should I add to OpenCode?

OpenCode's own documentation recommends keeping the MCP tool list short to avoid context bloat and unpredictable tool selection. Start with Context7 for library docs and one project-specific server if your workflow needs it. Add more only when you notice a recurring gap.

Does Context7 work with OpenCode in terminal-only environments?

Yes. Context7 runs as a stdio MCP server via npx, which works in any terminal environment. Use API key authentication for non-interactive sessions.