Test that STDIO config without command is rejected.
()
| 285 | |
| 286 | @pytest.mark.asyncio |
| 287 | async def test_stdio_config_validation(): |
| 288 | """Test that STDIO config without command is rejected.""" |
| 289 | with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f: |
| 290 | config = { |
| 291 | "mcpServers": { |
| 292 | "broken-stdio": { |
| 293 | "type": "stdio", |
| 294 | # Missing "command" field |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | json.dump(config, f) |
| 299 | f.flush() |
| 300 | |
| 301 | try: |
| 302 | tools = await load_mcp_tools_async(f.name) |
| 303 | # Should return empty list (server skipped due to missing command) |
| 304 | assert tools == [] |
| 305 | finally: |
| 306 | await cleanup_mcp_connections() |
| 307 | Path(f.name).unlink() |
| 308 | |
| 309 | |
| 310 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected