Deno 2 Playwright Model Context Protocol Server Example

Deno 2 Playwright Model Context Protocol Server Example

By jakedahn GitHub

A Model Context Protocol server that provides browser automation capabilities using Playwright and Deno 2.

Overview

what is Deno 2 Playwright MCP Server?

Deno 2 Playwright MCP Server is a Model Context Protocol server that provides browser automation capabilities, allowing LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment using Playwright and Deno 2.

how to use Deno 2 Playwright MCP Server?

To use the Deno 2 Playwright MCP Server, you must build the appropriate binary for your operating system and configure it in your application settings to point to the binary executable.

key features of Deno 2 Playwright MCP Server?

  • Browser automation capabilities using Playwright
  • Ability to execute JavaScript in a real browser environment
  • Supports various platforms including macOS, Linux, and Windows

use cases of Deno 2 Playwright MCP Server?

  1. Automating web testing for applications
  2. Taking screenshots of web pages programmatically
  3. Capturing and running JavaScript codes in a headless browser

FAQ from Deno 2 Playwright MCP Server?

  • What is the compatibility of Deno 2 Playwright MCP Server?

The server is compatible with Deno 2 and can be built for macOS, Linux, and Windows environments.

  • Is it possible to customize the server settings?

Yes! You can customize the server settings by modifying the configuration file to point to the specific executable binary.

  • How do I build the server for different platforms?

You can build the server using specific deno tasks such as deno task build-mac, deno task build-linux-x86_64, etc.

Content

Deno 2 Playwright Model Context Protocol Server Example

A Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.

This repo uses Deno 2, which has nice ergonomics, because you can compile a binary and run it without any runtime dependencies.

This code is heavily based on the official Puppeteer MCP server, which you can find here: https://github.com/modelcontextprotocol/servers/tree/main/src/puppeteer

How to build

Only the mac binary build has been tested, but you should be able to build an executable binary for linux x86_64, linux ARM64, and windows x86_64.

  • deno task build-mac
  • deno task build-linux-x86_64
  • deno task build-linux-ARM64
  • deno task build-windows-x86_64

How to run

To invoke the playwright-server binary, you need to update your ~/Library/Application\ Support/Claude/claude_desktop_config.json to point to the binary.

{
  "mcpServers": {
    "playwright": {
      "command": "/path/to/deno2-playwright-mcp-server/playwright-server"
    }
  }
}
No tools information available.
No content found.