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

Function spawnServer

__tests__/mcp-roots.test.ts:27–33  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

25const BIN = path.resolve(__dirname, '../dist/bin/codegraph.js');
26
27function spawnServer(cwd: string): ChildProcessWithoutNullStreams {
28 // --no-watch keeps the test deterministic and avoids watcher startup noise.
29 return spawn(process.execPath, [BIN, 'serve', '--mcp', '--no-watch'], {
30 cwd,
31 stdio: ['pipe', 'pipe', 'pipe'],
32 }) as ChildProcessWithoutNullStreams;
33}
34
35/** Parse every JSON-RPC message the server writes to stdout into an array. */
36function collectMessages(child: ChildProcessWithoutNullStreams): Array<Record<string, any>> {

Callers 1

mcp-roots.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected