fix: reorder 'claude mcp add' arguments so the printed command parses - #270
Merged
Conversation
The command templates put --transport/--header before the positional
name/url arguments. The claude CLI enforces positional-first parsing for
'mcp add', so the copy-pasted command fails with:
error: missing required argument 'name'
Reproduced with claude CLI 2.x: options-first fails, positionals-first
succeeds. Fixed the UI template, the API-served template, README, docs,
and llms.txt. (AGENTS.md's variant already parses and is left as-is.)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
claude mcp addcommand shown in Settings → Tokens (and in the API'smcpAddCommandTemplate, README, and docs) places--transport/--headeroptions before the positionalname/urlarguments. The claude CLI enforces positional-first parsing formcp add, so copy-pasting the command fails with:Fix
Reorder to positionals-first everywhere the command is emitted or documented:
Verified both forms against the claude CLI: options-first reproduces the error, positionals-first adds the server successfully.
AGENTS.md's interleaved variant (add projektor --transport http <url>) already parses, so it's left unchanged. Existing test assertions (toContain("claude mcp add")) still pass.Files:
TokenManager.tsx(UI),services/workspaces.ts(API template),README.md,docs/agents/mcp-connection.md(×2),llms.txt.Aware of the auto-close policy for external PRs — filing this as a reference patch, feel free to adopt however suits.
🤖 Generated with Claude Code