(loc: Location)
| 81 | } |
| 82 | |
| 83 | detect(loc: Location): DetectionResult { |
| 84 | const mcpPath = mcpJsonPath(loc); |
| 85 | const config = readJsonFile(mcpPath); |
| 86 | const alreadyConfigured = !!config.mcpServers?.codegraph; |
| 87 | // For "installed" we infer from the existence of either the dir |
| 88 | // (global) or the project marker file (local). Cheap and avoids |
| 89 | // shelling out to `claude --version`. |
| 90 | const installed = loc === 'global' |
| 91 | ? fs.existsSync(configDir(loc)) || fs.existsSync(mcpPath) |
| 92 | : fs.existsSync(mcpPath) || fs.existsSync(configDir(loc)); |
| 93 | return { installed, alreadyConfigured, configPath: mcpPath }; |
| 94 | } |
| 95 | |
| 96 | install(loc: Location, opts: InstallOptions): WriteResult { |
| 97 | const files: WriteResult['files'] = []; |
nothing calls this directly
no test coverage detected