> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# shutdown • AI Agent SDK

> shutdown: Signal the thread to shut down.

# shutdown

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**MCPToolRunner**](../classes/MCPToolRunner) class in the [**mcp**](../modules/mcp) module.

Signal the thread to shut down.

Queues a sentinel that the request loop consumes to exit cleanly. This
only takes effect once initialization has completed and the loop is
running; use :meth:`stop` for a best-effort teardown when init never
finished (e.g. a timed-out handshake) so the daemon thread and its
stdio child do not leak across construction retries (issue #4375).

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def shutdown() -> Any
```

### Returns

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

* `put`

## Used By

* [`Agent.remove_mcp_server`](../functions/Agent-remove_mcp_server)
* [`Agent.close`](../functions/Agent-close)
* [`Agent.close`](../functions/Agent-close)
* [`Agent.aclose`](../functions/Agent-aclose)
* [`Agent.aclose`](../functions/Agent-aclose)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/mcp/mcp.py#L244">
  `praisonaiagents/mcp/mcp.py` at line 244
</Card>
