# Daytona MCP Server (/docs/mcp)

Daytona Model Context Protocol (MCP) server enables AI agents to interact with [Daytona Sandboxes](/docs/sandboxes) programmatically. This guide covers how to set up and use the MCP server with various AI agents.

## Install Daytona CLI [#install-daytona-cli]

Install the Daytona CLI to manage the MCP server.

<Tabs syncKey="os">
<TabItem label="Mac/Linux">

```bash
brew install daytonaio/cli/daytona
```

</TabItem>
<TabItem label="Windows">

```bash
powershell -Command "irm https://get.daytona.io/windows | iex"
```

</TabItem>
</Tabs>

## Authenticate with Daytona [#authenticate-with-daytona]

Authenticate with Daytona to enable MCP server access.

<Tabs>
<TabItem label="CLI" icon="seti:shell">

```bash
daytona login
```

</TabItem>
</Tabs>

## Initialize MCP server [#initialize-mcp-server]

Initialize the MCP server with your preferred AI agent. Supported agents include Claude, Cursor, and Windsurf.

<Tabs>
<TabItem label="CLI" icon="seti:shell">

```bash
# Initialize with Claude
daytona mcp init claude

# Initialize with Cursor
daytona mcp init cursor

# Initialize with Windsurf
daytona mcp init windsurf
```

</TabItem>
</Tabs>

After initialization, open your AI agent application to begin using Daytona features.

## Configure MCP server [#configure-mcp-server]

Generate MCP configuration for integration with other AI agents.

<Tabs>
<TabItem label="CLI" icon="seti:shell">

```bash
daytona mcp config
```

</TabItem>
</Tabs>

This command outputs a JSON configuration that you can copy into your agent's settings:

```json
{
  "mcpServers": {
    "daytona-mcp": {
      "command": "daytona",
      "args": ["mcp", "start"],
      "env": {
        "HOME": "${HOME}",
        "PATH": "${HOME}:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin"
      },
      "logFile": "${HOME}/Library/Logs/daytona/daytona-mcp-server.log"
    }
  }
}
```

<Callout type="note">
On Windows, the Unix `PATH` and `HOME` values and the macOS log path do not apply. Set `APPDATA`, which the CLI uses to locate its configuration directory, and write the log under it:
<br />
```json
{
  "mcpServers": {
    "daytona-mcp": {
      "command": "daytona",
      "args": ["mcp", "start"],
      "env": {
        "APPDATA": "${APPDATA}"
      },
      "logFile": "${APPDATA}\\.daytona\\daytona-mcp.log"
    }
  }
}
```
</Callout>

## Start MCP server [#start-mcp-server]

Manually start the MCP server.

<Tabs>
<TabItem label="CLI" icon="seti:shell">

```bash
daytona mcp start
```

</TabItem>
</Tabs>

## Available tools [#available-tools]

MCP server provides the following tools for interacting with Daytona Sandboxes:

- [Sandbox management](/docs/sandboxes)
- [File system operations](/docs/file-system-operations)
- [Git operations](/docs/git-operations)
- [Process and code execution](/docs/process-code-execution)
- [Computer use](/docs/computer-use)
- [Preview](/docs/preview)
