MCP Hub
Back to servers

Daytona Playwright MCP Server

An MCP server that enables users to control a full Chrome browser running in a Daytona cloud sandbox, allowing web browsing, interaction, and screenshot capture through Claude or other MCP clients.

glama
Forks
1
Updated
Apr 21, 2026

Daytona Playwright MCP Server

An MCP (Model Context Protocol) server that lets you control a full Chromium browser running inside a Daytona cloud sandbox. Use it with Claude Code, Claude Desktop, or any MCP-compatible client to browse the web, take screenshots, fill forms, and more.

https://github.com/user-attachments/assets/23b13e1f-4ed3-4204-ad0d-b2fdb1f77d0d

Features

  • Full Chromium Browser: Runs a real Chromium instance (not headless) in a virtual display
  • Cloud Sandbox: Browser runs securely in a Daytona sandbox, isolated from your local machine
  • Rich Tool Set: Navigate, click, type, scroll, take screenshots, extract content, manage tabs
  • Screenshot Support: Returns screenshots as images that Claude can see and analyze
  • Multiple Transports: Works with stdio (default), SSE, or HTTP

Quick Start

1. Install the Package

pipx install git+https://github.com/jamesmurdza/playwright-daytona-mcp-server.git

2. Get a Daytona API Key

  1. Sign up at daytona.io
  2. Go to your dashboard and generate an API key

3. Configure Claude Code / Claude Desktop

Add to your MCP settings:

{
  "mcpServers": {
    "daytona-playwright": {
      "command": "daytona-playwright-mcp",
      "env": {
        "DAYTONA_API_KEY": "your-api-key-here"
      }
    }
  }
}

Usage

Once configured, you can ask Claude to browse the web:

"Start a browser and go to https://news.ycombinator.com"

"Take a screenshot of the page"

"Click on the first article link"

"Search for 'AI news' on Google and show me the results"

"Fill out the contact form on example.com with test data"

Workflow

  1. Start the browser: Claude will call browser_start to create a Daytona sandbox with Chromium
  2. Navigate and interact: Use navigation, clicking, typing, and other tools
  3. Take screenshots: See what's on the page with browser_screenshot
  4. Clean up: Call browser_stop when done to delete the sandbox

Available Tools

Browser Lifecycle

ToolDescription
browser_startStart a new browser session in a Daytona sandbox
browser_stopStop the browser and clean up the sandbox
browser_statusCheck if the browser is running

Navigation

ToolDescription
browser_navigateNavigate to a URL
browser_backGo back in history
browser_forwardGo forward in history
browser_refreshRefresh the current page

Interaction

ToolDescription
browser_clickClick on an element (CSS, XPath, or text selector)
browser_typeType text into an input field
browser_pressPress keyboard keys (Enter, Tab, etc.)
browser_hoverHover over an element
browser_selectSelect from a dropdown
browser_scrollScroll the page or an element

Content Extraction

ToolDescription
browser_screenshotTake a screenshot (full page or element)
browser_get_textGet text content from the page
browser_get_htmlGet HTML content
browser_get_attributeGet an element's attribute
browser_evaluateRun JavaScript and get results

Waiting

ToolDescription
browser_wait_for_selectorWait for an element to appear/disappear
browser_wait_for_navigationWait for navigation to complete

Tab Management

ToolDescription
browser_new_tabOpen a new tab
browser_list_tabsList all open tabs
browser_switch_tabSwitch to a different tab
browser_close_tabClose a tab

File Operations

ToolDescription
browser_upload_fileUpload a file to a file input

Running with Different Transports

Stdio (Default - for Claude Code/Desktop)

daytona-playwright-mcp

HTTP Transport (for remote connections)

daytona-playwright-mcp --transport http --host 0.0.0.0 --port 8765

Then connect via: http://localhost:8765/mcp

SSE Transport (legacy)

daytona-playwright-mcp --transport sse --host 0.0.0.0 --port 8765

Environment Variables

VariableDescriptionDefault
DAYTONA_API_KEYYour Daytona API key (required)-
DAYTONA_API_URLDaytona API server URLhttps://app.daytona.io/api

Development

Run from Source

# Clone the repository
git clone https://github.com/jamesmurdza/playwright-daytona-mcp-server.git
cd playwright-daytona-mcp-server

# Install dependencies
uv sync

# Run the server
uv run daytona-playwright-mcp

Configure MCP for Development

When developing locally, use this MCP configuration:

{
  "mcpServers": {
    "daytona-playwright": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/playwright-daytona-mcp-server", "daytona-playwright-mcp"],
      "env": {
        "DAYTONA_API_KEY": "your-api-key-here"
      }
    }
  }
}

Run Tests

uv run pytest

How It Works

  1. When you call browser_start, the server:

    • Creates a Daytona sandbox (default Python sandbox has Chromium + Xvfb pre-installed)
    • Launches Chromium with remote debugging enabled
    • Starts a TCP proxy to expose the CDP port externally
    • Connects to Chromium via CDP (Chrome DevTools Protocol) through Daytona's secure signed URLs
  2. All browser commands are executed through the Playwright API connected to the remote browser

  3. Screenshots are captured as PNG images and returned via MCP's image content type

  4. When you call browser_stop, the sandbox is deleted and all resources are freed

Troubleshooting

"DAYTONA_API_KEY environment variable is not set"

Make sure your API key is configured in the MCP server settings, not just in your shell.

Browser fails to start

  • Check that your Daytona API key is valid
  • The sandbox may take a minute to provision on first use
  • Increase the timeout parameter if needed

Screenshots not appearing

  • Make sure you're using a recent version of Claude Code/Desktop that supports MCP images
  • The browser_screenshot tool returns an Image type that should render automatically

Connection timeouts

The default timeout is 60 seconds. For slower connections or first-time image builds, increase it:

"Start a browser with a 120 second timeout"

License

MIT - James Murdza, Harsh Verma

Credits

Reviews

No reviews yet

Sign in to write a review