|
10 | 10 | MCPServersConfig, |
11 | 11 | SSEServerConfig, |
12 | 12 | StdioServerConfig, |
13 | | - StreamableHttpConfig, |
| 13 | + StreamableHTTPServerConfig, |
14 | 14 | ) |
15 | 15 |
|
16 | 16 |
|
17 | 17 | @pytest.fixture |
18 | | -def mcp_config_file(tmp_path: Path) -> Path: |
19 | | - """Create temporary JSON config file with mixed server types""" |
20 | | - |
21 | | - config_data = { |
22 | | - "mcpServers": { |
23 | | - # Servers with inferred types |
24 | | - "stdio_server": { |
25 | | - "command": "python", |
26 | | - "args": ["-m", "my_server"], |
27 | | - "env": {"DEBUG": "true"}, |
28 | | - }, |
29 | | - "stdio_server_with_full_command": { |
30 | | - "command": "python -m my_server", |
31 | | - }, |
32 | | - "stdio_server_with_full_command_and_explicit_args": { |
33 | | - "command": "python -m my_server", # Two args here: -m and my_server |
34 | | - "args": ["--debug"], # One explicit arg here: --debug |
35 | | - }, |
36 | | - "streamable_http_server_with_headers": { |
37 | | - "url": "https://api.example.com/mcp", |
38 | | - "headers": {"Authorization": "Bearer token123"}, |
39 | | - }, |
40 | | - # Servers with explicit types |
41 | | - "stdio_server_with_explicit_type": { |
42 | | - "type": "stdio", # Explicitly specified |
43 | | - "command": "python", |
44 | | - "args": ["-m", "my_server"], |
45 | | - "env": {"DEBUG": "true"}, |
46 | | - }, |
47 | | - "streamable_http_server_with_explicit_type": { |
48 | | - "type": "streamable_http", # Explicitly specified |
49 | | - "url": "https://api.example.com/mcp", |
50 | | - }, |
51 | | - "sse_server_with_explicit_type": { |
52 | | - "type": "sse", # Explicitly specified |
53 | | - "url": "https://api.example.com/sse", |
54 | | - }, |
55 | | - } |
56 | | - } |
57 | | - |
58 | | - # Write to temporary file |
59 | | - config_file_path = tmp_path / "mcp.json" |
60 | | - with open(config_file_path, "w") as config_file: |
61 | | - json.dump(config_data, config_file) |
62 | | - |
63 | | - return config_file_path |
| 18 | +def mcp_config_file() -> Path: |
| 19 | + """Return path to the mcp.json config file with mixed server types""" |
| 20 | + return Path(__file__).parent / "mcp.json" |
64 | 21 |
|
65 | 22 |
|
66 | 23 | def test_stdio_server(mcp_config_file: Path): |
@@ -96,7 +53,7 @@ def test_streamable_http_server_with_explicit_type(mcp_config_file: Path): |
96 | 53 | config = MCPServersConfig.from_file(mcp_config_file) |
97 | 54 |
|
98 | 55 | http_server = config.servers["streamable_http_server_with_explicit_type"] |
99 | | - assert isinstance(http_server, StreamableHttpConfig) |
| 56 | + assert isinstance(http_server, StreamableHTTPServerConfig) |
100 | 57 | assert http_server.type == "streamable_http" |
101 | 58 |
|
102 | 59 |
|
@@ -144,7 +101,7 @@ def test_streamable_http_server_with_headers(mcp_config_file: Path): |
144 | 101 | config = MCPServersConfig.from_file(mcp_config_file) |
145 | 102 |
|
146 | 103 | http_server = config.servers["streamable_http_server_with_headers"] |
147 | | - assert isinstance(http_server, StreamableHttpConfig) |
| 104 | + assert isinstance(http_server, StreamableHTTPServerConfig) |
148 | 105 |
|
149 | 106 | assert http_server.url == "https://api.example.com/mcp" |
150 | 107 | assert http_server.headers == {"Authorization": "Bearer token123"} |
|
0 commit comments