anthropics / anthropics/claude-code
[BUG] `claude mcp get` suggests `claude mcp remove -s claudeai`, but that scope is rejected ("Cannot remove MCP server from scope: claudeai")
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
## Description
For claude.ai connector MCP servers, `claude mcp get` tells the user to run a removal command that `claude mcp remove` itself rejects. The CLI is self-contradictory: one subcommand recommends `-s claudeai`, the other doesn't accept that scope.
## Steps to reproduce
With a claude.ai account connector present (e.g. Google Drive):
```
$ claude mcp get "claude.ai Google Drive"
claude.ai Google Drive:
Scope: claude.ai config
Status: ! Needs authentication
To remove this server, run: claude mcp remove "claude.ai Google Drive" -s claudeai
```
Run the suggested command:
```
$ claude mcp remove "claude.ai Google Drive" -s claudeai
Cannot remove MCP server from scope: claudeai
```
Without the scope flag it also fails:
```
$ claude mcp remove "claude.ai Google Drive"
No MCP server found with name: "claude.ai Google Drive". No MCP servers are configured.
```
And `claude mcp remove --help` only documents `local`, `user`, or `project` as valid scopes — `claudeai` isn't one, so the suggestion in `mcp get` can never work.
## Expected behavior
Either of:
- `claude mcp get` should not suggest an unsupported command for claude.ai-scope servers — it should point at the actual mechanism (the `/mcp` disable toggle, i.e. `disabledMcpServers`, or disconnecting the connector at claude.ai), or
- `claude mcp remove -s claudeai` should work (e.g. by adding the server to the project's `disabledMcpServers` list).
## Related polish issue
`claude mcp list` and `claude mcp get` don't reflect `disabledMcpServers` state: a connector disabled via the `/mcp` toggle still shows as `! Needs authentication` with no `(disabled)` marker, even though sessions correctly skip it. This makes it look like disabling didn't work.
## Environment
- Claude Code 2.1.181 (homebrew), darwin-arm64 (macOS 25.5.0)
## Related issues
- #29368 / #45182 (hiding unused connectors — the underlying disable now exists; this issue is about the CLI pointing at the wrong command)
- #48275 (connectors listed after web disconnect)
🤖 Filed with [Claude Code](https://claude.com/claude-code)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the `claude mcp get`, `claude mcp remove`, and `claude mcp remove --help` behavior for a claude.ai connector. Trace the handlers for the `get`, `remove`, and list commands, including `disabledMcpServers`; done means the suggested action is valid or points to the actual mechanism, and disabled connectors are represented accurately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100