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

# MCP Servers

> Add, remove, and toggle MCP servers from the Desktop app

Connect external tools to your agent by adding MCP servers directly in the app — name, command, args, and an on/off toggle.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent
from praisonaiagents.mcp import MCP

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    tools=MCP("npx -y @modelcontextprotocol/server-filesystem /tmp"),
)
agent.start("List the files you can reach")
```

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Desktop[🖥️ Desktop App] --> Server[🔌 MCP Server]
    Server --> Tools[🔧 External Tools]

    classDef app fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef server fill:#189AB4,stroke:#7C90A0,color:#fff
    classDef tools fill:#10B981,stroke:#7C90A0,color:#fff

    class Desktop app
    class Server server
    class Tools tools
```

## Quick Start

<Steps>
  <Step title="Open the MCP panel">
    Find the MCP servers panel in the app.
  </Step>

  <Step title="Add a server">
    Enter a **name**, **command**, and **args**, then save. The app stores it and marks it enabled.
  </Step>

  <Step title="Toggle or remove">
    Flip a server on or off, or remove it — all from the same panel.
  </Step>
</Steps>

***

## How It Works

The app manages servers through a single endpoint (`POST /mcp`) with an `action` of `add`, `remove`, or `toggle`, and lists them with `GET /mcp`.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph TB
    Add[➕ add] --> Store[(📁 mcp.json)]
    Toggle[🔀 toggle] --> Store
    Remove[➖ remove] --> Store
    Store --> List[📋 GET /mcp]

    classDef action fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef store fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef list fill:#10B981,stroke:#7C90A0,color:#fff

    class Add,Toggle,Remove action
    class Store store
    class List list
```

Each server stores exactly these fields:

| Field     | Type     | Notes                                         |
| --------- | -------- | --------------------------------------------- |
| `name`    | `string` | Required; adding an existing name replaces it |
| `command` | `string` | The executable to launch                      |
| `args`    | `array`  | Arguments passed to the command               |
| `enabled` | `bool`   | Defaults to `true` on add                     |

<Note>
  Adding a server with a name that already exists replaces the previous entry rather than duplicating it.
</Note>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Name servers clearly">
    The name is the key. A clear, unique name makes toggling and removing obvious, and prevents an accidental replace.
  </Accordion>

  <Accordion title="Toggle instead of removing">
    Disable a server you may want back rather than removing it — the entry and its args are preserved.
  </Accordion>

  <Accordion title="Test the command outside the app first">
    `command` and `args` launch a process. Confirm they run in a terminal before adding them, so a failure is obvious.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="MCP Overview" icon="plug" href="/docs/features/mcp">
    Author and understand MCP servers themselves
  </Card>

  <Card title="Settings Reference" icon="sliders" href="/docs/features/desktop/settings">
    Other Desktop app configuration
  </Card>
</CardGroup>
