Skip to main content
Glama

反冲

Vite MCP 服务器现已发布 Blowback

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

向 FE 开发服务器添加模型上下文协议 (MCP) 服务器以支持与 Cursor 的集成。

主要特点

  • FE开发服务器与MCP服务器集成

  • 通过 MCP 捕获和传输浏览器控制台日志

  • 基于检查点的日志管理

Related MCP server: Blowback

安装

将服务器添加到您的 Cursor MCP 配置中:

{
  "blowback": {
    "command": "npx",
    "args": ["-y", "blowback-context"]
  }
}

资源

控制台日志

用于检索浏览器控制台日志的资源。

注意:Cursor 目前不支持 MCP 资源功能。请使用get-console-logs工具。

截屏

用于捕获和管理屏幕截图的资源。

注意:与其他资源一样,Cursor 目前不直接支持此功能。请使用capture-screenshot工具。

工具

HMR 工具

工具名称

描述

get-hmr-events

检索最近的 HMR 事件

check-hmr-status

检查 HMR 状态

浏览器工具

工具名称

描述

start-browser

启动浏览器实例并导航到 Vite 开发服务器

capture-screenshot

截取当前页面或特定元素的屏幕截图。屏幕截图将保存到磁盘。由于 MCP 客户端的限制,您可能需要手动将保存的屏幕截图传输到编辑工具中。

get-element-properties

检索特定元素的属性和状态信息

get-element-styles

检索特定元素的样式信息

get-element-dimensions

检索特定元素的尺寸和位置信息

monitor-network

在指定的时间内监控浏览器中的网络请求

get-element-html

检索特定元素及其子元素的 HTML 内容

get-console-logs

使用可选的过滤功能从浏览器会话中检索控制台日志

execute-browser-commands

安全地执行预定义的浏览器命令

如何使用工具

工具名称

描述

how-to-use

提供有关如何使用该工具的说明

日志管理系统

日志管理方法

  • 所有浏览器控制台日志都存储在日志文件中

  • 您可以使用get-console-logs工具查询特定检查点的日志

检查站系统

检查点操作方法

  • 检查点用于管理特定版本的快照、日志、截图等

  • 当<meta name="__mcp_checkpoint" data-id="">插入到head时,数据会以 data-id 属性作为标识符单独记录

架构和数据流

核心组件

  1. MCP Server :基于模型上下文协议 SDK 的中央模块,为 MCP Client 提供工具。

  2. 浏览器自动化:使用 Puppeteer 控制 Chrome 来直观地检查变化。

  3. 检查点系统:维护浏览器状态的快照以供比较和测试。

数据源和状态管理

服务器维护几个重要的数据存储:

  • HMR 事件记录:跟踪来自 Vite 的最近的 HMR 事件(更新、错误)。

  • 控制台消息日志:捕获浏览器控制台输出以进行调试。

  • 检查点存储:存储浏览器状态的命名快照,包括 DOM 快照。

通信流程

  1. MCP 客户端 → 开发服务器:

    • MCP 客户端更改源代码,开发服务器检测到更改

    • 开发服务器自动更新浏览器或发出 HMR 事件

  2. Web 浏览器 → MCP 服务器:

    • HMR 事件和控制台日志通过 Puppeteer 捕获。

    • MCP 服务器查询浏览器的当前状态或截取屏幕截图

  3. MCP 服务器 → MCP 客户端:

    • 服务器将 HMR 事件转换为结构化响应。

    • 为 MCP 客户端提供查询 HMR 状态和捕获屏幕截图的工具。

国家维护

服务器维护以下引用对象:

  • 当前浏览器和页面实例

  • 最近的 HMR 活动

Available Tools

16 tools
browser-evaluateB

Evaluates JavaScript code directly in the browser context and returns the result. Supports expressions, function strings, and complex code with automatic execution handling. Can target the entire page or work with element handles for precise DOM manipulation.

Examples:

  • Simple expression: "document.title"

  • Arrow function: "() => document.querySelectorAll('a').length"

  • Regular function: "function() { return document.body.children.length; }"

  • Function with arguments: "(tag) => document.getElementsByTagName(tag).length"

  • Complex code: "() => { const divs = document.querySelectorAll('div'); return { count: divs.length, hasClass: divs[0]?.className }; }"

  • Async function: "async () => { const res = await fetch('/api'); return res.json(); }"

Inputs: function (required), args, element, contextId, +2 more.

capture-screenshotA

Captures a screenshot of the current page or a specific element. Stores the screenshot in the MCP resource system and returns a resource URI. If ENABLE_BASE64 environment variable is set to 'true', also includes base64 encoded image in the response.

Inputs: selector, url, contextId.

close-browserB

Closes a specific browser instance

Inputs: contextId (required).

execute-browser-commandsB

Executes a sequence of predefined browser commands safely. Available commands:

  • click: Clicks on an element matching the selector or at specified coordinates

  • type: Types text into an input element

  • wait: Waits for an element, a specified time period, or a condition

  • navigate: Navigates to a specified URL

  • select: Selects an option in a dropdown

  • check: Checks or unchecks a checkbox

  • hover: Hovers over an element

  • focus: Focuses an element

  • blur: Removes focus from an element

  • keypress: Simulates pressing a keyboard key

  • scroll: Scrolls the page or an element

  • getAttribute: Gets an attribute value from an element

  • getProperty: Gets a property value from an element

  • drag: Performs a drag operation from one position to another

  • refresh: Refreshes the current page

Note on coordinates: For all mouse-related commands (click, drag, etc.), coordinates are relative to the browser viewport where (0,0) is the top-left corner. X increases to the right, Y increases downward.

Examples are available in the schema definition.

Inputs: commands (required), timeout, contextId.

get-console-logsB

Retrieves console logs from the development server

Inputs: checkpoint, limit.

get-context-infoC

Gets detailed information about a specific browser instance

Inputs: contextId (required).

get-context-statsC

Gets usage statistics for browsers

Inputs: contextId.

get-element-dimensionsB

Retrieves dimension and position information of a specific element

Inputs: selector (required).

get-element-htmlA

Retrieves the HTML content of a specific element and its children with optional depth control

Inputs: selector (required), includeOuter, depth.

get-element-propertiesB

Retrieves properties and state information of a specific element

Inputs: selector (required), properties (required).

get-element-stylesC

Retrieves style information of a specific element

Inputs: selector (required), styleProperties (required).

get-hmr-eventsC

Retrieves recent HMR events

Inputs: limit.

how-to-useD

Description of how to use the server

Inputs: section (required).

list-browsersA

Lists all active browser instances

Inputs: type, tags, includeStats.

monitor-networkA

Monitors network requests in the browser for a specified duration

Inputs: urlPattern, duration.

start-browserB

Creates a new browser context with an auto-generated unique ID

Inputs: type, displayName, targetUrl, headless, +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: browser lifecycle (start, close, list), interaction (evaluate, screenshot, command sequence), inspection (element dimensions, HTML, properties, styles), and Vite-specific (console logs, HMR events, network monitor). No ambiguous overlap.

    Naming Consistency5/5

    All tool names use a consistent hyphenated lowercase verb-noun pattern (e.g., get-element-html, list-browsers, start-browser). Naming is predictable and uniform.

    Tool Count4/5

    16 tools is slightly above the ideal range of 3-15, but the set is well-scoped for the server's dual purpose of Vite dev server interaction and browser automation, without feeling bloated.

    Completeness5/5

    The tool set covers the full lifecycle (start, close, list), interactions (evaluate, screenshot, command sequences), element inspection, and Vite-specific diagnostics (console logs, HMR events, network monitoring). No obvious gaps for the intended use case.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers