-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: combine custom command implementations from #47 and #53 #59
Changes from 1 commit
4b3abca
5779774
81ff0cb
3b04d9b
86bb6e7
c2f40b6
9b4e13b
69a3b2f
0a7c578
ed1954d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ export class ConfigManager { | |
return serverName in (config.mcpServers || {}); | ||
} | ||
|
||
static async installPackage(pkg: Package, envVars?: Record<string, string>): Promise<void> { | ||
static async installPackage(pkg: Package, envVars?: Record<string, string>, customCommand?: Record<string, any>): Promise<void> { | ||
const config = this.readConfig(); | ||
const serverName = pkg.name.replace(/\//g, '-'); | ||
|
||
|
@@ -114,11 +114,21 @@ export class ConfigManager { | |
|
||
// Add command and args based on runtime | ||
if (pkg.runtime === 'node') { | ||
serverConfig.command = 'npx'; | ||
serverConfig.args = ['-y', pkg.name]; | ||
if (customCommand) { | ||
serverConfig.command = customCommand.command; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Custom command should be handled in its own rumtime |
||
serverConfig.args = customCommand.args || []; | ||
} else { | ||
serverConfig.command = 'npx'; | ||
serverConfig.args = ['-y', pkg.name]; | ||
} | ||
} else if (pkg.runtime === 'python') { | ||
serverConfig.command = 'uvx'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we can basically just resolve the command and args based on runtime and custom command and then just set serverCOnfig.command and args based on that versus these if branches |
||
serverConfig.args = [pkg.name]; | ||
if (customCommand) { | ||
serverConfig.command = customCommand.command; | ||
serverConfig.args = customCommand.args || []; | ||
} else { | ||
serverConfig.command = 'uvx'; | ||
serverConfig.args = [pkg.name]; | ||
} | ||
} | ||
|
||
config.mcpServers[serverName] = serverConfig; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime should be custom right?