修改 mcp 的引入方式

This commit is contained in:
锦恢 2025-05-23 19:14:11 +08:00
parent 0e057bec1a
commit d1a392bb87
3 changed files with 6 additions and 5 deletions

View File

@ -471,7 +471,8 @@ class McpClientAdapter {
for (const item of launchSignature) { for (const item of launchSignature) {
// 创建一个新的客户端 // 创建一个新的客户端
const client = reactive(new McpClient()); // const client = reactive(new McpClient());
const client = new McpClient();
// 同步连接参数 // 同步连接参数
await client.acquireConnectionSignature(item); await client.acquireConnectionSignature(item);

View File

@ -62,11 +62,11 @@ function selectServer(index: number) {
} }
function addServer() { function addServer() {
const client = reactive(new McpClient()); // const client = reactive(new McpClient());
const client = new McpClient();
mcpClientAdapter.clients.push(client); mcpClientAdapter.clients.push(client);
mcpClientAdapter.currentClientIndex = mcpClientAdapter.clients.length - 1; mcpClientAdapter.currentClientIndex = mcpClientAdapter.clients.length - 1;
mcpClientAdapter.clients.at(-1)!.handleEnvSwitch(true);
client.handleEnvSwitch(true);
} }

View File

@ -1,6 +1,6 @@
{ {
"clientId": "83313e18-3e18-513e1883c06-813e1883c060a6b-60a6b641", "clientId": "83313e18-3e18-513e1883c06-813e1883c060a6b-60a6b641",
"currentIndex": 1, "currentIndex": 0,
"tabs": [ "tabs": [
{ {
"name": "交互测试", "name": "交互测试",