Skip to main content

stop

Method
This is a method of the MCPToolRunner class in the mcp module.
Best-effort teardown for the runner thread. Queues the shutdown sentinel and joins the thread so the request loop exits and its stdio subprocess is terminated instead of leaking a background thread (and its child) across the process lifetime. The request loop polls the queue between async operations, so once any in-flight call unwinds the sentinel is consumed promptly.

Signature

Parameters

Any
Seconds to wait for the thread to exit. Defaults to the runner’s own operation timeout so an in-flight call has a chance to finish before we give up. The thread is a daemon, so this never blocks interpreter exit even if the join times out.

Returns

Any
The result of the operation.

Uses

  • put
  • is_alive

Used By

Source

View on GitHub

praisonaiagents/mcp/mcp.py at line 255