MCPcopy Create free account
hub / github.com/AI45Lab/Code / run

Method run

examples/ahp_agent_monitors_agent.py:215–230  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

213 return {"jsonrpc": "2.0", "id": req_id, "result": result}
214
215 def run(self):
216 log("在 stdin 上监听 JSON-RPC 2.0 消息...")
217
218 for raw_line in sys.stdin:
219 line = raw_line.strip()
220 if not line:
221 continue
222 try:
223 msg = json.loads(line)
224 response = self.dispatch(msg)
225 if response is not None:
226 print(json.dumps(response, ensure_ascii=False), flush=True)
227 except json.JSONDecodeError as e:
228 log(f"JSON 解析错误: {e} | 输入: {line[:60]}")
229 except Exception as e:
230 log(f"调度错误: {e}")
231
232
233if __name__ == "__main__":

Callers 2

test_skill_tool.pyFile · 0.45

Calls 2

dispatchMethod · 0.95
logFunction · 0.70

Tested by

no test coverage detected