Token导航 LogoToken导航TokenDH.com
Chrome Extension MCP logo
浏览器工具stdio官方级别未说明来源级核验

Chrome Extension MCP

MCP Server

一个通过REST API控制Chrome浏览器进行自动化操作的解决方案,包括标签管理、内容提取和浏览器交互等功能,适用于网页自动化测试、数据抓取和AI集成场景。

工具数

15

提示词数

0

GitHub Stars

1

资源数

0
浏览器自动化隐私保护PythonClaudeAPI集成Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Cyber24BD

提供方

Cyber24BD

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

浏览器自动化REST API+MCP服务器

可用于生产的Chrome扩展、FastAPI服务器和MCP服务器,用于通过REST API实现浏览器自动化。控制Chrome选项卡,提取内容,并通过简单的HTTP请求自动进行浏览器交互。 无需更改默认浏览器即可与Chrome交互,无缓存干扰,对个人详细信息零跟踪。

🚀 特性

核心功能

  • 选项卡管理:创建、列出、导航、激活、重新加载和关闭选项卡
  • 高级内容提取:通过基于Python的转换提取HTML或Markdown格式的页面内容

- 多种转换方法(html2text、markdownify) - 自动HTML清理(删除广告、脚本、样式) - 丰富的元数据提取(标题、链接、图像计数)

  • 浏览器交互:单击元素、填写表单、获取文本、等待元素

- 支持所有CSS选择器(ID、类、属性、复杂) - 自动滚动元素进入视图 - 框架兼容(React、Vue、Angular)

  • WebSocket通信:与keep-alive进行实时双向通信
  • 生产就绪:全面的错误处理、日志记录和文档

人工智能集成(MCP服务器)

  • 模型上下文协议服务器:让像Claude Desktop这样的人工智能助手控制你的浏览器
  • 14浏览器工具:AI的全自动化功能
  • 模块化架构:易于扩展和维护
  • 零配置:与Claude Desktop一起开箱即用

隐私和安全

  • 无默认浏览器更改:在不影响主浏览器的情况下使用Chrome进行自动化
  • 无缓存干扰:单独的Chrome实例,不会影响您的浏览
  • 零跟踪:不收集或跟踪个人数据
  • 仅限本地:所有处理都在您的机器上进行
  • 开源:完全透明,自己审核代码

______________________________________________________________________

🌟 关键亮点

  • 🔒 隐私优先自动化:无需更改默认浏览器即可与Chrome交互,无缓存干扰,对个人详细信息零跟踪
  • 🚀 非侵入性操作:与现有的Chrome设置一起使用,无需修改浏览器设置或用户配置文件
  • 🛡️ 安全自动化:所有交互都是隔离的,不会影响您的浏览历史、Cookie或个人数据
  • ⚡ 实时控制:通过REST API实现即时浏览器自动化,同时保持完全的隐私和安全

______________________________________________________________________

⚡ 快速开始

# 1. Install dependencies
pip install -r requirements.txt

# 2. Load Chrome extension
# Go to chrome://extensions/ → Enable Developer Mode → Load Unpacked → Select 'extension' folder

# 3. Start server
python main.py

# 4. Test it
curl http://localhost:8000/health

# 5. (Optional) Setup MCP for Claude Desktop
cd mcp
pip install -r requirements.txt
# Add to Claude Desktop config (see MCP section below)

就是这样! 您的浏览器自动化API已准备就绪。访问http://localhost:8000/docs用于交互式API文档。

______________________________________________________________________

📁 项目结构

browser-automation-api/
├── app/                          # FastAPI application
│   ├── __init__.py
│   ├── api.py                    # Main API router
│   ├── config.py                 # Configuration settings
│   ├── models.py                 # Pydantic models
│   ├── routes/                   # API route modules
│   │   ├── __init__.py
│   │   ├── tabs.py               # Tab management endpoints
│   │   └── websocket.py          # WebSocket connection
│   └── services/                 # Business logic
│       ├── __init__.py
│       └── extension.py          # Extension communication service
│
├── extension/                    # Chrome extension
│   ├── manifest.json             # Extension configuration
│   ├── background.js             # Main extension script
│   └── modules/                  # Modular ES6 components
│       ├── connection.js         # WebSocket connection manager
│       ├── tabs.js               # Tab operations
│       ├── content.js            # Content extraction
│       ├── interactions.js       # Browser interactions
│       ├── commands.js           # Command dispatcher
│       └── keepalive.js          # Connection keep-alive
│
├── sample/                       # Example scripts
│   ├── README.md                 # Sample usage guide
│   ├── extract_youcom.py         # Content extraction example
│   ├── google_search.py          # Tab automation example
│   ├── test_markdown.py          # Markdown conversion test
│   ├── test_tabs.py              # Tab management test
│   ├── test_interactions.py      # Interaction testing
│   └── test_advanced_markdown.py # Advanced markdown test
│
├── scripts/                      # Utility scripts
│   ├── install.bat               # Windows installation script
│   ├── start.bat                 # Windows server start script
│   ├── test_tabs.bat             # Tab testing script
│   ├── test_markdown.bat         # Markdown testing script
│   ├── test_interactions.bat     # Interaction testing script
│   ├── test_advanced_markdown.bat# Advanced markdown test
│   └── extract_youcom.bat        # Content extraction script
│
├── mcp/                          # MCP Server for AI assistants
│   ├── server.py                 # MCP server entry point
│   ├── config.py                 # Configuration
│   ├── requirements.txt          # MCP dependencies
│   ├── README.md                 # MCP documentation
│   ├── ARCHITECTURE.md           # MCP architecture guide
│   ├── test_mcp.py               # MCP test script
│   ├── install.bat               # MCP installation
│   ├── claude_desktop_config.example.json
│   ├── utils/                    # Utility modules
│   │   └── api_client.py         # HTTP client
│   ├── tools/                    # Tool definitions (14 tools)
│   │   ├── tab_tools.py          # Tab management tools
│   │   ├── content_tools.py      # Content extraction tools
│   │   └── interaction_tools.py  # Browser interaction tools
│   └── handlers/                 # Tool execution handlers
│       ├── tab_handlers.py       # Tab operations
│       ├── content_handlers.py   # Content extraction
│       └── interaction_handlers.py # Browser interactions
│
├── docs/                         # Documentation
│   ├── README.md                 # Documentation index
│   ├── API.md                    # API reference
│   ├── ARCHITECTURE.md           # System architecture
│   ├── TAB_MANAGEMENT.md         # Tab operations guide
│   ├── CONTENT_EXTRACTION.md     # Content extraction guide
│   ├── FEATURES.md               # Feature overview
│   └── TROUBLESHOOTING.md        # Common issues & solutions
│
├── main.py                       # FastAPI server entry point
├── requirements.txt              # Python dependencies
├── .env.example                  # Environment variables template
└── .gitignore                    # Git ignore rules

______________________________________________________________________

🛠️ 安装和设置

先决条件

  • Python 3.8+
  • 谷歌Chrome浏览器
  • pip(Python包管理器)

推荐

``bash # Create virtual environment ( Recomemned ) python -m venv browser-automation-env # Activate virtual environment # Windows: browser-automation-env\Scripts\activate # macOS/Linux: source browser-automation-env/bin/activate ``

步骤1:安装Python依赖项

# Windows
scripts\install.bat

# Or manually
pip install -r requirements.txt

步骤2:加载Chrome扩展程序

  1. 打开Chrome浏览器并导航到 chrome://extensions/
  2. 启用“开发人员模式”(在右上角切换)
  3. 点击“加载解包”
  4. 选择 extension 此项目中的文件夹
  5. 注意扩展ID(您将在扩展名下看到它)

步骤3:启动服务器

# Windows
scripts\start.bat

# Or manually
python main.py

服务器将在以下时间启动 http://localhost:8000

步骤4:验证连接

  1. 检查服务器日志中是否有“扩展已连接”消息
  2. 访问 http://localhost:8000/health -应该回来 {"status": "ok"}
  3. 访问 http://localhost:8000/docs 用于交互式API文档

______________________________________________________________________

📡 API终点

健康检查

GET /health

检查服务器是否正在运行。

答复:

{
  "status": "ok"
}

______________________________________________________________________

选项卡管理

POST /tabs/create

使用URL创建新选项卡。

请求正文:

{
  "url": "https://example.com",
  "active": true
}

参数:

  • url (字符串,必填):要打开的URL
  • active (布尔值,可选):是否激活选项卡(默认值:true)

答复:

{
  "success": true,
  "tabId": 123456789,
  "url": "https://example.com"
}

______________________________________________________________________

GET /tabs/list

获取所有打开的选项卡的详细列表。

答复:

{
  "success": true,
  "tabs": [
    {
      "id": 123456789,
      "url": "https://example.com",
      "title": "Example Domain",
      "active": true,
      "windowId": 987654321,
      "index": 0,
      "pinned": false,
      "status": "complete"
    }
  ],
  "count": 1
}

______________________________________________________________________

POST /tabs/navigate

将选项卡导航到新URL。

请求正文:

{
  "tabId": 123456789,
  "url": "https://google.com"
}

参数:

  • tabId (整数,必填):要导航的选项卡的ID
  • url (字符串,必填):要导航到的URL

答复:

{
  "success": true,
  "tabId": 123456789,
  "url": "https://google.com"
}

______________________________________________________________________

POST /tabs/activate

激活(聚焦)特定选项卡。

请求正文:

{
  "tabId": 123456789
}

参数:

  • tabId (整数,必填):要激活的选项卡的ID

答复:

{
  "success": true,
  "tabId": 123456789
}

______________________________________________________________________

POST /tabs/reload

重新加载选项卡的内容。

请求正文:

{
  "tabId": 123456789,
  "bypassCache": false
}

参数:

  • tabId (整数,必填):要重新加载的选项卡的ID
  • bypassCache (布尔值,可选):是否绕过缓存(默认值:false)

答复:

{
  "success": true,
  "tabId": 123456789
}

______________________________________________________________________

POST /tabs/close

关闭特定选项卡。

请求正文:

{
  "tabId": 123456789
}

参数:

  • tabId (整数,必填):要关闭的选项卡的ID

答复:

{
  "success": true,
  "tabId": 123456789
}

______________________________________________________________________

内容提取

GET /tab/{tab_id}/content

使用以下命令从HTML或Markdown格式的选项卡中提取内容 基于Python的高级转换.

查询参数:

  • format (字符串,可选):输出格式-“html”或“markdown”(默认:“html”)
  • method (字符串,可选):Markdown转换方法-“html2text”、“markdownify”或“auto”(默认值:“html2text”)
  • clean (布尔值,可选):转换前清理HTML-删除脚本、样式、广告(默认值:true)

Markdown转换方法:

  1. html2text (默认)-具有出色格式的高级转换

- 完美保留表、代码块和列表 - 可配置的换行和链接样式 - 最适合复杂内容(维基百科、文档、文章)

  1. 标记化 -简单、干净的转换

- 重量轻,速度快 - 适合基本内容 - 最小但准确的格式

  1. 自动 -自动回退

- 先尝试html2text - 如果需要,可以回退到markdownify

HTML响应:

{
  "success": true,
  "content": {
    "format": "html",
    "html": "...",
    "bodyHtml": "
...
",
    "text": "Plain text content",
    "url": "https://example.com",
    "title": "Example Domain",
    "timestamp": "2025-11-15T10:30:00.000Z"
  }
}

Markdown响应:

{
  "success": true,
  "content": {
    "format": "markdown",
    "markdown": "# Example Domain\n\nThis domain is for use...",
    "url": "https://example.com",
    "title": "Example Domain",
    "timestamp": "2025-11-15T10:30:00.000Z",
    "conversion": {
      "method": "html2text",
      "length": 1234,
      "lines": 45,
      "metadata": {
        "headings": 5,
        "paragraphs": 12,
        "links": 8,
        "images": 3,
        "tables": 1,
        "lists": 4
      }
    }
  }
}

特征:

  • ✓ 自动HTML清理(删除脚本、样式、广告、弹出窗口)
  • ✓ 保留表、代码块和格式
  • ✓ 提取元数据(标题、链接、图像计数)
  • ✓ 后处理以获得干净、可读的输出
  • ✓ 针对不同用例的多种转换方法

______________________________________________________________________

浏览器交互

POST /tab/{tab_id}/interact

与页面上的元素交互(单击、输入、选择等)。

请求正文:

{
  "action": "click",
  "selector": "#submit-button"
}

参数:

  • tab_id (整数,必填):选项卡的ID(在URL路径中)
  • action (字符串,必填):交互类型
  • selector (string,必填):元素的CSS选择器
  • value (字符串,可选):输入/选择操作的值
  • timeout (整数,可选):超时时间(毫秒)(默认值:5000)

支持的操作:

  1. 点击 -单击元素
   {
     "action": "click",
     "selector": "#button-id"
   }
  1. 输入 -在输入框中键入文本
   {
     "action": "input",
     "selector": "input[name='search']",
     "value": "search query"
   }
  1. 选择 -从下拉列表中选择一个选项
   {
     "action": "select",
     "selector": "#country-select",
     "value": "USA"
   }
  1. getText -获取元素的文本内容
   {
     "action": "getText",
     "selector": "h1"
   }
  1. 获取属性 -获取属性值
   {
     "action": "getAttribute",
     "selector": "a.link",
     "value": "href"
   }
  1. waitForElement -等待元素出现
   {
     "action": "waitForElement",
     "selector": ".loading-complete",
     "timeout": 10000
   }
  1. findElement -查找并获取元素详细信息
   {
     "action": "findElement",
     "selector": "#my-element"
   }

CSS选择器示例:

  • 按ID: #button-idbutton#submit
  • 按类别: .btn-primarybutton.submit-btn
  • 按属性: [data-action="submit"]input[type="text"]
  • 按姓名: input[name="username"]
  • 复杂: div.container > button.submit:first-child

答复:

{
  "success": true,
  "result": {
    "action": "click",
    "selector": "#submit-button",
    "elementTag": "BUTTON",
    "elementText": "Submit"
  }
}

______________________________________________________________________

双向通信

WS /ws

WebSocket端点,用于服务器和扩展之间的实时双向通信。

连接URL: ws://localhost:8000/ws

消息格式:

{
  "command": "ping",
  "data": {}
}

______________________________________________________________________

💡 用法示例

Python示例

创建和导航选项卡

import requests

BASE_URL = "http://localhost:8000"

# Create a new tab
response = requests.post(f"{BASE_URL}/tabs/create", json={
    "url": "https://google.com",
    "active": True
})
tab_id = response.json()["tabId"]

# Navigate to a different URL
requests.post(f"{BASE_URL}/tabs/navigate", json={
    "tabId": tab_id,
    "url": "https://github.com"
})

# Close the tab
requests.post(f"{BASE_URL}/tabs/close", json={
    "tabId": tab_id
})

将内容提取为Markdown

import requests
import time

BASE_URL = "http://localhost:8000"

# Create tab
response = requests.post(f"{BASE_URL}/tab/new", json={
    "url": "https://en.wikipedia.org/wiki/Python_(programming_language)",
    "active": True
})
tab_id = response.json()["tab"]["id"]

# Wait for page to load
time.sleep(3)

# Extract as Markdown using html2text (best quality)
response = requests.get(
    f"{BASE_URL}/tab/{tab_id}/content",
    params={
        "format": "markdown",
        "method": "html2text",
        "clean": True
    }
)

result = response.json()
markdown = result["content"]["markdown"]
metadata = result["content"]["conversion"]["metadata"]

print(f"Extracted {len(markdown)} characters")
print(f"Found: {metadata['headings']} headings, {metadata['links']} links")
print(markdown[:500])  # First 500 characters

# Save to file
with open("output.md", "w", encoding="utf-8") as f:
    f.write(markdown)

比较Markdown转换方法

import requests

BASE_URL = "http://localhost:8000"
tab_id = 123456789

# Method 1: html2text (best for complex content)
response = requests.get(
    f"{BASE_URL}/tab/{tab_id}/content",
    params={"format": "markdown", "method": "html2text"}
)
html2text_result = response.json()["content"]["markdown"]

# Method 2: markdownify (simple and clean)
response = requests.get(
    f"{BASE_URL}/tab/{tab_id}/content",
    params={"format": "markdown", "method": "markdownify"}
)
markdownify_result = response.json()["content"]["markdown"]

print(f"html2text: {len(html2text_result)} chars")
print(f"markdownify: {len(markdownify_result)} chars")

浏览器自动化-点击和输入

import requests
import time

BASE_URL = "http://localhost:8000"

# Open Google
response = requests.post(f"{BASE_URL}/tab/new", json={
    "url": "https://google.com",
    "active": True
})
tab_id = response.json()["tab"]["id"]
time.sleep(2)

# Fill search box using input action
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "input",
    "selector": "textarea[name='q']",
    "value": "Python programming"
})

# Click search button by ID or selector
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "click",
    "selector": "input[name='btnK']"
})

# Wait for results to load
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "waitForElement",
    "selector": "#search",
    "timeout": 5000
})

# Get text from first result
response = requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "getText",
    "selector": "h3"
})
print(response.json()["result"]["text"])

按ID点击按钮

import requests

BASE_URL = "http://localhost:8000"
tab_id = 123456789  # Your tab ID

# Click button by ID
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "click",
    "selector": "#submit-button"  # Using ID selector
})

# Click button by class
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "click",
    "selector": ".btn-primary"  # Using class selector
})

# Click button by data attribute
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "click",
    "selector": "[data-action='submit']"  # Using attribute selector
})

使用多个输入填写表单

import requests

BASE_URL = "http://localhost:8000"
tab_id = 123456789

# Fill username
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "input",
    "selector": "#username",
    "value": "john_doe"
})

# Fill password
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "input",
    "selector": "input[type='password']",
    "value": "secure_password"
})

# Select country from dropdown
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "select",
    "selector": "#country",
    "value": "USA"
})

# Click submit button
requests.post(f"{BASE_URL}/tab/{tab_id}/interact", json={
    "action": "click",
    "selector": "button[type='submit']"
})

cURL示例

创建选项卡

curl -X POST http://localhost:8000/tabs/create \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "active": true}'

列表选项卡

curl http://localhost:8000/tabs/list

提取物含量

curl -X POST http://localhost:8000/tabs/extract \
  -H "Content-Type: application/json" \
  -d '{"tabId": 123456789, "format": "markdown"}'

______________________________________________________________________

� TMCP服务器(AI集成)

什么是MCP?

模型上下文协议(MCP) 允许像Claude Desktop这样的人工智能助手使用工具并与外部系统交互。我们的MCP服务器将所有浏览器自动化功能暴露给AI助手。

特性

  • 14浏览器工具:AI的完全浏览器自动化
  • 模块化架构:分离的工具、处理程序和实用程序
  • 易于扩展:在不接触核心代码的情况下添加新工具
  • 生产就绪:全面的错误处理和记录

可用工具

选项卡管理(6个工具):

  • browser_create_tab -创建新选项卡
  • browser_list_tabs -列出所有打开的选项卡
  • browser_close_tab -关闭特定选项卡
  • browser_navigate -导航到URL
  • browser_activate_tab -焦点选项卡
  • browser_reload_tab -重新加载选项卡

内容提取(2个工具):

  • browser_get_content -提取为HTML/Markdown
  • browser_get_metadata -获取页面元数据

浏览器交互(7个工具):

  • browser_click -点击元素
  • browser_input -填写表格
  • browser_get_text -提取文本
  • browser_wait_for_element -等待元素
  • browser_find_element -查找并验证元素
  • browser_select_option -选择下拉菜单
  • browser_get_attribute -获取属性

快速设置

  1. 安装MCP依赖项:
   cd mcp
   pip install -r requirements.txt
  1. 配置Claude桌面:

添加到您的配置文件中:

- 视窗: %APPDATA%\Claude\claude_desktop_config.json - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Linux: ~/.config/Claude/claude_desktop_config.json

   {
     "mcpServers": {
       "browser-automation": {
         "command": "python",
         "args": [
           "C:/path/to/your/project/mcp/server.py"
         ],
         "env": {}
       }
     }
   }
  1. 重新启动克劳德桌面
  1. 测试一下:
   You: "List all open browser tabs"
   Claude: [Uses browser_list_tabs tool and shows results]

Claude使用示例

研究与总结:

You: "Go to Wikipedia, search for Python programming, and summarize the article"
Claude: [Creates tab, navigates, extracts content, summarizes]

填写表格:

You: "Go to example.com and fill out the contact form with my details"
Claude: [Opens page, fills form fields, submits]

比较价格:

You: "Compare laptop prices on Amazon and eBay"
Claude: [Opens both sites, searches, extracts prices, compares]

提取数据:

You: "Get all article titles from the homepage"
Claude: [Extracts content, parses, lists titles]

MCP架构

Claude Desktop
      ↓
  MCP Protocol
      ↓
  MCP Server (Modular)
  ├── Tools (Definitions)
  ├── Handlers (Logic)
  └── Utils (API Client)
      ↓
  Browser Automation API
      ↓
  Chrome Extension
      ↓
  Browser

文档

______________________________________________________________________

🧪 测试

运行提供的测试脚本以验证功能:

# Test tab management
scripts\test_tabs.bat

# Test markdown extraction
scripts\test_markdown.bat

# Test content extraction
scripts\extract_youcom.bat

或者运行单独的Python测试脚本:

python sample/test_tabs.py
python sample/test_markdown.py
python sample/extract_youcom.py
python sample/google_search.py

______________________________________________________________________

🔧 配置

环境变量

创建一个 .env 文件基于 .env.example:

# Server Configuration
HOST=0.0.0.0
PORT=8000
DEBUG=True

# CORS Settings
CORS_ORIGINS=["http://localhost:3000"]

# Logging
LOG_LEVEL=INFO

扩展配置

该扩展自动连接到 ws://localhost:8000/ws。要更改服务器URL,请编辑 extension/modules/connection.js:

const WS_URL = 'ws://localhost:8000/ws';

______________________________________________________________________

📚 文档

详细文档可在 docs/ 文件夹:

MCP服务器文档

______________________________________________________________________

🆚 为什么是这个项目?

vs其他浏览器自动化工具

专题本项目木偶师剧作家
REST API✅ 是❌ 否❌ 否❌ 没有
MCP服务器(AI)✅ 是❌ 否❌ 否❌ 没有
无浏览器更改✅ 是⚠️ 分开⚠️ 分开⚠️ 分开
实时WebSocket✅ 是❌ 否❌ 否❌ 没有
高级Markdown✅ 是❌ 否❌ 否❌ 没有
零跟踪✅ 是✅ 是✅ 是✅ 是的
轻松设置✅ 简单⚠️ 复杂⚠️ 复杂⚠️ 综合体
AI集成✅ 内置❌ 否❌ 否❌ 没有

关键优势

  1. REST API优先:简单的HTTP请求,没有复杂的驱动程序
  2. AI就绪:用于Claude Desktop的内置MCP服务器
  3. 注重隐私:无跟踪,仅本地处理
  4. 生产就绪:错误处理、日志记录、文档
  5. 模块化设计:易于扩展和维护
  6. 高级功能:Markdown转换、元数据提取
  7. 真正的Chrome:使用实际的Chrome,而不是无头

______________________________________________________________________

🐛 故障排除

扩展未连接

  1. 检查服务器是否正在运行: http://localhost:8000/health
  2. 在中重新加载扩展 chrome://extensions/
  3. 检查浏览器控制台是否有错误(F12→ 控制台)
  4. 验证服务器日志中的WebSocket连接

命令不起作用

  1. 确保扩展已连接(检查服务器日志)
  2. 使用验证选项卡ID是否有效 /tabs/list
  3. 检查浏览器控制台中的JavaScript错误
  4. 尝试重新加载目标选项卡

内容提取返回空

  1. 在提取之前等待页面完全加载
  2. 验证CSS选择器是否与页面上的元素匹配
  3. 检查页面是否使用动态内容加载
  4. 尝试使用默认选择器(body)进行提取

有关更多故障排除提示,请参阅 故障排除.md

______________________________________________________________________

🏗️ 建筑

通信流

HTTP Client → FastAPI Server → WebSocket → Chrome Extension → Browser
     ↓              ↓              ↓              ↓              ↓
  Request      Route Handler   Message      Command        Action
                                Queue      Dispatcher

关键组件

  1. FastAPI服务器:处理HTTP请求和WebSocket连接
  2. Chrome 扩展:通过Chrome API执行浏览器命令
  3. 双向通信:实时双向通信通道
  4. 命令队列:管理请求/响应匹配
  5. 长连接:保持持久连接

有关详细的体系结构信息,请参见 建筑.md

______________________________________________________________________

🤝 贡献

欢迎投稿!请遵循以下指南:

  1. 分叉存储库
  2. 创建要素分支
  3. 进行更改
  4. 彻底测试
  5. 提交拉取请求

______________________________________________________________________

📄 许可证

本项目按原样提供,用于教育和发展目的。

______________________________________________________________________

🔗 快速链接

  • 交互式API文档: http://localhost:8000/docs
  • API备选文件: http://localhost:8000/redoc
  • 健康检查: http://localhost:8000/health
  • 谷歌浏览器扩展: chrome://extensions/

______________________________________________________________________

📞 支持与社区

获取帮助

  1. 文档:检查 docs/ 详细指南文件夹
  2. 故障排除:参见 故障排除.md
  3. 问题:
  4. 讨论:

报告问题

在报告问题时,请包括:

  • 服务器日志
  • 浏览器控制台错误
  • 重现步骤
  • 预期行为与实际行为

功能请求

我们欢迎功能请求!拜托:

  1. 先检查现有问题
  2. 描述用例
  3. 解释为什么它有用
  4. 如果可能,请提供示例

______________________________________________________________________

🤝 贡献

我们欢迎捐款!方法如下:

贡献方式

  1. 代码:修复错误,添加功能,提高性能
  2. 文档:改进文档,添加示例,修复拼写错误
  3. 测试:报告错误,测试新功能
  4. 想法:建议改进、新功能

开发设置

# Clone repository
git clone https://github.com/Cyber24BD/chrome-extension-mcp-.git
cd chrome-extension-mcp-

# Install dependencies
pip install -r requirements.txt
cd mcp && pip install -r requirements.txt

# Run tests
python sample/test_tabs.py
python mcp/test_mcp.py

拉取请求流程

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 进行更改
  4. 彻底测试
  5. 承诺(git commit -m 'Add amazing feature')
  6. 推(git push origin feature/amazing-feature)
  7. 打开拉取请求

代码的风格

  • 遵循现有的代码模式
  • 为复杂逻辑添加注释
  • 更新文档
  • 为新功能添加测试

______________________________________________________________________

📜 许可证

该项目是开源的,可在 MIT许可证.

______________________________________________________________________

🌟 明星历史

如果你觉得这个项目有用,请考虑给它一颗星! ⭐

![Star History Chart](https://star-history.com/#Cyber24BD/chrome-extension-mcp-&Date)

______________________________________________________________________

🙏 致谢

  • 快速API:现代web框架
  • Chrome扩展API:浏览器自动化功能
  • 模型上下文协议:AI集成标准
  • html2text&标记:Markdown转换库
  • 社区:所有贡献者和用户

______________________________________________________________________

📊 项目统计

License

______________________________________________________________________

自动化快乐! 🚀

由以下材料制成❤️ 通过 Cyber24BD

目录标签

目录标签

浏览器自动化隐私保护PythonClaudeAPI集成本地部署RESTAPI网页抓取AI集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

15

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP