From 07ad7f0622605f64b8dbeb0d1ba2b16352be1a18 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Mon, 17 Mar 2025 14:02:13 +0800 Subject: [PATCH] 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. --- src/main/services/MCPService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/services/MCPService.ts b/src/main/services/MCPService.ts index 37a5d9b7..666da732 100644 --- a/src/main/services/MCPService.ts +++ b/src/main/services/MCPService.ts @@ -309,7 +309,8 @@ export default class MCPService extends EventEmitter { public async activate(server: MCPServer): Promise { await this.ensureInitialized() - const { name, baseUrl, command, args, env } = server + const { name, baseUrl, command, env } = server + const args = [...(server.args || [])] // Skip if already running if (this.clients[name]) {