mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
feat: lazy load mcp server
This commit is contained in:
@@ -16,6 +16,7 @@ describe("AppServer", () => {
|
||||
mcp: {
|
||||
enabled: false,
|
||||
path: "/api/system/mcp",
|
||||
logLevel: "warning",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -38,6 +39,7 @@ describe("AppServer", () => {
|
||||
mcp: {
|
||||
enabled: false,
|
||||
path: "/api/system/mcp",
|
||||
logLevel: "warning",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ describe("mcp auth", async () => {
|
||||
},
|
||||
});
|
||||
await app.build();
|
||||
await app.getMcpClient().ping();
|
||||
server = app.mcp!;
|
||||
server.setLogLevel("error");
|
||||
server.onNotification((message) => {
|
||||
|
||||
@@ -34,6 +34,11 @@ describe("mcp", () => {
|
||||
});
|
||||
await app.build();
|
||||
|
||||
// expect mcp to not be loaded yet
|
||||
expect(app.mcp).toBeNull();
|
||||
|
||||
// after first request, mcp should be loaded
|
||||
await app.getMcpClient().listTools();
|
||||
expect(app.mcp?.tools.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -50,6 +50,7 @@ describe("mcp data", async () => {
|
||||
},
|
||||
});
|
||||
await app.build();
|
||||
await app.getMcpClient().ping();
|
||||
server = app.mcp!;
|
||||
server.setLogLevel("error");
|
||||
server.onNotification((message) => {
|
||||
|
||||
@@ -39,6 +39,7 @@ describe("mcp media", async () => {
|
||||
},
|
||||
});
|
||||
await app.build();
|
||||
await app.getMcpClient().ping();
|
||||
server = app.mcp!;
|
||||
server.setLogLevel("error");
|
||||
server.onNotification((message) => {
|
||||
|
||||
@@ -24,6 +24,7 @@ describe("mcp system", async () => {
|
||||
},
|
||||
});
|
||||
await app.build();
|
||||
await app.getMcpClient().ping();
|
||||
server = app.mcp!;
|
||||
});
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ describe("mcp system", async () => {
|
||||
},
|
||||
});
|
||||
await app.build();
|
||||
await app.getMcpClient().ping();
|
||||
server = app.mcp!;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user