EB

esnark/blowback

浏览器自动化

本页由 AI 翻译,技术细节请以原文为准。 查看原文

23 stars 6 forks 质量 63 趋势 0

前端开发环境的 MCP 服务器(前称 vite-mcp-server)

概览

Vite MCP 服务器现已更名为 Blowback Blowback,旨在支持各种 FE 开发服务器,而不仅仅是 Vite。 一款模型上下文协议(MCP)服务器,将前端开发服务器与 Claude Desktop 和 Cursor 等 AI 工具集成。 或者使用json配置:- Claude Code: {PROJECT_ROOT}/.mcp.json - Cursor: {PROJECT_ROOT}/.cursor/mcp.json - PROJECT_ROOT:项目根路径(可选,默认为当前工作目录)- ENABLE_BASE64:在工具响应中包含 base64 编码图像(默认:false / 启用时影响令牌使用和上下文窗口) - 本地开发服务器与MCP服务器集成 - 浏览器控制台日志捕获与传输(通过MCP) - 基于检查点的日志管理 - 截图捕捉和SQLite数据库管理 - HMR(热模块替换)事件监控 - 浏览器自动化和元素检查 初始提示为 AI 助手提供了如何有效使用以下功能的指导: 不支持 MCP 提示功能,所以......

概述(AI 翻译)

Vite MCP 服务器现已变成 Blowback

Blowback 旨在支持各种 FE 开发服务器,而不仅仅是 Vite。

一款模型上下文协议(MCP)服务器,将前端开发服务器与 Claude Desktop 和 Cursor 等 AI 工具集成。

如何使用

指令(Claude代码):

或者使用 json 配置:

  • Claude 代码:{PROJECT_ROOT}/.mcp.json
  • 光标:{PROJECT_ROOT}/.cursor/mcp.json

环境变量

  • PROJECT_ROOT:项目根路径(可选,默认为当前工作目录)
  • ENABLE_BASE64:在工具响应中包含 base64 编码图像(默认:false / 启用时影响令牌使用和上下文窗口)

主要特色

  • 本地开发服务器与 MCP 服务器的集成
  • 通过MCP捕获和传输浏览器控制台日志
  • 基于检查点的日志管理
  • 截图采集和SQLite数据库管理
  • HMR(热模块替换)事件监控
  • 浏览器自动化和元素检测

init提示词

init 提示为 AI 助手提供了如何有效使用以下功能的指导:

光标聊天不支持MCP提示功能,因此此功能不可用。(推荐使用Claude代码)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Blowback

Vite MCP Server is now Blowback

Blowback aims to support various FE development servers, not only Vite

A Model Context Protocol (MCP) server that integrates FE development servers with AI tools like Claude Desktop and Cursor.

How to Use

Command (Claude Code):

claude mcp add blowback -s project -e PROJECT_ROOT=/path/to/your/project -- npx -y blowback-context

Or use json configuration:

  • Claude Code: {PROJECT_ROOT}/.mcp.json
  • Cursor: {PROJECT_ROOT}/.cursor/mcp.json
{
  "mcpServers": {
    "blowback": {
      "command": "npx",
      "args": ["-y", "blowback-context"],
      "env": {
        "PROJECT_ROOT": "/path/to/your/project"
      }
    }
  }
}

Environment Variables

  • PROJECT_ROOT: Project root path (optional, defaults to current working directory)
  • ENABLE_BASE64: Include base64 encoded images in tool responses (default: false / affects token usage and context window when enabled)

Key Features

  • Integration of local development server with MCP server
  • Browser console log capture and transmission via MCP
  • Checkpoint-based log management
  • Screenshot capture and SQLite database management
  • HMR (Hot Module Replacement) event monitoring
  • Browser automation and element inspection

init Prompt

The init prompt provides guidance to AI assistants on how to effectively use the following features:

Cursor Chat does not support MCP prompt functionality, so this feature is not available. (Claude Code recommended) If needed, manually input the following prompt:

You can use checkpoint features by inserting `` into the head to create a named snapshot of the current state. The data-id attribute is a unique identifier for the checkpoint.

Console logs generated in the browser while a checkpoint is active are tagged with the checkpoint ID and can be queried individually.

Note: In some development environments, hot reload is triggered when files are saved, so carefully consider the sequence between meta tag changes and the changes you want to observe. Make sure to set the checkpoint meta tag before making the changes you want to track.

You can use the capture-screenshot tool to take screenshots. The captured screenshots are stored in the @.mcp_screenshot/ directory.

Tools

HMR Tools

Tool Name Description
get-hmr-events Retrieves recent HMR events
check-hmr-status Checks the HMR status

Note: HMR connection is optional, not required. HMR event monitoring starts automatically when the browser is launched.

Browser Tools

Tool Name Description
start-browser Starts a browser instance and navigates to the development server. HMR monitoring starts automatically
capture-screenshot Captures a screenshot of the current page or a specific element. Returns screenshot ID and resource URI
在 GitHub 查看完整 README

安装

npx -y blowback-context
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "blowback": { "command": "npx", "args": ["-y", "blowback-context"], "env": { "PROJECT_ROOT": "/path/to/your/project" } } } }