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

Method constructor

src/mcp/daemon.ts:298–315  ·  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

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