MCPcopy
hub / github.com/colbymchenry/codegraph / constructor

Method constructor

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

Source from the content-addressed store, hash-verified

181 private pidPath: string;
182
183 constructor(
184 private projectRoot: string,
185 opts: { idleTimeoutMs?: number; maxIdleMs?: number } = {},
186 ) {
187 this.socketPath = getDaemonSocketPath(projectRoot);
188 this.pidPath = getDaemonPidPath(projectRoot);
189 this.idleTimeoutMs = opts.idleTimeoutMs ?? resolveIdleTimeoutMs();
190 this.maxIdleMs = opts.maxIdleMs ?? resolveMaxIdleMs();
191 // Daemon mode serves many concurrent clients on one event loop, so off-load
192 // read-tool dispatch to a worker pool — otherwise concurrent explores
193 // serialize and starve the MCP transport (clients time out). Direct mode
194 // (one stdio client) leaves the pool off; `CODEGRAPH_QUERY_POOL_SIZE=0`
195 // disables it here too.
196 this.engine = new MCPEngine({ queryPool: true });
197 this.engine.setProjectPathHint(projectRoot);
198 }
199
200 /**
201 * Bind the socket, kick off engine init, and register signal handlers. The

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