MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / detect

Method detect

src/installer/targets/cursor.ts:97–107  ·  view source on GitHub ↗
(loc: Location)

Source from the content-addressed store, hash-verified

95 }
96
97 detect(loc: Location): DetectionResult {
98 const mcpPath = mcpJsonPath(loc);
99 const config = readJsonFile(mcpPath);
100 const alreadyConfigured = !!config.mcpServers?.codegraph;
101 // "Installed" heuristic: does ~/.cursor exist (global) or has the
102 // user opted into a project-local cursor config dir?
103 const installed = loc === 'global'
104 ? fs.existsSync(path.join(os.homedir(), '.cursor'))
105 : fs.existsSync(path.join(process.cwd(), '.cursor'));
106 return { installed, alreadyConfigured, configPath: mcpPath };
107 }
108
109 install(loc: Location, _opts: InstallOptions): WriteResult {
110 const files: WriteResult['files'] = [];

Callers

nothing calls this directly

Calls 3

readJsonFileFunction · 0.90
mcpJsonPathFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected