Playwright Fetch MCP Server

by ThreatFlux
MIT License

Integrations

  • Integrates with Codecov for code coverage reporting and tracking through CI/CD workflows.

  • Offers pre-built Docker images available through Docker Hub and GitHub Container Registry for containerized deployment.

  • Enables integration with GitHub through container registry support and CI/CD workflows.

극작가 MCP 서버 가져오기

Playwright를 사용하여 브라우저 자동화를 위한 웹 콘텐츠 가져오기 기능을 제공하는 모델 컨텍스트 프로토콜 서버입니다. 이 서버를 통해 LLM은 웹 페이지에서 JavaScript로 렌더링된 콘텐츠를 검색하고 처리하며, HTML을 마크다운으로 변환하여 더 쉽게 사용할 수 있습니다.

작가

Wyatt Roersma 가 Claude Code의 도움을 받아 제작했습니다.

주요 특징

  • 브라우저 자동화 : Playwright를 사용하여 JavaScript를 완벽하게 지원하여 웹 페이지를 렌더링합니다.
  • 콘텐츠 추출 : 웹 페이지에서 주요 콘텐츠 영역을 자동으로 식별하고 추출합니다.
  • 마크다운 변환 : HTML을 깔끔하고 읽기 쉬운 마크다운으로 변환합니다.
  • 페이지 매김 지원 : 페이지 매김을 통해 대용량 콘텐츠를 처리합니다.
  • Robots.txt 준수 : 자율적 페칭을 위해 robots.txt 지침을 준수합니다.
  • 프록시 지원 : 프록시 서버를 통해 라우팅 요청을 허용합니다.
  • Docker Ready : Docker HubGitHub Container Registry를 통해 미리 빌드된 Docker 이미지로 사용 가능

사용 가능한 도구

  • playwright-fetch - Playwright 브라우저 자동화를 사용하여 URL을 가져오고 해당 내용을 마크다운으로 추출합니다.
    • url (문자열, 필수): 가져올 URL
    • max_length (정수, 선택 사항): 반환할 최대 문자 수(기본값: 5000)
    • start_index (정수, 선택 사항): 이 문자 인덱스에서 시작 콘텐츠(기본값: 0)
    • raw (부울, 선택 사항): 마크다운 변환 없이 원시 콘텐츠를 가져옵니다(기본값: false)
    • wait_for_js (부울, 선택 사항): JavaScript가 실행될 때까지 기다립니다(기본값: true)

프롬프트

  • 극작가-페치
    • Playwright를 사용하여 URL을 가져오고 해당 내용을 마크다운으로 추출합니다.
    • 인수:
      • url (문자열, 필수): 가져올 URL

요구 사항

  • Python 3.13.2 이상
  • uv 패키지 관리자
  • Playwright 브라우저 설치됨

설치

1. uv로 설치하기 (권장)

지엑스피1

또는 저장소를 복제하고 설치하세요.

git clone https://github.com/ThreatFlux/playwright-fetch.git cd playwright-fetch uv pip install -e . # Install Playwright browsers uv pip exec playwright install

2. Docker 사용하기

Docker Hub 또는 GitHub Container Registry에서 미리 작성된 Docker 이미지를 사용할 수 있습니다.

# From Docker Hub docker pull threatflux/playwright-fetch:latest # From GitHub Container Registry docker pull ghcr.io/threatflux/playwright-fetch:latest

아니면 직접 만들어 보세요:

docker build -t threatflux/playwright-fetch .

구성

Claude.app에 대한 구성

Claude 설정에 추가:

"mcpServers": { "playwright-fetch": { "command": "uvx", "args": ["mcp-server-playwright-fetch"] } }
"mcpServers": { "playwright-fetch": { "command": "docker", "args": ["run", "-i", "--rm", "threatflux/playwright-fetch"] } }

VS Code에 대한 구성

수동 설치의 경우 VS Code의 사용자 설정(JSON) 파일에 다음 JSON 블록을 추가합니다.

{ "mcp": { "servers": { "playwright-fetch": { "command": "uvx", "args": ["mcp-server-playwright-fetch"] } } } }
{ "mcp": { "servers": { "playwright-fetch": { "command": "docker", "args": ["run", "-i", "--rm", "threatflux/playwright-fetch"] } } } }

명령줄 옵션

서버는 다음과 같은 명령줄 옵션을 지원합니다.

  • --user-agent : 사용자 정의 사용자 에이전트 문자열
  • --ignore-robots-txt : robots.txt 제한을 무시합니다.
  • --proxy-url : 요청에 사용할 프록시 URL
  • --headless : 브라우저를 헤드리스 모드로 실행합니다(기본값: True)
  • --wait-until : 탐색이 성공한 것으로 간주할 시점(선택 사항: "load", "domcontentloaded", "networkidle", "commit", 기본값: "networkidle")

사용 예

# Run with default settings uv run mcp-server-playwright-fetch # Run with a custom user agent and proxy uv run mcp-server-playwright-fetch --user-agent="MyCustomAgent/1.0" --proxy-url="http://myproxy:8080" # Run with visible browser for debugging uv run mcp-server-playwright-fetch --headless=false

디버깅

MCP 검사기를 사용하여 서버를 디버깅할 수 있습니다.

npx @modelcontextprotocol/inspector uvx mcp-server-playwright-fetch

표준 Fetch Server와의 차이점

이 구현은 다음과 같은 면에서 표준 MCP 서버와 다릅니다.

  1. 브라우저 자동화 : Playwright를 사용하여 JavaScript가 많이 사용되는 페이지를 렌더링합니다.
  2. 콘텐츠 추출 : 공통 페이지 구조에서 주요 콘텐츠를 추출하려고 시도합니다.
  3. 대기 옵션 : 구성 가능한 페이지 로딩 전략(로드 대기, DOM 콘텐츠, 네트워크 유휴)
  4. 표시되는 브라우저 옵션 : 디버깅을 위해 표시되는 브라우저로 실행할 수 있습니다.

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 라이선스 파일을 참조하세요.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Playwright 브라우저 자동화를 사용하여 웹 콘텐츠 가져오기 기능을 제공하므로 LLM이 웹 페이지에서 JavaScript로 렌더링된 콘텐츠를 검색하고 처리하고 HTML을 마크다운으로 변환하여 더 쉽게 사용할 수 있습니다.

  1. Author
    1. Key Features
      1. Available Tools
        1. Prompts
          1. Requirements
            1. Installation
              1. 1. Install with uv (recommended)
              2. 2. Using Docker
            2. Configuration
              1. Configure for Claude.app
              2. Configure for VS Code
            3. Command Line Options
              1. Example Usage
                1. Debugging
                  1. Differences from Standard Fetch Server
                    1. License

                      Related MCP Servers

                      • A
                        security
                        A
                        license
                        A
                        quality
                        This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.
                        Last updated -
                        1
                        43,046
                        JavaScript
                        MIT License
                        • Linux
                        • Apple
                      • A
                        security
                        A
                        license
                        A
                        quality
                        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.
                        Last updated -
                        13
                        9,719
                        3,179
                        TypeScript
                        MIT License
                        • Linux
                        • Apple
                      • A
                        security
                        F
                        license
                        A
                        quality
                        A server that enables browser automation using Playwright, allowing interaction with web pages, capturing screenshots, and executing JavaScript in a browser environment through LLMs.
                        Last updated -
                        12
                        9,719
                        1
                        TypeScript
                      • A
                        security
                        F
                        license
                        A
                        quality
                        Enables LLMs to perform browser automation through the Playwright framework with Chrome DevTools Protocol support, connecting to existing Chrome instances for advanced web interactions and JavaScript execution.
                        Last updated -
                        12
                        9
                        TypeScript

                      View all related MCP servers

                      ID: rzykt9yco6