bc_resource_mcp-beta
Version:
MCP server for Baichuan resource
21 lines (20 loc) • 590 B
JavaScript
import { APIServer } from "./api.js";
import { createToolHandlers } from "./toolRegistery.js";
export class APIServerMCP {
apiServer;
toolHandlers;
constructor(config) {
this.apiServer = new APIServer(config);
this.toolHandlers = createToolHandlers(this.apiServer);
}
getAPIServer() {
return this.apiServer;
}
async runTool(toolName, args) {
const handler = this.toolHandlers.get(toolName);
if (!handler) {
throw new Error(`Tool ${toolName} not found`);
}
return handler.runTool(args);
}
}