File tree Expand file tree Collapse file tree 2 files changed +29
-23
lines changed Expand file tree Collapse file tree 2 files changed +29
-23
lines changed Original file line number Diff line number Diff line change @@ -53,18 +53,21 @@ export default class Tool extends Command {
53
53
54
54
//console.log(propsObject);
55
55
56
+ const isNodePackage = server . startsWith ( '@' ) ;
57
+ const command = isNodePackage ? ( process . platform === "win32" ? "cmd" : "npx" ) : "uvx" ;
58
+ const args = isNodePackage ? ( process . platform === "win32" ? [
59
+ "/c" ,
60
+ "npx" ,
61
+ "-y" ,
62
+ server
63
+ ] : [
64
+ "-y" ,
65
+ server
66
+ ] ) : [ server ] ;
67
+
56
68
const transport = new StdioClientTransport ( {
57
- //command: process.platform === "win32" ? "npx.cmd" : "npx",
58
- command : process . platform === "win32" ? "cmd" : "npx" ,
59
- args : process . platform === "win32" ? [
60
- "/c" ,
61
- "npx" ,
62
- "-y" ,
63
- server
64
- ] : [
65
- "-y" ,
66
- server
67
- ]
69
+ command,
70
+ args
68
71
} ) ;
69
72
70
73
const client = new Client (
Original file line number Diff line number Diff line change @@ -23,18 +23,21 @@ export default class Tools extends Command {
23
23
// Assert that argv is a string array.
24
24
const stringArgs = argv as string [ ]
25
25
26
+ const isNodePackage = stringArgs [ 0 ] . startsWith ( '@' ) ;
27
+ const command = isNodePackage ? ( process . platform === 'win32' ? 'cmd' : 'npx' ) : 'uvx' ;
28
+ const args = isNodePackage ? ( process . platform === 'win32' ? [
29
+ "/c" ,
30
+ "npx" ,
31
+ "-y" ,
32
+ ...stringArgs
33
+ ] : [
34
+ "-y" ,
35
+ ...stringArgs
36
+ ] ) : stringArgs ;
37
+
26
38
const transport = new StdioClientTransport ( {
27
- //command: process.platform === "win32" ? "npx.cmd" : "npx",
28
- command : process . platform === "win32" ? "cmd" : "npx" ,
29
- args : process . platform === "win32" ? [
30
- "/c" ,
31
- "npx" ,
32
- "-y" ,
33
- ...stringArgs
34
- ] : [
35
- "-y" ,
36
- ...stringArgs
37
- ]
39
+ command,
40
+ args
38
41
} ) ;
39
42
40
43
const client = new Client (
@@ -107,4 +110,4 @@ export default class Tools extends Command {
107
110
108
111
process . exit ( 0 ) ;
109
112
}
110
- }
113
+ }
You can’t perform that action at this time.
0 commit comments