mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
mcp: added path config, register at /api path by default to work with frameworks
This commit is contained in:
@@ -1,17 +1,5 @@
|
||||
import { McpClient, type McpClientConfig } from "jsonv-ts/mcp";
|
||||
import { Draft2019 } from "json-schema-library";
|
||||
|
||||
const clients = new Map<string, McpClient>();
|
||||
|
||||
export function getClient(
|
||||
{ url, ...opts }: McpClientConfig = { url: window.location.origin + "/mcp" },
|
||||
) {
|
||||
if (!clients.has(String(url))) {
|
||||
clients.set(String(url), new McpClient({ url, ...opts }));
|
||||
}
|
||||
return clients.get(String(url))!;
|
||||
}
|
||||
|
||||
export function getTemplate(schema: object) {
|
||||
if (!schema || schema === undefined || schema === null) return undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user