opencode_mcp_add
Add an MCP server dynamically to OpenCode, optionally scoping it to a project directory, to extend OpenCode with new MCP capabilities without manual configuration.
Instructions
Add an MCP server dynamically to opencode.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"config": "<config>"
},
"name": "opencode_mcp_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| config | Yes | ||
| directory | No | Project directory to target. Optional; defaults to the server default project. |