Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages/web/src/content/docs/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -731,3 +731,25 @@ These environment variables enable experimental features that may change or be r
| `OPENCODE_EXPERIMENTAL_PARALLEL` | boolean | Enable parallel web search execution |
| `OPENCODE_EXPERIMENTAL_SCOUT` | boolean | Enable Scout subagent |
| `OPENCODE_EXPERIMENTAL_WORKSPACES` | boolean | Enable workspace support |

### mcp add

Register an MCP server from the command line. The existing interactive flow remains available when these options are not supplied.

For a local MCP server, pass environment variables with `--env`. The option can be repeated:

```bash
opencode mcp add postgres \
--env PGUSER=orb \
-- npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb
```

For a remote MCP server, pass its URL with `--url`. HTTP headers can be supplied with `--header`, which can also be repeated:

```bash
opencode mcp add github \
--url https://api.githubcopilot.com/mcp \
--header "Authorization=Bearer {env:GITHUB_TOKEN}"
```

Use `{env:VARIABLE_NAME}` in a header value to reference an environment variable at runtime.