// Configuration for universal MCP compatibility export const MCP_CONFIG = { // Server info name: 'spec-mcp-tools', "version": "2.1.9", // Protocol compatibility settings protocol: { version: '2024-11-05', // Use stable protocol version strictMode: false, // Allow more flexible message handling timeout: 30000, // 30 second timeout for operations }, // IDE compatibility flags compatibility: { cursor: true, vscode: true, kiro: true, claude: true, generic: true, // Support for any MCP-compatible IDE }, // Error handling settings errorHandling: { verbose: process.env.MCP_VERBOSE === 'true', logErrors: true, gracefulFailure: true, }, // File system settings fileSystem: { specDirectory: '.spec', encoding: 'utf-8', createDirectories: true, } }; // Environment detection export function detectEnvironment(): string { const env = process.env; if (env.CURSOR_SESSION_ID || env.CURSOR_USER_ID) { return 'cursor'; } if (env.VSCODE_PID || env.VSCODE_IPC_HOOK) { return 'vscode'; } if (env.KIRO_SESSION || env.KIRO_WORKSPACE) { return 'kiro'; } return 'generic'; } // Get environment-specific configuration export function getEnvironmentConfig() { const environment = detectEnvironment(); return { environment, config: { ...MCP_CONFIG, currentEnvironment: environment, isSupported: MCP_CONFIG.compatibility[environment as keyof typeof MCP_CONFIG.compatibility] || true } }; }