@@ -48,7 +48,7 @@ def test_use_pyyaml_parameter_with_json_file():
4848 assert list (config .servers .keys ()) == list (config_json .servers .keys ())
4949
5050
51- def test_time_server (mcp_yaml_config_file : Path ):
51+ def test_uvx_time_server (mcp_yaml_config_file : Path ):
5252 """Test the time server configuration with uvx command."""
5353 config = MCPServersConfig .from_file (mcp_yaml_config_file )
5454
@@ -81,3 +81,29 @@ def test_streamable_http_server(mcp_yaml_config_file: Path):
8181 assert http_server .type == "streamable_http" # Should be auto-inferred
8282 assert http_server .url == "https://api.example.com/mcp"
8383 assert http_server .headers is None # No headers specified
84+
85+
86+ def test_npx_filesystem_server (mcp_yaml_config_file : Path ):
87+ """Test the filesystem server configuration with full command string and multiple arguments."""
88+ config = MCPServersConfig .from_file (mcp_yaml_config_file )
89+
90+ # Should have the filesystem server
91+ assert "filesystem" in config .servers
92+
93+ # Verify the server configuration
94+ filesystem_server = config .servers ["filesystem" ]
95+ assert isinstance (filesystem_server , StdioServerConfig )
96+ assert filesystem_server .type == "stdio" # Should be auto-inferred from command field
97+ assert filesystem_server .command == "npx -y @modelcontextprotocol/server-filesystem /Users/username/Desktop /path/to/other/allowed/dir"
98+ assert filesystem_server .args is None # No explicit args
99+ assert filesystem_server .env is None # No environment variables
100+
101+ # Test the effective command parsing
102+ assert filesystem_server .effective_command == "npx"
103+ expected_args = [
104+ "-y" ,
105+ "@modelcontextprotocol/server-filesystem" ,
106+ "/Users/username/Desktop" ,
107+ "/path/to/other/allowed/dir"
108+ ]
109+ assert filesystem_server .effective_args == expected_args
0 commit comments