MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / run

Method run

src/codegraphcontext/server.py:754–771  ·  view source on GitHub ↗

Runs the main server loop, listening for JSON-RPC requests from stdin.

(self)

Source from the content-addressed store, hash-verified

752 return {"error": f"Unknown tool: {tool_name}"}
753
754 async def run(self):
755 """
756 Runs the main server loop, listening for JSON-RPC requests from stdin.
757 """
758 # info_logger("MCP Server is running. Waiting for requests...")
759 print("MCP Server is running. Waiting for requests...", file=sys.stderr, flush=True)
760 self.code_watcher.start()
761
762 loop = asyncio.get_event_loop()
763 try:
764 await self._run_loop(loop)
765 finally:
766 # Release watcher/DB resources even when stdin reaches EOF or the
767 # loop exits unexpectedly.
768 try:
769 self.shutdown()
770 except Exception as exc:
771 warning_logger(f"Error during server shutdown: {exc}")
772
773 async def _run_loop(self, loop):
774 request_count = 0

Callers 2

mcp_startFunction · 0.95
mermaid-init.jsFile · 0.45

Calls 4

_run_loopMethod · 0.95
shutdownMethod · 0.95
warning_loggerFunction · 0.90
startMethod · 0.45

Tested by

no test coverage detected