ConsoleSpy:用于 Cursor 的 MCP 服务器
一种捕获浏览器控制台日志并通过模型上下文协议 (MCP) 使其在 Cursor IDE 中可用的工具。
概述
该工具包括:
- 从浏览器捕获控制台日志的服务器 
- 一个 MCP 服务器,使这些日志可供 Cursor 使用 
- 将控制台日志发送到服务器的浏览器扩展 
安装
服务器设置
- 克隆此存储库: git clone https://github.com/mgsrevolver/consolespy.git cd consolespy
- 安装依赖项: npm install
- 运行安装脚本来配置 Cursor 的 MCP 连接: ./setup.sh
浏览器扩展安装
- 从Chrome 网上应用店安装扩展程序 - 或者 - 在开发者模式下加载扩展: - 打开 Chrome 并转到 - chrome://extensions/
- 启用“开发者模式”(在右上角切换) 
- 单击“加载解压的”并从此存储库中选择 - extension文件夹
 
用法
启动服务器
- 启动控制台日志服务器: node mcp-server.js
- 在单独的终端中,启动 MCP 服务器: npx supergateway --port 8766 --stdio "node console-spy-mcp.js"
或者,您可以使用启动脚本同时启动两个服务器:
配置光标
运行安装脚本后,您仍然需要在 Cursor 中手动添加 MCP 服务器:
- 前往“设置”>“功能”>“光标中的 MCP” 
- 添加新的 MCP 服务器: - 名称:ConsoleSpy 
- 类型:sse 
 
使用扩展
- 单击浏览器中的扩展程序图标即可打开/关闭它 
- 启用后,当前选项卡的所有控制台日志都将发送到服务器 
- 在 Cursor 中,您现在可以通过 MCP 界面访问这些日志 
定制
更改控制台日志服务器端口
如果您需要为控制台日志服务器使用不同的端口(默认为 3333),则需要在多个地方更新端口:
- 在 - mcp-server.js中,更改端口变量:const port = 3333; // Change to your desired port
- 在 - console-spy-mcp.js中,更新 URL 以匹配你的新端口:const CONSOLE_SERVER_URL = 'http://localhost:3333/mcp'; // Change 3333 to your port
- 在浏览器扩展的 - content.js中,更新服务器 URL:const serverUrl = 'http://localhost:3333/console-logs'; // Change 3333 to your port
- 如果使用 - start-servers.sh,也请在那里更新端口引用。
**重要提示:**您必须在所有位置使用相同的端口号。我们建议您在项目文件中全局搜索“3333”,并将所有实例替换为所需的端口号,以确保一致性。
如果您正在本地测试另一个已使用端口 3333 的应用程序,则更改此端口对于该工具正常工作至关重要。
故障排除
- 确保两台服务器都在运行 
- 验证您正在调试的选项卡是否已启用浏览器扩展 
- 检查您是否已在 Cursor 的设置中添加了 MCP 服务器 
- 如果日志未显示,请尝试刷新页面或重新启动服务器 
执照
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
一种捕获浏览器控制台日志并通过模型上下文协议 (MCP) 使其在 Cursor IDE 中可用的工具。
Related Resources
Related MCP Servers
- -security-license-qualityA Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.
- -security-license-qualityAn MCP server that provides detailed information about your development environment to the Cursor code editor, enabling more context-aware assistance.Last updated -5MIT License
- -security-license-qualityA TypeScript-based server project that can be integrated with Cursor IDE as an MCP (Model Control Protocol) server, enabling enhanced development capabilities.Last updated -139
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server for Cursor IDE that simplifies the installation and configuration of other MCP servers.Last updated -39570MIT License