***

title: shutdown
slug: /reference/python/agents/mcp-gateway/session-manager/shutdown
description: Close all sessions and stop the background cleanup thread.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[mcpgateway-shutdown]: /docs/server-sdks/reference/python/agents/mcp-gateway/mcp-gateway/shutdown

Close all active sessions and stop the background cleanup thread. Each session's
underlying MCP client process is stopped. Called automatically during
[`MCPGateway.shutdown()`][mcpgateway-shutdown].

## **Parameters**

None.

## **Returns**

`None`

## **Example**

```python {6}
from signalwire.mcp_gateway import SessionManager

config = {"session": {"default_timeout": 300}}
manager = SessionManager(config)
# ... create and use sessions ...
manager.shutdown()
```