RR

random-robbie/mcp-web-browser

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

27 stars 6 forks 품질 64 트렌드 11MIT

An advanced web browsing server for the Model Context Protocol (MCP) powered by Playwright, enabling headless browser interactions through a flexible, secure API.

개요

An advanced web browsing server for the Model Context Protocol (MCP) powered by Playwright, enabling headless browser interactions through a flexible, secure API. - : Navigate to any website with SSL certificate validation bypass - : Retrieve complete HTML content, including dynamically loaded JavaScript - : Create, manage, and switch between multiple browser tabs - : - Extract text content - Click page elements - Input text into form fields - Capture screenshots - Extract page links with filtering capabilities - Scroll pages in any direction - Execute JavaScript on pages - Refresh pages - Wait for navigation to complete - : Automatic cleanup of unused resources after inactivity - : Get detailed metadata about the current page - SSL certificate validation bypass - Secure browser context management - Custom user-agent configuration - Error handling and comprehensive logging - Configurable timeout settings - CSP bypass control - Protection against cookie stealing - : Automatically...

README

원문 README의 일부입니다. 원문 보기.

MCP Web Browser Server

An advanced web browsing server for the Model Context Protocol (MCP) powered by Playwright, enabling headless browser interactions through a flexible, secure API.

🌐 Features

  • Headless Web Browsing: Navigate to any website with SSL certificate validation bypass
  • Full Page Content Extraction: Retrieve complete HTML content, including dynamically loaded JavaScript
  • Multi-Tab Support: Create, manage, and switch between multiple browser tabs
  • Advanced Web Interaction Tools:
    • Extract text content
    • Click page elements
    • Input text into form fields
    • Capture screenshots
    • Extract page links with filtering capabilities
    • Scroll pages in any direction
    • Execute JavaScript on pages
    • Refresh pages
    • Wait for navigation to complete
  • Resource Management: Automatic cleanup of unused resources after inactivity
  • Enhanced Page Information: Get detailed metadata about the current page

🚀 Quick Start

Prerequisites

  • Python 3.10+
  • MCP SDK
  • Playwright

Installation

# Install MCP and Playwright
pip install mcp playwright

# Install browser dependencies
playwright install

Configuration for Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "web-browser": {
      "command": "python",
      "args": [
        "/path/to/your/server.py"
      ]
    }
  }
}

💡 Usage Examples

Basic Web Navigation

# Browse to a website
page_content = browse_to("https://example.com")

# Extract page text
text_content = extract_text_content()

# Extract text from a specific element
title_text = extract_text_content("h1.title")

Web Interaction

# Navigate to a page
browse_to("https://example.com/login")

# Input text into a form
input_text("#username", "your_username")
input_text("#password", "your_password")

# Click a login button
click_element("#login-button")

Screenshot Capture

# Capture full page screenshot
full_page_screenshot = get_page_screenshots(full_page=True)

# Capture specific element screenshot
element_screenshot = get_page_screenshots(selector="#main-content")
# Get all links on the page
page_links = get_page_links()

# Get links matching a pattern
filtered_links = get_page_links(filter_pattern="contact")

Multi-Tab Browsing

# Create a new tab
tab_id = create_new_tab("https://example.com")

# Create another tab
another_tab_id = create_new_tab("https://example.org")

# List all open tabs
tabs = list_tabs()

# Switch between tabs
switch_tab(tab_id)

# Close a tab
close_tab(another_tab_id)

Advanced Interactions

# Scroll the page
scroll_page(direction="down", amount="page")

# Execute JavaScript on the page
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "web-browser": { "command": "python", "args": [ "/path/to/your/server.py" ] } } }