playwright-mcp-server

playwright-mcp-server

3.4

This project is a server that provides Playwright web page content retrieval functionality using the Model Context Protocol (MCP).

The Playwright MCP Server is designed to facilitate web page content retrieval and interaction using the Model Context Protocol (MCP). It offers a range of features including page navigation, content retrieval, and simulation of mouse operations. The server is particularly useful for automating web interactions and testing web applications. It supports full and visible content retrieval, detection of interactive elements, and various mouse operations such as clicks and drag-and-drop. The server can be installed via Smithery or manually, and it provides a set of MCP tools for different operations. It is important to configure the server properly and adhere to the terms of service of target websites when using it.

Features

  • Page navigation
  • Full page content retrieval
  • Visible content retrieval
  • Interactive elements detection
  • Mouse operation simulation

MCP Tools

  • {'navigate': 'Navigate to a specified URL'}
  • {'get_all_content': 'Retrieve content from the entire page'}
  • {'get_visible_content': 'Retrieve currently visible content'}
  • {'get_interactive_elements': 'Get position information of interactive elements on the page'}
  • {'move_mouse': 'Move mouse cursor to specified coordinates'}
  • {'mouse_click': 'Execute mouse click at specified coordinates'}
  • {'mouse_wheel': 'Execute mouse wheel scrolling'}
  • {'drag_and_drop': 'Execute drag and drop operation'}
  • {'echo': 'Echo tool for testing'}

Usage with Different Platforms

install_via_smithery

bash
npx -y @smithery/cli install @showfive/playwright-mcp-server --client claude

manual_installation

bash
npm install

starting_the_server

bash
npm run build
npm start

running_tests

bash
# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage