()
| 159 | |
| 160 | // 主安装流程 |
| 161 | async function main() { |
| 162 | try { |
| 163 | // 更新配置 |
| 164 | const configFile = updateMcpConfig(); |
| 165 | |
| 166 | // 验证安装 |
| 167 | verifyInstallation(); |
| 168 | |
| 169 | // 显示说明 |
| 170 | showUsageInstructions(configFile); |
| 171 | |
| 172 | } catch (error) { |
| 173 | console.error('\n❌ Installation failed:', error.message); |
| 174 | console.error('\n🔧 Manual setup instructions:'); |
| 175 | console.error('1. Create ~/.config/cursor/mcp_settings.json'); |
| 176 | console.error('2. Add the following configuration:'); |
| 177 | console.error(JSON.stringify({ |
| 178 | mcpServers: { |
| 179 | icss: { |
| 180 | command: "node", |
| 181 | args: [path.join(getPackagePath(), 'server.js')], |
| 182 | env: {} |
| 183 | } |
| 184 | } |
| 185 | }, null, 2)); |
| 186 | |
| 187 | process.exit(1); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | // 如果直接运行此脚本 |
| 192 | if (import.meta.url === `file://${process.argv[1]}`) { |
no test coverage detected