We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Context Bloat

MCP servers can be useful, but just like everything in LLMs: tool bloat becomes context bloat.

Once you configure an MCP server, OpenCode has to describe its tools to the model. That catalog eats context whether the model calls a tool or not. Disable servers you're not using.

The OpenCode team uses very few MCPs. I'm sure they can be useful occasionally, but you shouldn't add all the integrations that you might possibly ever use. If your agent needs a tool, add it, but too many tools can actually confuse the models.

I have 2 active MCPs, and neither of them is shared across the team. One connects to PostHog so that my agent can read product metrics, and one connects to our marketing tool's API so I can ask it about budgets.

Disable a Server

Luckily, it's super easy to disable an MCP server:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "context7": {
        "type": "remote",
        "url": "https://mcp.context7.com/mcp",
        "disabled": true,
      },
    },
  },
}

Setting disabled: true keeps the configuration but prevents OpenCode from connecting.

Deny Individual Tools

You can also disable individual tools exposed by an MCP server by adding a permission rule:

{
  "$schema": "https://opencode.ai/config.json",
  "permissions": [
    { "action": "context7_query-docs", "resource": "*", "effect": "deny" },
  ],
}

MCP tool actions use the format <mcp-name>_<tool-name>. OpenCode normalizes unsupported characters to underscores. If you need the exact name, literally just ask your agent! The catalog is already in its context.

"List all tool names currently available to you, one per line."

Assignment

Disable Notion while keeping Context7 available.

Tell OpenCode to run and submit the CLI tests from the project root.