added getMcpClient to app

This commit is contained in:
dswbx
2025-08-15 10:27:05 +02:00
parent deb8aacca4
commit 5c28511fe6
4 changed files with 32 additions and 2 deletions

View File

@@ -136,4 +136,21 @@ describe("App", () => {
// expect async listeners to be executed sync after request
expect(called).toHaveBeenCalled();
});
test("getMcpClient", async () => {
const app = createApp({
initialConfig: {
server: {
mcp: {
enabled: true,
},
},
},
});
await app.build();
const client = app.getMcpClient();
const res = await client.listTools();
expect(res).toBeDefined();
expect(res?.tools.length).toBeGreaterThan(0);
});
});