UNPKG

mcp-rand

Version:

MCP server providing random generation utilities including UUID, numbers, strings, passwords, Gaussian distribution, dice rolling, and card drawing

22 lines 706 B
export class SimpleHandlerRegistry { constructor() { this.handlers = new Map(); } register(method, toolName, handler) { if (!this.handlers.has(method)) { this.handlers.set(method, new Map()); } this.handlers.get(method).set(toolName, handler); } get(method, toolName) { const methodHandlers = this.handlers.get(method); if (!methodHandlers) return undefined; if (toolName) { return methodHandlers.get(toolName); } // For methods like 'tools/list' that don't need a specific tool name return methodHandlers.values().next().value; } } //# sourceMappingURL=types.js.map