[BUG] Can not add MCP which has arguments beginning with double hyphen or single hyphen
Environment
- Platform (select one):
- [X] Anthropic API
- Claude CLI version: 1.0.18
- Operating System: MacOS Sequoia 15.2
- Terminal: MacOS Terminal
Bug Description
uv mcp add can not parse "--" and "-" in the command correctly. When the command contains "--", then "uv add mcp" fails. When the command contains "-", then "uv add mcp" silently removes that argument.
Steps to Reproduce
I have created a MCP server which is in this public repo: https://github.com/Joseph19820124/joseph_mcp_server.
Following the steps in README for Claude code will reproduce the error.
Expected Behavior
My MCP should have been added. It works correctly in other IDEs like Claude Desktop and cursor.
Besides, in POSIX Systems, it's very common to have "--" or "-" in the arguments to the command/program being run.
Actual Behavior
can not add mcp server which has any argument beginning with "--" in the command. when the command has argument beginning with "-", the mcp is added but that argument is silently dropped.
Both of these are wrong.
Additional Context
Claude Desktop allows arguments beginning with "--" and it works correctly. However, when I import the configuration from claude desktop to claude code, the argument beginning with "--" is imported correctly. However, mcp server fails to start.
I feel that the claude code somehow mishandles the arguments beginning with "--" or "-".
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗