Skip to main content
Glama
pansin

Browser MCP Server

by pansin

Browser MCP Server

一个基于Model Context Protocol (MCP)的浏览器自动化服务器,使用Puppeteer提供强大的网页浏览、内容提取和交互功能。

功能特点

  • 页面导航:导航到URL、刷新、前进/后退

  • 内容提取:获取页面源代码、元数据、截图和文本

  • 格式化内容:将网页内容转换为结构化的Markdown格式

  • 元素交互:点击、输入、选择和等待元素

  • 测试工具:检查元素存在、验证内容、执行脚本

  • 搜索功能:通过百度搜索获取最新文章和信息

  • 安全保障:沙箱浏览器执行与域名限制

  • 配置灵活:支持自定义配置管理

Related MCP server: Steel Puppeteer

安装

# 克隆仓库
git clone https://github.com/yourusername/browser-mcp-server.git
cd browser-mcp-server

# 安装依赖
npm install

# 构建项目
npm run build

开发

# 启动开发模式
npm run dev

测试

# 运行测试
npm test

# 运行特定测试
npx tsx src/tests/simple-test.ts
npx tsx src/tests/search-test.ts
npx tsx src/tests/visit-website-test.ts
npx tsx src/tests/formatted-content-test.ts

配置

服务器使用配置文件管理浏览器设置、安全选项和默认行为。查看src/config/default.ts了解默认配置。

使用方法

Browser MCP Server设计为与Kiro IDE一起使用。将其添加到您的MCP配置中:

{
  "mcpServers": {
    "browser": {
      "command": "node",
      "args": ["path/to/browser-mcp-server/dist/index.js"]
    }
  }
}

详细使用说明请参考用户指南

项目结构

browser-mcp-server/
├── src/
│   ├── config/         # 配置文件
│   ├── errors/         # 错误处理类
│   ├── interfaces/     # 接口定义
│   ├── managers/       # 管理器实现
│   ├── tools/          # 工具实现
│   ├── types/          # 类型定义
│   ├── utils/          # 工具函数
│   ├── tests/          # 测试文件
│   └── index.ts        # 入口文件
├── dist/               # 编译后的文件
├── package.json        # 项目配置
└── README.md           # 项目说明

许可证

本项目采用 Apache License 2.0 许可证。

Copyright 2025 Browser MCP Server Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Available Tools

2 tools
browser-consoleB

Navigate to a URL and capture console output from the browser with streaming support

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to navigate to
timeoutNoTimeout in milliseconds (default: 30000)
waitForNoCSS selector or text to wait for before capturing console (optional)
commandsNoBrowser commands to execute (e.g., "click .button wait 2s") (optional)
streamNoWhether to stream console output in real-time (default: true)

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only mentions 'streaming support', which is a useful detail, but it omits any side effects (e.g., opening a browser, executing scripts, potential resource usage), prerequisites, or what happens to the browser session. It also does not describe the return format or how streaming terminates.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that states the core action and a key feature. It contains no filler or redundant information, making it appropriately concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, no output schema, no annotations), the description is too minimal. It does not explain the waitFor or commands parameters, which represent significant behaviors, nor does it clarify what the captured console output looks like. The schema covers parameters but the description fails to provide a complete mental model of the tool's capabilities.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters (url, stream, timeout, waitFor, commands) have descriptive schema definitions. The tool description adds nothing beyond the schema—'streaming support' repeats the stream parameter's purpose. Therefore, baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool navigates to a URL and captures console output from the browser, with streaming support. This specific verb+resource combination ('navigate' + 'capture console output') and the qualifier 'from the browser' distinguishes it from the sibling tool 'browser-server-console', which likely targets a server-side console.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for capturing browser console output after navigation, but it does not explicitly state when to use this tool versus alternatives, mention exclusions, or provide use-case context (e.g., debugging front-end errors). The presence of a sibling tool suggests a potential distinction but it is not articulated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

browser-server-consoleB

Spawn an Express static server for a directory and capture console output from the served content

ParametersJSON Schema
NameRequiredDescriptionDefault
directoryYesThe directory to serve statically
portNoPreferred port to run the server on (will find next available if busy, default: 3000)
pathNoPath to navigate to after starting server (default: "/")/
timeoutNoTimeout in milliseconds (default: 30000)
waitForNoCSS selector or text to wait for before capturing console (optional)
commandsNoBrowser commands to execute (e.g., "click .button wait 2s") (optional)
streamNoWhether to stream console output in real-time (default: true)

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of disclosing behavioral traits. It states what the tool does (spawns a server, captures console) but does not disclose side effects such as server lifecycle/cleanup, blocking behavior, rate limits, or what happens to existing servers. This is a significant gap for a tool that starts a server.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that immediately conveys the core purpose and actions. It contains no fluff or redundant phrasing, and every word contributes meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given seven parameters and the absence of annotations and an output schema, the description is relatively minimal. It does not explain what the tool returns, how console output is delivered, or whether the server is automatically stopped. The parameter schema covers the 'how' but the overall usage context remains incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all seven parameters including defaults and semantics. The description adds no additional meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Spawn') and resource ('Express static server') and clearly states the second function ('capture console output'). This distinguishes it from the sibling tool 'browser-console', which likely focuses only on console capture without serving a directory.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus the sibling tool 'browser-console'. It implies usage for serving static content and capturing console output, but there are no exclusions or alternative recommendations, leaving the agent to infer the appropriate context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updates
    • First observedbrowser-console
    • First observedbrowser-server-console

TDQS

C2.9/5.0

Scored across 2 tools

Disambiguation3/5

The two tools have overlapping purposes—both capture console output from a browser—but their descriptions clarify distinct contexts: one navigates to a URL, while the other serves local content. Some ambiguity remains as both involve browser console operations, but the descriptions help differentiate them.

Naming Consistency5/5

Both tool names follow a consistent 'browser-[context]-console' pattern, using hyphens to separate words. This predictable naming scheme makes it easy to understand their roles and relationship within the server.

Tool Count2/5

With only two tools, the server feels under-scoped for a 'Browser MCP Server' that implies broader browser automation capabilities. A typical browser server might include tools for navigation, DOM interaction, or screenshots, making this set appear incomplete.

Completeness2/5

Inferred domain is browser automation, but the toolset is severely incomplete. It lacks basic operations like page navigation, element interaction, or screenshot capture, focusing narrowly on console output. This will likely cause agent failures for common browser tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
    18
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that enables LLMs to automate web browsers using Puppeteer, allowing navigation, screenshots, form filling, and JavaScript execution in a real browser environment.
    2
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides browser automation capabilities using Puppeteer with configurable options through environment variables, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a browser environment.
    7
    4
    -
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides browser automation capabilities using Puppeteer, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
    7
    23,092 npm
    1
    MIT