mcp-server-playwright logo

mcp-server-playwright

by hdcola

This project is an experimental server that uses Playwright to manipulate a browser through MCP. It aims to implement a feature to control the browser using AI.

View on GitHub

Last updated: N/A

mcp-server-playwright

This project is an experimental project aimed at manipulating a browser through MCP using Playwright, in order to implement a feature to control the browser through AI.

Tools

  • open-browser(url) : Open a browser with the specified URL(option).
  • close-page(pageNumber: int) : Close a desiginated page in current browser.
  • close-browser() : Close the browser.
  • navigate-to-page(url) : Navigate to the specified URL.
  • open-new-page(url) : Open a page in a new tab.
  • get-page-content() : Get the readability content of the current page.

Usage

Install dependencies

  • bun
  • pnpm
pnpm install

MCP Configuration

{
  "mcpServers": {
    "mcp-server-playwright": {
      "command": "bun",
      "args": ["yourpath/mcp-server-playwright/src/index.ts"],
      "env": {
        "CHROME_PATH": "your_chrome_path",
        "MUSER_DATA_DIR": "your_chrome_user_data_path"
      }
    }
  }
}

Have fun!