mcp section of its config file, opencode.json.
Global or per project?
Add the server
OpenCode can read the key from an environment variable, so the key never lands in the config file. Export it in your shell profile:opencode.json
{env:EXTRACT_API_KEY} is replaced with the value of the variable when OpenCode starts. Already have servers configured? Add 2extract as another key inside the existing mcp object.
Because the key comes from the environment, a project-level
opencode.json with this config is safe to commit. Each teammate exports their own key.Verify
Start OpenCode and ask:What is my 2extract balance?
A number comes back, and no proxy was created.
Troubleshooting
OpenCode does not see the server
OpenCode does not see the server
Check that
type is remote, enabled is true, and the URL keeps the /mcp path. Then restart OpenCode - the config is read at startup.Some tools fail, others work
Some tools fail, others work
A scope problem rather than a connection problem. The key is missing the scope those tools need - see Overview.
Next steps
Tools
Everything the agent can call.
Other clients
Any other MCP client.