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.

70 lines 1.96 kB
/** * MCP Client Detector for Telemetry * * Detects which MCP client is running the server by examining environment variables, * process arguments, and parent process information. Used for telemetry and debugging. * * Issue #1358: MCP client detection for enhanced telemetry */ export type MCPClientType = 'claude-desktop' | 'claude-code' | 'vscode' | 'unknown'; /** * Detect which MCP client is running the server * * Detection heuristics (in priority order): * 1. Environment variables (most reliable) * 2. Process arguments * 3. Process metadata (execPath and title) * 4. TERM_PROGRAM environment variable * 5. Unknown (fallback) * * @returns The detected MCP client type * * @example * ```typescript * const client = detectMCPClient(); * console.log(`Running in: ${client}`); * // Output: "Running in: claude-code" * ``` */ export declare function detectMCPClient(): MCPClientType; /** * Get detailed client detection information for debugging * * @returns Object containing detected client and relevant environment info * * @example * ```typescript * const info = getClientDetectionInfo(); * console.log(info); * // { * // client: 'claude-code', * // termProgram: 'claude-code', * // hasVscodeEnv: false, * // hasClaudeDesktopEnv: false * // } * ``` */ export declare function getClientDetectionInfo(): { client: MCPClientType; termProgram?: string; hasVscodeEnv: boolean; hasClaudeDesktopEnv: boolean; hasClaudeCodeEnv: boolean; processTitle?: string; execPath?: string; }; /** * Check if running in a specific MCP client * * @param client - The client type to check for * @returns True if running in the specified client * * @example * ```typescript * if (isRunningInClient('claude-code')) { * console.log('Running in Claude Code'); * } * ``` */ export declare function isRunningInClient(client: MCPClientType): boolean; //# sourceMappingURL=clientDetector.d.ts.map