
random-robbie/mcp-web-browser
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Playwrightが機能するモデルコンテキストプロトコル(MCP)用の高度なWebブラウジングサーバーで、ヘッドレスブラウザのインタラクションを柔軟でセキュアなAPIで実現できます.
概要
Playwrightが機能するモデルコンテキストプロトコル(MCP)用の高度なWebブラウジングサーバーで、ヘッドレスブラウザのインタラクションを柔軟でセキュアなAPIで実現できます。 - : SSL証明書検証バイパスを使用して任意のウェブサイトに移動 - : 動的にロードされたJavaScriptを含む完全なHTMLコンテンツを取得する - : 複数のブラウザタブ間で作成、管理、およびスイッチ - : - テキストコンテンツの抽出 - ページ要素のクリック - フォームフィールドにテキストを入力する - スクリーンショット - キャプチャ - フィルタリング機能付きのページリンクを抽出 - 任意の方向のスクロールページ - ページ上のJavaScriptを実行 - ページをリフレッシュ - 完了するナビゲーションを待つ - : ナビゲーションが停止した後の未使用リソースの自動クリーンアップ - : 現在のページに関する詳細なメタデータを取得する - SSL証明書検証バイパス - 安全なブラウザのコンテキスト管理 - カスタムユーザーエージェントの設定 - エラー処理と包括的なロギング - 設定可能なタイムアウト設定 - CSPバイパス制御 - クッキーのステルスに対する保護 - : 自動的に...
概要(AI 翻訳)
Playwrightが機能するモデルコンテキストプロトコル(MCP)用の高度なWebブラウジングサーバーで、ヘッドレスブラウザのインタラクションを柔軟でセキュアなAPIで実現できます。
インポート機能
-Headless Web Browsing: SSL証明書検証バイパスで任意のウェブサイトに移動
- フルページコンテンツ抽出:動的に読み込まれたJavaScriptを含む完全なHTMLコンテンツを取得する -マルチタブサポート:複数のブラウザタブ間で作成、管理、および切り替え
- 高度なWebインタラクションツール:
- テキストコンテンツの抽出
- ページ要素をクリック
- フォームフィールドにテキストを入力する
- スクリーンショットのキャプチャ
- フィルタリング機能によるページリンクの抽出
- 任意の方向にページをスクロール
- ページの JavaScript を実行する
- ページをリフレッシュ
- ナビゲーションが完了するまで待ちます
- リソース管理: 不活性後の未使用資源の自動クリーンアップ
- ページ情報の強化: 現在のページに関する詳細なメタデータの取得
すぐにスタート
前提条件
- Python 3.10 +
- MCP SDK の
- プレイライト
インストール
##Claudeデスクトップの設定
[claude_desktop_config.json]に追加します。
✔ 使用例
###基本Webナビゲーション
##Webインタラクション
###スクリーンショットキャプチャ
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
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")
Link Extraction
# 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
インストール
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"
]
}
}
}