Skip to content

Commit e3b78c7

Browse files
committed
point to installed npx
1 parent d2c4e56 commit e3b78c7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

mcp/src/test/java/io/modelcontextprotocol/client/StdioMcpAsyncClientTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ class StdioMcpAsyncClientTests extends AbstractMcpAsyncClientTests {
2323
@Override
2424
protected McpClientTransport createMcpTransport() {
2525
ServerParameters stdioParams;
26+
String basePath = System.getProperty("user.dir");
2627
if (System.getProperty("os.name").toLowerCase().contains("win")) {
27-
stdioParams = ServerParameters.builder("cmd.exe")
28-
.args("/c", "npx.cmd", "-y", "@modelcontextprotocol/server-everything", "stdio")
28+
stdioParams = ServerParameters.builder(basePath + "/node/npx.cmd")
29+
.args("-y", "@modelcontextprotocol/server-everything", "stdio")
2930
.build();
3031
}
3132
else {
32-
stdioParams = ServerParameters.builder("npx")
33+
stdioParams = ServerParameters.builder(basePath + "/node/npx")
3334
.args("-y", "@modelcontextprotocol/server-everything", "stdio")
3435
.build();
3536
}

mcp/src/test/java/io/modelcontextprotocol/client/StdioMcpSyncClientTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ class StdioMcpSyncClientTests extends AbstractMcpSyncClientTests {
3131
@Override
3232
protected McpClientTransport createMcpTransport() {
3333
ServerParameters stdioParams;
34+
String basePath = System.getProperty("user.dir");
3435
if (System.getProperty("os.name").toLowerCase().contains("win")) {
35-
stdioParams = ServerParameters.builder("cmd.exe")
36-
.args("/c", "npx.cmd", "-y", "@modelcontextprotocol/server-everything", "stdio")
36+
stdioParams = ServerParameters.builder(basePath + "/node/npx.cmd")
37+
.args("-y", "@modelcontextprotocol/server-everything", "stdio")
3738
.build();
3839
}
3940
else {
40-
stdioParams = ServerParameters.builder("npx")
41+
stdioParams = ServerParameters.builder(basePath + "/node/npx")
4142
.args("-y", "@modelcontextprotocol/server-everything", "stdio")
4243
.build();
4344
}

0 commit comments

Comments
 (0)