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

Method constructor

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

Source from the content-addressed store, hash-verified

295 private handoverFrom: number | null;
296
297 constructor(
298 private projectRoot: string,
299 opts: { idleTimeoutMs?: number; maxIdleMs?: number; handoverFrom?: number | null; rootGoneGraceMs?: number } = {},
300 ) {
301 this.socketPath = getDaemonSocketPath(projectRoot);
302 this.pidPath = getDaemonPidPath(projectRoot);
303 this.idleTimeoutMs = opts.idleTimeoutMs ?? resolveIdleTimeoutMs();
304 this.maxIdleMs = opts.maxIdleMs ?? resolveMaxIdleMs();
305 this.handoverFrom = opts.handoverFrom ?? null;
306 this.rootGoneGraceMs = opts.rootGoneGraceMs ?? resolveRootGoneGraceMs();
307 // Daemon mode serves many concurrent clients on one event loop, so off-load
308 // read-tool dispatch to a worker pool — otherwise concurrent explores
309 // serialize and starve the MCP transport (clients time out). Direct mode
310 // (one stdio client) leaves the pool off; `CODEGRAPH_QUERY_POOL_SIZE=0`
311 // disables it here too.
312 this.engine = new MCPEngine({ queryPool: true });
313 this.engine.setProjectPathHint(projectRoot);
314 }
315
316 /**
317 * Bind the socket, refresh the ownership record, kick off engine init, and

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected