feat: Create all MCP Servers at startup

This commit is contained in:
Kadxy
2024-12-28 21:06:26 +08:00
parent c3108ad333
commit 664879b9df
11 changed files with 134 additions and 165 deletions

View File

@@ -29,11 +29,9 @@ export async function createClient(
},
{
capabilities: {
roots: {
// listChanged indicates whether the client will emit notifications when the list of roots changes.
// listChanged 指示客户端在根列表更改时是否发出通知。
listChanged: true,
},
// roots: {
// listChanged: true,
// },
},
},
);
@@ -80,8 +78,7 @@ export async function listPrimitives(client: Client) {
return primitives;
}
/** Execute a request */
export async function executeRequest(client: Client, request: any) {
const r = client.request(request, z.any());
console.log(r);
return r;
return client.request(request, z.any());
}