[BUG] `claude mcp` subcommand quirks
Resolved 💬 3 comments Opened Jan 12, 2026 by richardkmichael Closed Feb 27, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
claude mcp list-- With an an invalidsettings.jsonfile,claude mcp listreports "no MCP servers configured".claude mcp add-- Not possible to add an env value which is itself an env var (as supported in.mcp.json
What Should Happen?
claude mcp listshould exit with the same error asclaudeitself: "Invalid or malformed JSON`.
claude mcp add -e KEY=VALUEshould tolerateVALUEbeing the notation of env vars in.mcp.json:${FOO}
Should generate (manually added env value):
{
"mcpServers": {
"tailwindplus": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/Users/rmichael/Documents/Personal/Source/mcp-tailwindplus/dependencies",
"run",
"mcp-tailwindplus"
],
"env": {
"MCP_TAILWINDPLUS_DATA": "${MCP_TAILWINDPLUS_DATA}"
}
}
}
}
Error Messages/Logs
1.
$ claude mcp list
No MCP servers configured. Use `claude mcp add` to add a server.
$ claude
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Settings Error
/Users/rmichael/Documents/Personal/Source/mcp-tailwindplus/development/.claude/settings.json
└ Invalid or malformed JSON
2.
$ claude mcp add -s project tailwindplus -- uv --directory $( readlink -fn ../../mcp-tailwindplus/dependencies ) run mcp-tailwindplus
Invalid environment variable format: tailwindplus, environment variables should be added as: -e KEY1=value1 -e KEY2=value2
See above for correct `mcp.json`
Steps to Reproduce
claude mcp listclaude mcp add -e FOO='${FOO}' foo -- uv run foo
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.5 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗