Mcp-Puppeteer-Server

Mcp-Puppeteer-Server

3.4

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

The Puppeteer Model Context Protocol (MCP) server is designed to facilitate browser automation by leveraging Puppeteer, a Node library that provides a high-level API to control headless Chrome or Chromium. This server allows Language Model Models (LLMs) to perform various web interactions such as navigating to URLs, taking screenshots, clicking elements, and executing JavaScript in a real browser environment. It is particularly useful for tasks that require dynamic content rendering, form submissions, and other web-based interactions. The server supports both Docker and NPX configurations, making it versatile for different deployment environments. Additionally, it provides resources like console logs and screenshots, which can be accessed for further analysis or debugging.

Features

  • Browser automation
  • Console log monitoring
  • Screenshot capabilities
  • JavaScript execution
  • Basic web interaction (navigation, clicking, form filling)

MCP Tools

  • puppeteer_navigate: Navigate to any URL in the browser
  • puppeteer_screenshot: Capture screenshots of the entire page or specific elements
  • puppeteer_click: Click elements on the page
  • puppeteer_hover: Hover elements on the page
  • puppeteer_fill: Fill out input fields
  • puppeteer_select: Select an element with SELECT tag
  • puppeteer_evaluate: Execute JavaScript in the browser console

MCP Resources

  • {'name': 'Console Logs', 'description': 'Browser console output in text format'}
  • {'name': 'Screenshots', 'description': 'PNG images of captured screenshots'}

Usage with Different Platforms

Docker


{
  "mcpServers": {
    "puppeteer": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
    }
  }
}

NPX


{
  "mcpServers": {
    "puppeteer": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-puppeteer"]
    }
  }
}

Docker Build

bash
docker build -t mcp/puppeteer -f src/puppeteer/Dockerfile .