# Legato

> Legato is an open-source MCP server for developer tools. MCP server that gives a coding agent a Linux desktop it can see, click and type on. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Linux, macOS, Windows, CLI
- **Website:** https://legato.computer/docs/mcp
- **Repository:** https://github.com/legatolabs/legato
- **MCP Registry name:** io.github.legatolabs/legato
- **Categories:** developer tools, browser automation
- **Listing updated:** 2026-11-14

## About

The desktop can be a Docker container on your machine, your own screen, a sandbox you already run over SSH, Daytona or a VM, or a cloud desktop on E2B. The container option needs only Docker and gives the agent a Linux desktop with a terminal and Firefox, with no access to your own screen. With the local option on macOS, Windows or Linux on X11, the agent moves your real mouse and keyboard, and pushing the pointer into a screen corner stops it.

Every action returns a screenshot once the screen stops changing, instead of waiting a fixed sleep. Two modes are offered: desktop_act lets your agent's own model drive, while desktop_run_task hands a whole GUI task to any OpenAI-compatible model, defaulting to Qwen3.8-27B on OpenRouter. A --record option saves every screenshot with a log of actions.

Legato is also an open-source Python computer-use harness. Its README reports Claude Sonnet 5.5 running 1.48x faster than Anthropic's reference loop on 24 office tasks, and Qwen3.8-27B completing 71 of 96 versus 53 of 96 for OSWorld's agent.

## Features

- **Choice of desktop:** Docker container, your own screen, your own sandbox or an E2B cloud desktop.
- **Settled screenshots:** Each action returns a screenshot once the screen stops changing.
- **Agent-driven control:** desktop_act supports clicks, typing, scrolling, dragging and waiting.
- **Delegated tasks:** desktop_run_task offloads a whole GUI task to an OpenAI-compatible model.
- **Session recording:** Save screenshots and an action log for every desktop.
- **Python harness:** Use the same engine from code with the legatolabs package.

## Good for

- Test a GUI you are building
- Check a page in a real browser
- Offload a long desktop task to a cheaper open model
- Let a coding agent verify a chart or layout fix visually
- Run computer use on Linux in CI

## Install

### Claude Code (Terminal)

```sh
claude mcp add legato --env OPENROUTER_API_KEY='<OPENROUTER_API_KEY>' -- uvx legatolabs
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "legato": {
      "command": "uvx",
      "args": [
        "legatolabs"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "legato": {
      "command": "uvx",
      "args": [
        "legatolabs"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "legato": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "legatolabs"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "legato": {
      "command": "uvx",
      "args": [
        "legatolabs"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "legato": {
      "command": "uvx",
      "args": [
        "legatolabs"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<OPENROUTER_API_KEY>"
      }
    }
  }
}
```

## Tools

- `desktop_open`: Open a desktop and return its id and first screenshot
- `desktop_act`: Click, type, key, scroll, drag or wait and return the settled screenshot
- `desktop_screenshot`: Return the current screen
- `desktop_run_task`: Hand a whole task to an OpenAI-compatible model and return the run report and final screen
- `desktop_close`: Stop the desktop

## FAQ

### What does the container option need?

Only Docker; the agent gets a Linux desktop with a terminal and Firefox and cannot touch your screen.

### Do I need an API key?

Only for desktop_run_task with its default model, which reads OPENROUTER_API_KEY; the E2B cloud option also needs an E2B key.

### Which systems can I control directly?

With the local option, macOS, Windows or Linux on X11.

### How is it installed?

pip install "legatolabs[mcp,local]", then add it with claude mcp add legato -- legato mcp, plus a sandbox flag.

### Is Legato free?

Yes. Legato is open source, so you can use and self-host it for free.

### How do I add Legato to Claude Code?

Run this command in your terminal: claude mcp add legato --env OPENROUTER_API_KEY='<OPENROUTER_API_KEY>' -- uvx legatolabs

### What are the best alternatives to Legato?

The closest alternatives to Legato are REA, Browser Use, Scrapling MCP Server, Codebase Memory and GitHub.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Browser Use](https://ai-powered.com/mcp/browser-use): Browser Use is a freemium MCP server for browser automation.
- [Scrapling MCP Server](https://ai-powered.com/mcp/scrapling-mcp-server): Scrapling MCP Server is an open-source MCP server for web search and scraping.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/legato
