> mcp & integrations
opencode extends outward through the Model Context Protocol and a few first-class integrations. MCP servers — local subprocesses or remote HTTP endpoints, declared under the mcp key — give the agent extra tools. Beyond that, opencode wires into GitHub Actions (comment /opencode on a PR), runs language servers for real code intelligence, and hands long prompts to your editor.
// mcp & integrations
5 commands$ ~/.config/opencode/opencode.json$ { "mcp": { "my-remote": { "type": "remote", "url": "https://mcp.example.com", "enabled": true, "headers": { "Authorization": "Bearer {env:MCP_TOKEN}" } } } }$ opencode github install$ { "lsp": true }$ export EDITOR=nvim// faq
How do I add an MCP server to opencode?
Declare it under the mcp key in opencode.json. A local server needs type:"local" and a command array opencode launches as a subprocess; a remote server needs type:"remote" and a url, with optional headers for auth. Set enabled:true, and manage or debug servers with opencode mcp list / opencode mcp debug.
How do I run opencode on a GitHub pull request?
Run opencode github install once to add the GitHub app, create .github/workflows/opencode.yml, and set a provider secret like ANTHROPIC_API_KEY. Then comment /opencode (or /oc) on an issue or PR and the agent responds, makes changes, and pushes a branch, running on your repository's Actions minutes.
Does opencode use language servers (LSP)?
Yes. Set "lsp": true to run built-in language servers — TypeScript, Python, Go, Rust, and around thirty more — so the agent sees real diagnostics, types, and definitions rather than guessing. Servers auto-download on first use; set OPENCODE_DISABLE_LSP_DOWNLOAD=true in offline or locked-down environments and provide them yourself.
How do I disable a specific tool or MCP server?
Use the tools config block: set a tool or server name to false to turn it off, and glob patterns like "my-mcp*" to disable several at once. This is how you keep a noisy or risky MCP server installed but inactive, or strip a built-in tool from a particular agent.