UNPKG

@dollhousemcp/mcp-server

Version:

DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.

66 lines 2.4 kB
/** * Server setup and initialization */ import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { ToolRegistry } from '../handlers/ToolRegistry.js'; import { LRUCache } from '../cache/LRUCache.js'; import type { Tool } from "@modelcontextprotocol/sdk/types.js"; import type { ContextTracker } from '../security/encryption/ContextTracker.js'; import type { ElementCRUDHandler } from '../handlers/ElementCRUDHandler.js'; export declare class ServerSetup { private static readonly TOOL_CACHE_KEY; /** Issue #706: Max ms to wait for deferred setup before proceeding anyway. */ private static readonly DEFERRED_SETUP_TIMEOUT_MS; private toolCache; private contextTracker; private elementCrudHandler; /** Issue #706 Phase 4: Promise that resolves when deferred setup completes. */ private deferredSetupPromise; constructor(contextTracker: ContextTracker); /** * Issue #706 Phase 4: Set the deferred setup promise for request buffering. * First request after connect holds briefly until deferred setup completes * (or the timeout fires). Subsequent requests proceed immediately. */ setDeferredSetupPromise(promise: Promise<void>): void; /** * Issue #706 Phase 4: Wait for deferred setup with a hard timeout. * No-op if already resolved or never set. */ private awaitDeferredSetup; /** * Initialize the server with all tools and handlers */ setupServer(server: Server, toolRegistry: ToolRegistry, elementCrudHandler?: ElementCRUDHandler): void; /** * Setup the ListToolsRequest handler with caching */ private setupListToolsHandler; /** * Setup the CallToolRequest handler */ private setupCallToolHandler; /** * Recursively normalize Unicode in all string values within arguments */ private normalizeArgumentsUnicode; /** * Get the tool discovery cache */ getToolCache(): LRUCache<Tool[]>; /** * Invalidate the tool discovery cache (useful for external tool changes) */ invalidateToolCache(): void; /** * Log current cache performance metrics */ logCachePerformance(): void; /** * Get cache statistics for monitoring */ getCacheStatistics(): { toolCache: import("../cache/LRUCache.js").CacheStats; }; } //# sourceMappingURL=ServerSetup.d.ts.map