Playwright MCP Server - NixOS Flake

by benjaminkitt

424 downloads Not rated yet

About

A comprehensive NixOS Flake development environment for the Playwright MCP (Model Context Protocol) server with full Chrome and Firefox support, including persistent browser profiles.

Explore

- ✅ Complete Playwright MCP Server Setup: Based on Microsoft's official implementation
- ✅ Multi-Browser Support: Both Chrome/Chromium and Firefox browsers included
- ✅ Profile Persistence: Maintains browser profiles between sessions
- ✅ Desktop Profile Integration: Can import existing Chrome/Firefox profiles from your desktop
- ✅ NixOS Integration: Properly configured for NixOS with all dependencies
- ✅ Development Environment: Ready-to-use development shell with all tools
- ✅ AI Agent Compatible: Can be added as a URL to development environments for AI agents

The flake includes a default configuration file that can be customized. Key features:

- Browser Support: Both Chromium and Firefox
- Profile Persistence: Profiles are saved between sessions
- Headed Mode: Browser windows are visible by default
- Full Capabilities: All MCP capabilities enabled (tabs, PDF, history, wait, files, install, testing)


playwright-mcp-wrapped

playwright-mcp-wrapped --config /path/to/config.json

nix run .#setup-profiles

This will copy your existing Chrome/Chromium and Firefox profiles to the Playwright MCP directories:
- Chrome: ~/.local/share/playwright-mcp/chrome-profile
- Firefox: ~/.local/share/playwright-mcp/firefox-profile

Add this flake as a development environment URL:

{
  "devEnvironments": {
    "playwright-mcp": {
      "url": "github:benjaminkitt/playwright-mcp-nix"
    }
  }
}

Or for Claude Desktop MCP configuration:

{
  "mcpServers": {
    "playwright": {
      "command": "nix",
      "args": ["run", "github:benjaminkitt/playwright-mcp-nix"]
    }
  }
}

The MCP server supports extensive configuration through command-line arguments:

--allowed-origins      # Semicolon-separated allowed origins
--blocked-origins      # Semicolon-separated blocked origins
--browser             # Browser to use: chrome, firefox, webkit, msedge
--headless            # Run in headless mode
--user-data-dir       # Custom profile directory
--viewport-size       # Browser viewport size (e.g., "1920,1080")
--device              # Device to emulate (e.g., "iPhone 15")
--proxy-server        # Proxy server configuration
--storage-state       # Path to storage state file
--isolated            # Use isolated (non-persistent) profiles
--vision              # Use screenshot mode instead of accessibility snapshots
--config              # Path to JSON configuration file

A comprehensive NixOS Flake development environment for the Playwright MCP (Model Context Protocol) server with full Chrome and Firefox support, including persistent browser profiles.

Features

- ✅ Complete Playwright MCP Server Setup: Based on Microsoft's official implementation
- ✅ Multi-Browser Support: Both Chrome/Chromium and Firefox browsers included
- ✅ Profile Persistence: Maintains browser profiles between sessions
- ✅ Desktop Profile Integration: Can import existing Chrome/Firefox profiles from your desktop
- ✅ NixOS Integration: Properly configured for NixOS with all dependencies
- ✅ Development Environment: Ready-to-use development shell with all tools
- ✅ AI Agent Compatible: Can be added as a URL to development environments for AI agents

Quick Start

Using with direnv (Recommended)

1. Clone this repository or copy the flake.nix to your project
2. Enable direnv: direnv allow
3. The environment will automatically activate when you enter the directory

Manual activation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.