Docs: MCP SSE add command example has incorrect syntax

Resolved 💬 1 comment Opened Mar 3, 2026 by philbritton Closed Mar 3, 2026

Summary

The documented example for adding an SSE MCP server uses a --url flag that doesn't exist. The actual CLI requires the URL as a positional argument. Additionally, the variadic --header / -H flag consumes subsequent positional arguments if placed before them, which is a common stumbling block.

Current docs example (incorrect)

claude mcp add workman-remote \
  --transport sse \
  --url "https://example.com/mcp/sse" \
  --header "X-API-Key: your_key"

This fails with: error: unknown option '--url'

What actually works

The URL must be a positional argument (not a flag), and -H/--header must come after the positional arguments because it's variadic and will consume them otherwise:

claude mcp add -t sse workman-remote "https://example.com/mcp/sse" -H "X-API-Key: your_key"

Steps to reproduce

  1. Copy the SSE example from the docs
  2. Run it with a valid URL and API key
  3. Observe error: unknown option '--url'
  4. Move --header before the name/URL positional args
  5. Observe error: missing required argument 'name'

Suggested fix

Update the SSE example in the docs to:

  1. Remove --url and use the URL as a positional argument
  2. Show -H/--header placed after the positional arguments to avoid the variadic consumption issue
  3. Consider noting this ordering requirement explicitly

Environment

  • Claude Code CLI
  • claude mcp add --help shows: Usage: claude mcp add [options] <name> <commandOrUrl> [args...]

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗