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:
kangfenmao 2025-03-17 14:02:13 +08:00
parent 0863cfb2af
commit 07ad7f0622

View File

@ -309,7 +309,8 @@ export default class MCPService extends EventEmitter {
public async activate(server: MCPServer): Promise<void> {
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]) {