MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / rpc

Function rpc

scripts/memlab-drive.py:17–32  ·  view source on GitHub ↗
(proc, payload, timeout_note)

Source from the content-addressed store, hash-verified

15
16
17def rpc(proc, payload, timeout_note):
18 proc.stdin.write(json.dumps(payload) + "\n")
19 proc.stdin.flush()
20 while True:
21 line = proc.stdout.readline()
22 if not line:
23 raise RuntimeError(f"server closed stdout while waiting for {timeout_note}")
24 line = line.strip()
25 if not line.startswith("{"):
26 continue
27 try:
28 message = json.loads(line)
29 except json.JSONDecodeError:
30 continue
31 if message.get("id") == payload.get("id"):
32 return message
33
34
35def tool_failed(reply):

Callers 1

mainFunction · 0.70

Calls 3

flushMethod · 0.80
getMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected