

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: MCP
incomplete
2: Configure MCP
incomplete
3: OAuth
incomplete
4: Code Mode
incomplete
5: Context Bloat
incomplete
This lesson's interactive features are locked, please to keep using them
You configure MCP servers in your OpenCode config:
opencode.jsonc (in the project root)~/.config/opencode/opencode.jsoncIt ends up looking something like this:
{
"$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}",
},
},
},
},
}
Context7 is a remote MCP documentation server that gives current library/framework docs and examples on demand.
Keep credentials out of the file with {env:CONTEXT7_API_KEY}. OpenCode reads the value from the environment when it loads the config.
Most remote MCP servers require authentication of some sort. After all, the big idea behind MCP is usually to provide "programmatic" access to some data or service, and those services are almost always gated behind some kind of auth.
API keys are common for internal/dev tools for their simplicity. They require you to manage the key yourself and don't have a built-in flow for refreshing tokens.
Context7 also offers access without an API key, but at a lower rate limit.
Connect OpenCode to Context7 so it can look up library documentation.
Tell OpenCode to run and submit the CLI tests from the project root. Connection failures carry no penalty.