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

Method run

src/codegraphcontext/server.py:686–703  ·  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

684 return {"error": f"Unknown tool: {tool_name}"}
685
686 async def run(self):
687 """
688 Runs the main server loop, listening for JSON-RPC requests from stdin.
689 """
690 # info_logger("MCP Server is running. Waiting for requests...")
691 print("MCP Server is running. Waiting for requests...", file=sys.stderr, flush=True)
692 self.code_watcher.start()
693
694 loop = asyncio.get_event_loop()
695 try:
696 await self._run_loop(loop)
697 finally:
698 # Release watcher/DB resources even when stdin reaches EOF or the
699 # loop exits unexpectedly.
700 try:
701 self.shutdown()
702 except Exception as exc:
703 warning_logger(f"Error during server shutdown: {exc}")
704
705 async def _run_loop(self, loop):
706 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