MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / writeFramedMessage

Function writeFramedMessage

tests/mcp.test.ts:121–126  ·  view source on GitHub ↗
(child: ReturnType<typeof startServer>, payload: unknown)

Source from the content-addressed store, hash-verified

119}
120
121function writeFramedMessage(child: ReturnType<typeof startServer>, payload: unknown) {
122 const input = child.stdin;
123 if (!input) throw new Error("stdin unavailable");
124 const body = JSON.stringify(payload);
125 input.write(`Content-Length: ${Buffer.byteLength(body)}\r\n\r\n${body}`);
126}
127
128function writeLineMessage(child: ReturnType<typeof startServer>, payload: unknown) {
129 const input = child.stdin;

Callers 1

mcp.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected