> ## 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.

# Remove MCP Server • AI Agent SDK

> remove_mcp_server: Disconnect and deregister a previously attached MCP server.

# remove\_mcp\_server

Method

> This is a method of the [**Agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/Agent.md) class in the [**agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/agent.md) module.

Disconnect and deregister a previously attached MCP server.

Removes the server's tools from `self.tools` and shuts the connection
down cleanly (no leaked background loops). Tools disappear on the next
turn.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def remove_mcp_server(name: str) -> bool
```

## Parameters

**name** `str` *required*

The name used in `add_mcp_server`.

### Returns

**Returns** `bool`

True if a server was removed, False if no server by that name existed.

## Uses

* `mcp.shutdown`
* `logging.warning`
* `refresh_tools`
* `logging.debug`

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/agent.py#L6106)
>
> `praisonaiagents/agent/agent.py` at line 6106

***

## Related Documentation

> [card] [MCP Concept](https://praison.ai/docs/docs/concepts/mcp)

> [card] [MCP Lifecycle](https://praison.ai/docs/docs/features/mcp-lifecycle)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.