refactor: streamline argument handling in MCPService activation method
- Updated the MCPService's activate method to handle server arguments more efficiently by using a fallback to an empty array if no arguments are provided. - This change improves the clarity and robustness of the argument management within the service.
This commit is contained in:
parent
0863cfb2af
commit
07ad7f0622
@ -309,7 +309,8 @@ export default class MCPService extends EventEmitter {
|
|||||||
public async activate(server: MCPServer): Promise<void> {
|
public async activate(server: MCPServer): Promise<void> {
|
||||||
await this.ensureInitialized()
|
await this.ensureInitialized()
|
||||||
|
|
||||||
const { name, baseUrl, command, args, env } = server
|
const { name, baseUrl, command, env } = server
|
||||||
|
const args = [...(server.args || [])]
|
||||||
|
|
||||||
// Skip if already running
|
// Skip if already running
|
||||||
if (this.clients[name]) {
|
if (this.clients[name]) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user