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.
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 |