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

Method constructor

src/mcp/daemon.ts:228–244  ·  view source on GitHub ↗
(
    private projectRoot: string,
    opts: { idleTimeoutMs?: number; maxIdleMs?: number; handoverFrom?: number | null } = {},
  )

Source from the content-addressed store, hash-verified

226 private handoverFrom: number | null;
227
228 constructor(
229 private projectRoot: string,
230 opts: { idleTimeoutMs?: number; maxIdleMs?: number; handoverFrom?: number | null } = {},
231 ) {
232 this.socketPath = getDaemonSocketPath(projectRoot);
233 this.pidPath = getDaemonPidPath(projectRoot);
234 this.idleTimeoutMs = opts.idleTimeoutMs ?? resolveIdleTimeoutMs();
235 this.maxIdleMs = opts.maxIdleMs ?? resolveMaxIdleMs();
236 this.handoverFrom = opts.handoverFrom ?? null;
237 // Daemon mode serves many concurrent clients on one event loop, so off-load
238 // read-tool dispatch to a worker pool — otherwise concurrent explores
239 // serialize and starve the MCP transport (clients time out). Direct mode
240 // (one stdio client) leaves the pool off; `CODEGRAPH_QUERY_POOL_SIZE=0`
241 // disables it here too.
242 this.engine = new MCPEngine({ queryPool: true });
243 this.engine.setProjectPathHint(projectRoot);
244 }
245
246 /**
247 * Bind the socket, refresh the ownership record, kick off engine init, and

Callers

nothing calls this directly

Calls 5

getDaemonSocketPathFunction · 0.90
getDaemonPidPathFunction · 0.90
resolveIdleTimeoutMsFunction · 0.85
resolveMaxIdleMsFunction · 0.85
setProjectPathHintMethod · 0.80

Tested by

no test coverage detected