mcp_register
Register a new MCP server in your opencode.json by specifying its name and command. Optionally set environment variables and enable status.
Instructions
Register a new MCP server in opencode.json.
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>",
"command": "<command>"
},
"name": "mcp_register"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | JSON object of env vars to set. | {} |
| name | Yes | Server name (used as the mcp section key). | |
| command | Yes | Space-separated command + args, e.g. "uvx my-tool-mcp". | |
| enabled | No | Whether the server starts enabled. | |
| config_path | No | Optional path to opencode.json (default: auto-discover). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |