MCP 服务器:分析和调试 MCP 日志
🎯 概述
MCP 日志读取器是一款专用的 MCP 服务器,可帮助您分析和调试模型上下文协议 (MCP) 日志。它允许 Claude 直接访问日志文件,从而轻松排除 MCP 集成故障,并了解 Claude 如何与您的工具交互。
多平台支持:适用于 macOS、Windows 和 Linux,具有平台特定的日志路径
智能过滤:使用不区分大小写的文本搜索查找特定的日志条目
分页浏览:高效浏览大量日志集合
大小管理:使用智能截断处理大型日志文件
无缝 Claude 集成:直接与 Claude Desktop 协同工作
🚀 快速入门
直接从 GitHub 安装:
# Clone the repository
git clone https://github.com/klara-research/MCP-Analyzer.git
cd MCP-Analyzer
# Install dependencies
npm i
构建并运行:
# Compile TypeScript
npx tsc
🔌 连接到 Claude
将服务器添加到您的 Claude Desktop 配置:
{
"mcpServers": {
"log-reader": {
"command": "node",
"args": [
"/absolute/path/MCP-Analyzer/build"
]
}
}
}
然后重新启动 Claude Desktop。
📋 可用参数
日志阅读器支持以下参数:
范围 | 描述 | 默认 |
| 从每个日志文件读取的行数 | 100 |
| 用于过滤日志条目的文本(不区分大小写) | “” |
| 自定义日志目录路径 | 特定于操作系统 |
| 每页读取的最大文件数 | 5 |
| 页码 | 1 |
💡 使用示例
要求 Claude 使用日志阅读器工具:
Can you check my MCP logs for any connection errors in the last day?
或者使用特定参数:
Can you look through MCP logs with filter="error" and lines=50 to find initialization issues?
⚙️ 工作原理
服务器自动检测您的操作系统并找到适当的日志目录
它定位所有 MCP 日志文件并按修改时间排序(最新的在前)
根据分页设置检索所请求的日志文件页面
文件处理时有大小限制,以防止响应过多
过滤后的内容以结构化格式返回,并带有分页详细信息
📄 许可证
MIT 许可证
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server built with mcp-framework that allows users to create and manage custom tools for processing data, integrating with the Claude Desktop via CLI.Last updated -265
- AsecurityAlicenseAqualityA Model Context Protocol server that automatically reads the Claude Desktop configuration file and presents all available MCP services in an easy-to-copy format at the top of the tools list.Last updated -1273MIT License
- -security-license-qualityAn MCP server implementation that allows Claude to read and process CLP (Compact Log Protocol) files, supporting both stdio and SSE/HTTP communication methods.
- AsecurityFlicenseAqualityA Model Context Protocol server that allows integration with Claude Desktop by creating and managing custom tools that can be executed through the MCP framework.Last updated -40