claude-code - 💡(How to fix) Fix [Bug] Incorrect `--` separator position in `claude mcp add` command documentation [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52428Fetched 2026-04-24 06:07:31
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Code Example

Invalid environment variable format: cursor-cli-mcp, environment variables should be added as: -e KEY1=value1 -e KEY2=value2
RAW_BUFFERClick to expand / collapse

Bug Description Issue: The claude mcp add command documentation shows incorrect syntax for the -- separator.

Documented syntax (incorrect):

claude mcp add [options] <server-name> -- <command> Actual working syntax:

claude mcp add [options] -- <server-name> <command> Example that failed:

claude mcp add --transport stdio -e KEY=value myserver -- node /path/to/index.js Example that worked:

claude mcp add --transport stdio -e KEY=value -- myserver node /path/to/index.js The -- separator must come before the server name, not after it. The documentation currently shows it in the wrong position.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.108
  • Feedback ID: 67abf522-8136-416e-a2e5-fceaa5381c02

Errors

Invalid environment variable format: cursor-cli-mcp, environment variables should be added as: -e KEY1=value1 -e KEY2=value2

extent analysis

TL;DR

Update the claude mcp add command syntax in the documentation to place the -- separator before the <server-name>.

Guidance

  • Verify the correct syntax by running the command with the -- separator before the server name, as shown in the working example: claude mcp add [options] -- <server-name> <command>.
  • Check the documentation for any other instances of the incorrect syntax and update them accordingly.
  • Test the command with different options and server names to ensure the corrected syntax works as expected.
  • Consider adding a note to the documentation to clarify the purpose of the -- separator and its correct position in the command.

Example

claude mcp add --transport stdio -e KEY=value -- myserver node /path/to/index.js

Notes

The provided error message regarding invalid environment variable format is unrelated to the incorrect syntax issue and should be addressed separately.

Recommendation

Apply workaround: Update the documentation with the correct syntax to avoid confusion and ensure users can successfully use the claude mcp add command.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Incorrect `--` separator position in `claude mcp add` command documentation [2 comments, 2 participants]