File tree Expand file tree Collapse file tree 5 files changed +1438
-1008
lines changed
src/uipath_mcp/_cli/_utils Expand file tree Collapse file tree 5 files changed +1438
-1008
lines changed Original file line number Diff line number Diff line change @@ -186,3 +186,5 @@ cython_debug/
186186** /samples /** /CLAUDE.md
187187** /samples /** /entry-points.json
188188** /samples /** /uv.lock
189+
190+ .claude /
Original file line number Diff line number Diff line change 11[project ]
22name = " uipath-mcp"
3- version = " 0.2.0 "
3+ version = " 0.2.1 "
44description = " UiPath MCP SDK"
55readme = { file = " README.md" , content-type = " text/markdown" }
66requires-python = " >=3.11"
77dependencies = [
88 " mcp==1.26.0" ,
99 " pysignalr==1.3.0" ,
10- " uipath>=2.10.40 , <2.11.0" ,
10+ " uipath>=2.10.42 , <2.11.0" ,
1111 " uipath-runtime>=0.10.0, <0.11.0" ,
1212]
1313classifiers = [
@@ -42,14 +42,13 @@ dev = [
4242 " mypy>=1.14.1" ,
4343 " ruff>=0.9.4" ,
4444 " pytest>=7.4.0" ,
45- " pytest-asyncio>=0.23 .0" ,
45+ " pytest-asyncio>=1.3 .0" ,
4646 " pytest-cov>=4.1.0" ,
4747 " pytest-mock>=3.11.1" ,
4848 " pre-commit>=4.5.1" ,
4949 " filelock>=3.20.3" ,
5050 " virtualenv>=20.36.1" ,
5151 " numpy>=1.24.0" ,
52- " pytest-asyncio>=1.3.0" ,
5352]
5453
5554[tool .ruff ]
Original file line number Diff line number Diff line change @@ -106,14 +106,7 @@ def get_servers(self) -> list[McpServer]:
106106 def get_server (self , name : str ) -> McpServer | None :
107107 """
108108 Get a server model by name.
109- If there's only one server available, return that one regardless of name.
110- Otherwise, look up the server by the provided name.
111109 """
112- # If there's only one server, return it
113- if len (self ._servers ) == 1 :
114- return next (iter (self ._servers .values ()))
115-
116- # Otherwise, fall back to looking up by name
117110 return self ._servers .get (name )
118111
119112 def get_server_names (self ) -> list [str ]:
Original file line number Diff line number Diff line change 1+ from uipath_mcp ._cli ._utils ._config import McpConfig
2+
3+
4+ def test_get_server_exact_match_single_server (tmp_path ):
5+ """Single-server config should NOT return the server for a mismatched name."""
6+ config_file = tmp_path / "mcp.json"
7+ config_file .write_text ('{"servers": {"my-server": {"command": "python"}}}' )
8+
9+ config = McpConfig (config_path = str (config_file ))
10+
11+ assert config .get_server ("my-server" ) is not None
12+ assert config .get_server ("wrong-name" ) is None
13+
14+
15+ def test_get_server_exact_match_multiple_servers (tmp_path ):
16+ """Multi-server config returns correct server by name."""
17+ config_file = tmp_path / "mcp.json"
18+ config_file .write_text (
19+ '{"servers": {"server-a": {"command": "a"}, "server-b": {"command": "b"}}}'
20+ )
21+
22+ config = McpConfig (config_path = str (config_file ))
23+
24+ server_a = config .get_server ("server-a" )
25+ server_b = config .get_server ("server-b" )
26+ assert server_a is not None
27+ assert server_b is not None
28+ assert server_a .name == "server-a"
29+ assert server_b .name == "server-b"
30+ assert config .get_server ("server-c" ) is None
You can’t perform that action at this time.
0 commit comments