docs(cli): document non-interactive mcp add flags#32267
Conversation
`opencode mcp add` gained non-interactive flags (--url, --header, --env, and a command after `--`) but the CLI reference only described the interactive wizard. Document the non-interactive form with a remote and a local example and a flag table.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the CLI documentation for opencode mcp add to better explain interactive vs non-interactive usage and document relevant flags.
Changes:
- Clarifies running
opencode mcp addwith no args vs passing a server name. - Adds non-interactive remote/local examples, including header/env substitution.
- Documents
--url,--header, and--envflags and variable substitution behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Flag | Description | | ||
| | ---------- | ------------------------------------------------------------------- | | ||
| | `--url` | URL for a remote MCP server. | | ||
| | `--header` | HTTP header for a remote server as `KEY=VALUE`. Repeatable. | | ||
| | `--env` | Environment variable for a local server as `KEY=VALUE`. Repeatable. | |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Fixes #32259
opencode mcp addgained non-interactive flags (--url,--header,--env, and a command after--), but the CLI reference (cli.mdx) only described the interactive wizard. This documents the non-interactive form with one remote and one local example plus a flag table, and links to the existing variable-substitution docs for{env:...}values.How I verified
packages/opencode/src/cli/cmd/mcp.ts.{"type":"remote","url":...,"headers":{...}}and the local example wrote{"type":"local","command":[...],"environment":{...}}, confirming the docs match actual behavior.prettier --checkclean).