标准输出 mcp 服务器
模型上下文协议 (MCP) 服务器,用于通过命名管道系统捕获和管理标准输出日志。此服务器尤其适用于:
从多个进程或应用程序捕获日志并使其可用于在 Cursor IDE 中进行调试。
实时监控应用程序输出,并提供MCP接口查询、过滤和分析日志
工作原理
服务器在特定位置创建命名管道(Unix/MacOS 上为
/tmp/stdout_pipe,Windows 上为\\.\pipe\stdout_pipe)任何应用程序都可以使用标准输出重定向将日志写入此管道。例如:
服务器监控管道,捕获所有传入的日志,并维护最近 100 条条目的历史记录
通过MCP工具,您可以查询、过滤和分析这些日志
系统要求
安装之前,请确保您已:
Node.js v18 或更高版本
安装选项
选项 1:在 Cursor 中安装
打开 Cursor 并导航至
Cursor > Settings > MCP Servers点击“添加新的 MCP 服务器”
使用以下配置更新您的 MCP 设置文件:
选项 2:在其他 MCP 客户端中安装
在其他 MCP 客户端中安装
对于 macOS/Linux:
对于 Windows:
使用示例
重定向应用程序日志
要将应用程序的输出发送到管道:
监控多个应用程序
您可以从多个来源重定向日志:
查询日志
您的 AI 将使用 MCP 客户端中的get-logs工具来检索和过滤日志:
特征
命名管道创建和监控
实时日志捕获和存储
通过 MCP 工具进行日志过滤和检索
可配置的日志历史记录(默认值:100 条)
跨平台支持(基于 Windows 和 Unix 的系统)
命名管道位置
Windows:
\\.\pipe\stdout_pipeUnix/MacOS:
/tmp/stdout_pipe
可用工具
获取日志
使用可选过滤从命名管道检索日志:
参数:
lines(可选,默认值:50):要返回的日志行数filter(可选):用于过滤日志的文本since(可选):获取日志的时间戳
示例响应:
执照
MIT 许可证
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
模型上下文协议服务器通过命名管道捕获和管理标准输出日志,使应用程序输出可用于在 Cursor IDE 等 AI 工具中查询和调试。
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.
- Asecurity-licenseAqualityA Model Context Protocol server that provides programmatic access to the Windows terminal, enabling AI models to interact with the Windows command line through standardized tools for writing commands, reading output, and sending control signals.Last updated -3MIT License
- Asecurity-licenseAqualityA Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.Last updated -74264MIT License
- Asecurity-licenseAqualityA Model Context Protocol server that enables AI tools to automatically log their activities with detailed metrics like timestamps, token usage, and costs into daily markdown worklog files.Last updated -11MIT License