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
- Copy the SSE example from the docs
- Run it with a valid URL and API key
- Observe
error: unknown option '--url' - Move
--headerbefore the name/URL positional args - Observe
error: missing required argument 'name'
Suggested fix
Update the SSE example in the docs to:
- Remove
--urland use the URL as a positional argument - Show
-H/--headerplaced after the positional arguments to avoid the variadic consumption issue - Consider noting this ordering requirement explicitly
Environment
- Claude Code CLI
claude mcp add --helpshows:Usage: claude mcp add [options] <name> <commandOrUrl> [args...]
🤖 Generated with Claude Code
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗