Back to MCP directory
publicPublicdnsLocal runtime

browser-mcp

一个浏览器扩展与MCP服务器,支持与当前浏览器交互。

article

README

🚀 浏览器 MCP

浏览器 MCP 是一套包含浏览器扩展和 MCP 服务器的工具,它允许用户与当前使用的浏览器进行交互,为用户提供了便捷的浏览器操作体验。

mcp

jkXeswNy@2x

🚀 快速开始

配置示例

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

✨ 主要特性

工具列表

所有可用工具在 server/src/tools.ts 中列出,以下是部分工具介绍:

  • get_current_page_markdown:获取当前浏览器页面的Markdown内容。
    • 示例:
总结当前页面。
  • append_style:向当前浏览器页面追加CSS样式。
    • 示例:
将当前页面设置为暗黑模式。
  • history_search:搜索浏览器历史记录。
    • 示例:
在浏览历史中搜索“github”。

📦 安装指南

依赖安装

pnpm i

扩展构建

cd extension

# 对Chrome浏览器构建
npm run build

# 对Edge浏览器构建
npm run build:edge

# 对Firefox浏览器构建
npm run build:firefox

构建完成后,扩展文件位于 extension/.output 目录。

服务器端构建

cd server

# 开发模式启动
npm run dev

# 构建服务器
npm run build

server/dist/cli.js 是MCP服务器的入口文件。

📚 详细文档

未来规划

  • [ ] 将扩展发布到应用商店。
  • [ ] 编写文档。
  • [ ] 添加更多工具。

贡献指南

添加新工具

  1. 将工具模式添加到 tools.ts 文件中的 tools 数组。
  2. extension/calls.ts 中实现可扩展调用处理函数。
  3. server/src/tools.ts 中为工具添加处理器。使用 call 函数调用扩展端的处理程序。

📄 许可证

本项目采用 AGPL-3.0 或更高版本的授权协议。

READY-TO-PASTE CONFIG

MCP client config generator

Choose your client, fill the required environment variables, then copy a config generated from this server's published metadata

terminal
data_object

This entry does not contain a standard command or remote URL, so a safe client config cannot be generated automatically

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client