feat: add MCP server support for agents

- Add MCP server configuration UI for agent settings
- Update agent and session forms to include MCP server selection
- Fix MCP API service logging and tools handling
- Add Chinese localization for MCP settings
- Update type definitions to support MCP server arrays

This enables agents to use MCP (Model Control Protocol) servers
as additional tools and capabilities in their execution context.
This commit is contained in:
Vaayne
2025-09-23 09:51:01 +08:00
parent 3e2acde9e2
commit 60c85b651f
7 changed files with 150 additions and 9 deletions
+2 -2
View File
@@ -113,14 +113,14 @@ class MCPApiService extends EventEmitter {
const client = await mcpService.initClient(server)
const tools = await client.listTools()
logger.info(`Server with id ${id} info:`, { tools: JSON.stringify(tools) })
logger.silly(`Server with id ${id} info:`, { tools: JSON.stringify(tools.tools) })
return {
id: server.id,
name: server.name,
type: server.type,
description: server.description,
tools
tools: tools.tools
}
} catch (error: any) {
logger.error(`Failed to get server info with id ${id}:`, error)