import type { Tool } from '@modelcontextprotocol/server'; import type { MCPPlugin, MCPServer } from '../server/MCPServer.js'; export interface ToolLike { tool: Tool; } /** * Generic base plugin to reduce duplication across tool plugins. * Subclasses should implement creation of tool instances and optionally override * validation, disabling, and per-tool handler wrapping. */ export declare abstract class BaseToolsPlugin implements MCPPlugin { abstract name: string; protected commands: TTool[]; protected logger?: MCPServer['logger']; protected commandMap: Map; /** Create tool instances for this plugin */ protected abstract createToolInstances(): TTool[]; /** Optional: validate external dependencies (e.g., CLIs) before registration */ protected validate(): Promise; /** Optional: allow disabling a plugin via env var */ protected isDisabled(): boolean; /** Optional: custom wrapping for tool handlers */ protected getHandlerForTool(_tool: TTool): (params: any) => Promise; /** Build the internal command map */ protected buildCommandMap(): void; /** Execute a command by name using the plugin's instances */ protected runCommandByName(commandName: string, params: Record): Promise; initialize(server: MCPServer): Promise; getToolFunction(toolName: string): ((params: any) => Promise) | undefined; shutdown(): Promise; /** Determine the global timeout in ms from params or env (TIMEOUT) */ protected computeGlobalTimeoutMs(params: any): number | undefined; /** Wrap a promise with a timeout if provided */ protected withTimeout(promise: Promise, timeoutMs?: number, label?: string): Promise; } //# sourceMappingURL=BaseToolsPlugin.d.ts.map