npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@grantany/mcp-browser

v1.0.4

Published

浏览器自动化 MCP 工具

Readme

浏览器自动化 MCP 工具

这是一个基于 Go 的浏览器自动化 MCP 工具,用于控制 Chrome 浏览器执行自动化操作。该工具使用标准输入输出(stdio)通信,便于与其他工具集成。

功能特性

  • 浏览器控制:支持导航、截图、DOM 查询等操作
  • 登录管理:提供登录状态检查
  • JavaScript 执行:支持在页面上下文中执行 JavaScript
  • 截图功能:生成页面截图
  • 可扩展性:可通过添加新工具扩展功能
  • 标准 IO 通信:使用标准输入输出进行通信,易于集成
  • 自定义管道:支持使用命名管道进行通信,便于测试和集成

安装和使用

直接运行

  1. 确保安装了 Go 1.23 及以上版本
  2. 克隆代码仓库
  3. 运行服务
git clone <仓库地址>
cd browser
go run main.go

使用 NPX 启动

我们提供了 NPX 脚本以便快速启动该工具:

npx @grantany/mcp-browser

或者指定配置文件:

npx @grantany/mcp-browser --config=/path/to/config.yaml

使用 Docker 启动

我们提供了 Docker 镜像支持:

docker run -i qimao/mcp-browser

配置说明

支持通过 config.yaml 文件配置:

# Chrome 浏览器配置
chrome:
  # 最大实例数
  maxInstances: 5
  # 实例超时时间(分钟)
  timeout: 30
  # Chrome 启动参数
  args:
    - "--no-sandbox"
    - "--disable-setuid-sandbox"
    - "--disable-dev-shm-usage"
    - "--disable-gpu"
    - "--headless"

# 登录检查配置
login:
  # 登录页面 URL 特征
  urlPattern: "login"
  # 是否跳过登录检查
  skipCheck: false

# 日志配置
log:
  # 日志级别: debug, info, warn, error
  level: "info"
  # 日志文件路径 (留空使用标准输出)
  filePath: ""

命令行参数

工具支持以下命令行参数:

  • --config: 配置文件路径(可选)
  • --stdin: 输入管道路径(可选,用于自定义stdio模式)
  • --stdout: 输出管道路径(可选,用于自定义stdio模式)

与其他工具集成

由于使用标准输入输出通信,该工具可以轻松集成到其他应用中:

# 通过管道传递输入输出
echo '{"action": "navigate", "url": "https://example.com"}' | npx @grantany/mcp-browser

# 或者在应用中作为子进程启动
# 示例代码 (Node.js):
const { spawn } = require('child_process');
const browser = spawn('npx', ['@grantany/mcp-browser']);

browser.stdin.write(JSON.stringify({
  action: 'navigate',
  url: 'https://example.com'
}));

browser.stdout.on('data', (data) => {
  console.log(data.toString());
});

详细文档

有关部署和配置的详细信息,请参阅 部署指南