MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / test_other_servers_preserved

Function test_other_servers_preserved

tests/cli/test_claude.py:141–149  ·  view source on GitHub ↗

Installing a new server should not clobber existing mcpServers entries.

(config_dir: Path)

Source from the content-addressed store, hash-verified

139
140
141def test_other_servers_preserved(config_dir: Path):
142 """Installing a new server should not clobber existing mcpServers entries."""
143 (config_dir / "claude_desktop_config.json").write_text(json.dumps({"mcpServers": {"other": {"command": "x"}}}))
144
145 assert update_claude_config(file_spec="s.py:app", server_name="s")
146
147 config = json.loads((config_dir / "claude_desktop_config.json").read_text())
148 assert set(config["mcpServers"]) == {"other", "s"}
149 assert config["mcpServers"]["other"] == {"command": "x"}
150
151
152def test_raises_when_config_dir_missing(monkeypatch: pytest.MonkeyPatch):

Callers

nothing calls this directly

Calls 1

update_claude_configFunction · 0.90

Tested by

no test coverage detected