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

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

> This is a method of the [**Agent**](../classes/Agent) class in the [**agent**](../modules/agent) 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

<ParamField query="name" type="str" required={true}>
  The name used in `add_mcp_server`.
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if a server was removed, False if no server by that name existed.
</ResponseField>

## Uses

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

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="MCP Concept" icon="server" href="/docs/docs/concepts/mcp" />

  <Card title="MCP Lifecycle" icon="rotate" href="/docs/docs/features/mcp-lifecycle" />
</CardGroup>
