mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
fix: preserve valid servers during CLI discovery (#4714)
Co-authored-by: Shuying <zsy@u.northwestern.edu>
This commit is contained in:
parent
10b158baf3
commit
c428a08fea
2 changed files with 48 additions and 15 deletions
|
|
@ -140,6 +140,30 @@ class TestParseMcpConfig:
|
|||
servers = _parse_mcp_config(path, "test")
|
||||
assert servers == []
|
||||
|
||||
def test_invalid_server_does_not_hide_valid_servers(
|
||||
self, tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
):
|
||||
path = tmp_path / "config.json"
|
||||
_write_config(
|
||||
path,
|
||||
{
|
||||
"mcpServers": {
|
||||
"working": {
|
||||
"command": "python",
|
||||
"args": ["server.py"],
|
||||
},
|
||||
"broken": {
|
||||
"args": ["missing-command.py"],
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
servers = _parse_mcp_config(path, "test")
|
||||
|
||||
assert [server.name for server in servers] == ["working"]
|
||||
assert "broken" in caplog.text
|
||||
|
||||
def test_remote_server(self, tmp_path: Path):
|
||||
path = tmp_path / "config.json"
|
||||
_write_config(path, _REMOTE_CONFIG)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue