1 parent 6affe5c commit e33dfc4Copy full SHA for e33dfc4
1 file changed
src/mcp/server/mcpserver/server.py
@@ -414,7 +414,10 @@ def run(
414
415
match transport:
416
case "stdio":
417
- anyio.run(self.run_stdio_async)
+ try:
418
+ anyio.run(self.run_stdio_async)
419
+ except (KeyboardInterrupt, SystemExit):
420
+ pass
421
case "sse": # pragma: no cover
422
anyio.run(lambda: self.run_sse_async(**kwargs))
423
case "streamable-http": # pragma: no cover
0 commit comments