run
Method
This is a method of the MCPToolRunner class in the mcp module.Main thread function that processes MCP requests. On Windows the stdio transport must spawn a child process (e.g.
npx)
and talk to it over pipes. A non-main thread gets a SelectorEventLoop
by default there, which does not support subprocesses and fails with an
opaque fileno error during init (issue #5598). Use a dedicated
ProactorEventLoop on Windows so subprocess stdio works; other
platforms keep the standard asyncio.run behaviour.
Signature
Returns
Any
The result of the operation.
Uses
platform.systemasyncio.ProactorEventLoopasyncio.set_event_looploop.run_until_completeloop.shutdown_asyncgensloop.shutdown_default_executorloop.closeasyncio.run
Used By
Source
View on GitHub
praisonaiagents/mcp/mcp.py at line 70
