Skip to content

docs(cli): document non-interactive mcp add flags#32267

Closed
JSap0914 wants to merge 1 commit into
anomalyco:devfrom
JSap0914:mcp-add-flags-docs
Closed

docs(cli): document non-interactive mcp add flags#32267
JSap0914 wants to merge 1 commit into
anomalyco:devfrom
JSap0914:mcp-add-flags-docs

Conversation

@JSap0914

Copy link
Copy Markdown

Fixes #32259

opencode mcp add gained 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

  • Checked every flag, its repeatability, the remote-vs-local constraints, and the global-config target against packages/opencode/src/cli/cmd/mcp.ts.
  • Ran the documented commands against the real CLI (isolated config dir): the remote example wrote {"type":"remote","url":...,"headers":{...}} and the local example wrote {"type":"local","command":[...],"environment":{...}}, confirming the docs match actual behavior.
  • Prettier-formatted (prettier --check clean).

`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.
Copilot AI review requested due to automatic review settings June 14, 2026 04:11
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jun 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 add with no args vs passing a server name.
  • Adds non-interactive remote/local examples, including header/env substitution.
  • Documents --url, --header, and --env flags and variable substitution behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +255 to +259
| 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. |
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jun 14, 2026
@github-actions github-actions Bot closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants