TF

tontoko/fast-playwright-mcp

Browser automation

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

40 stars 9 forks Качество 78 Тренд 4Apache-2.0

tontoko/fast-playwright-mcp - кандидат на сервер MCP, импортированный из https://github.com/tontoko/fast-playwright-mcp.

Обзор

tontoko/fast-playwright-mcp - кандидат на сервер MCP, импортированный из https://github.com/tontoko/fast-playwright-mcp.

Обзор (машинный перевод)

Быстрый* драматург MCP

Этот MCP-сервер является форком Microsoft.

Сервер Model Context Protocol (MCP), который предоставляет возможности автоматизации браузера с помощью Playwright. Этот сервер позволяет LLM взаимодействовать с веб-страницами через структурированные снимки доступности, минуя необходимость в скриншотах или визуально настроенных моделях.

Ключевые особенности

  • Быстрый и легкий. Использует дерево доступности Playwright, а не вход на основе пикселей.
  • ** LLM-дружественный** Модели видения не нужны, работают исключительно на структурированных данных. ** Детерминированное применение инструмента**. Избегает двусмысленности, общей с подходами, основанными на скриншотах.

Функции быстрого сервера (This Fork)

** Оптимизация токенов**. Все инструменты поддерживают параметр expectation для управления контентом ответа: includeCode: false - Подавить генерацию кода Playwright для уменьшения токенов

  • includeSnapshot: false - Снимок страницы для минимальных ответов (70-80% снижение токена)
  • includeConsole: false - Исключить консольные сообщения
  • includeTabs: false - Скрыть информацию вкладки
  • Сжатие изображения Инструмент для скриншотов поддерживает imageOptions: format: 'jpeg' - Используйте JPEG вместо PNG
  • quality: 1-100 - Сжатие изображений (например.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Fast Playwright MCP

This MCP server is a fork of the Microsoft one.

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.

Key Features

  • Fast and lightweight. Uses Playwright’s accessibility tree, not pixel-based input.
  • LLM-friendly. No vision models needed, operates purely on structured data.
  • Deterministic tool application. Avoids ambiguity common with screenshot-based approaches.

Fast Server Features (This Fork)

  • Token Optimization. All tools support an expectation parameter to control response content:
    • includeCode: false - Suppress Playwright code generation to reduce tokens
    • includeSnapshot: false - Skip page snapshot for minimal responses (70-80% token reduction)
    • includeConsole: false - Exclude console messages
    • includeTabs: false - Hide tab information
  • Image Compression. Screenshot tool supports imageOptions:
    • format: 'jpeg' - Use JPEG instead of PNG
    • quality: 1-100 - Compress images (e.g., 50 for 50% quality)
    • maxWidth: number - Resize images to max width
  • Batch Execution. Use browser_batch_execute for multiple operations:
    • Significant token reduction by eliminating redundant responses
    • Per-step and global expectation configuration
    • Error handling with continueOnError and stopOnFirstError options
  • Snapshot Control. Limit snapshot size with snapshotOptions:
    • selector: string - Capture only specific page sections (recommended over maxLength)
    • format: "aria" - Accessibility tree format for LLM processing
  • Diff Detection. Track only changes with diffOptions:
    • enabled: true - Show only what changed from previous state (massive token saver)
    • format: "minimal" - Ultra-compact diff output
    • Perfect for monitoring state changes during navigation or interactions
  • Diagnostic System. Advanced debugging and element discovery tools:
    • browser_find_elements - Find elements using multiple search criteria (text, role, attributes)
    • browser_diagnose - Comprehensive page analysis with performance metrics and troubleshooting
    • Enhanced error handling with alternative element suggestions
    • Page structure analysis (iframes, modals, accessibility metrics)
    • Performance monitoring with execution time under 300ms
  • Enhanced Selector System. Unified element selection with multiple strategies:
    • Selector Arrays: All element-based tools now support multiple selectors with automatic fallback
    • 4 Selector Types:
      • ref: System-generated element IDs from previous tool results (highest priority)
      • role: ARIA roles with optional text matching (e.g., {role: "button", text: "Submit"})
Открыть полный README на GitHub

Установка

npx @tontoko/fast-playwright-mcp@latest
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "playwright": { "command": "npx", "args": [ "@tontoko/fast-playwright-mcp@latest" ] } } }