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

Method detect

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

Source from the content-addressed store, hash-verified

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