MCP Servers

Define Model Context Protocol servers that opencode connects to.

Local (stdio) MCP server

[opencode.mcp_servers.daedra]
type = "stdio"
command = "daedra"
args = ["serve", "--transport", "stdio", "--quiet"]

Remote MCP server

[opencode.mcp_servers.context7]
type = "remote"
url = "https://mcp.context7.com/mcp"

With environment variables

[opencode.mcp_servers.tavily]
type = "stdio"
command = "bunx"
args = ["tavily-mcp"]
env = { TAVILY_API_KEY = "$TAVILY_API_KEY" }

With timeout

[opencode.mcp_servers.shannon-thinking]
type = "stdio"
command = "bunx"
args = ["server-shannon-thinking"]
timeout = 60

Fields reference

FieldTypeRequiredDescription
typestdio | remoteyesTransport type
commandstringstdio onlyBinary to execute
argsstring arrayArguments to pass
urlstringremote onlyServer URL
envtableEnvironment variables for the process
enabledbooleanEnable/disable (default: true)
timeoutintegerTimeout in seconds

Generated output

Local MCP servers emit command as a single array:

{
  "daedra": {
    "type": "local",
    "command": ["daedra", "serve", "--transport", "stdio", "--quiet"],
    "enabled": true
  }
}