mcp-server-logs-sieve
mcp-server-logs-sieve
mcp-server-logs-sieve 是一个 MCP 服务器,允许 AI 助手直接从您的可观测性后端查询日志。
用自然语言提出调试问题,让 Logs Sieve 为您提取精确的日志和上下文。
为什么存在这个项目
在处理事故期间,大量时间被浪费在重复性步骤上:
寻找正确的日志源
缩小时间窗口
发现反复出现的故障模式
跨服务追踪单个请求
Logs Sieve 将这些工作流封装为四个工具:query_logs、summarize_logs、trace_request 和 list_log_sources。
Related MCP server: Azure Logs MCP
支持的提供商
Google Cloud Logging (
gcp)AWS CloudWatch Logs (
aws)Azure Monitor Logs (
azure)Grafana Loki (
loki)Elasticsearch (
elasticsearch)
先决条件
⚠️ 需要 Node.js 20 或更高版本。
本包使用 ES 模块和需要 Node.js 20+ 的依赖项。如果您看到
ERR_MODULE_NOT_FOUND错误,请使用node -v检查您的 Node 版本,并在必要时进行升级。无论您是通过
npx运行、全局安装还是从源码使用,此要求均适用。
快速 MCP 配置
示例 .mcp.json:
{
"mcpServers": {
"logs-sieve": {
"command": "npx",
"args": ["-y", "mcp-server-logs-sieve@latest", "--provider", "gcp"]
}
}
}如果您直接从该仓库源码运行,仍然可以使用 node ./bin/mcp-server-logs-sieve.js --provider gcp。
首次设置: 首次使用时,npx 需要下载并安装该包(约 40 秒)。Claude Code 可能会因等待此过程而超时。在将其添加到 MCP 配置之前,请在终端中运行以下命令以预热缓存:
npx mcp-server-logs-sieve@latest --provider gcp
# (Ctrl+C once it starts — you just need the install to complete)之后,Claude Code 将立即从 npx 缓存启动服务器。
更新配置后,重启您的 MCP 客户端并使用 /mcp 进行确认。
提供商认证和环境变量
请参阅特定提供商的设置和认证文档:
关于 Elasticsearch API 兼容性标头:
export ELASTICSEARCH_COMPAT_VERSION=8CLI 使用
该包还包含一个用于直接终端使用的 CLI:
mcp-server-logs-sieve query --provider gcp --scope my-project --last 1h --filter "payment failed"
mcp-server-logs-sieve summarize --provider gcp --scope my-project --last 24h
mcp-server-logs-sieve trace --provider gcp --scope my-project --trace <trace-id>
mcp-server-logs-sieve sources --provider gcp --scope my-project文档
贡献
欢迎贡献代码。
Maintenance
Related MCP Connectors
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that allows AI assistants to access AWS CloudWatch logs by listing log groups and reading log entries.27-
- AlicenseBqualityDmaintenanceEnables querying Azure Application Insights logs by order number through natural language. Provides secure access to Azure Monitor logs with comprehensive error handling and rate limiting.11MIT
- FlicenseAqualityDmaintenanceEnables text-to-image generation, image editing, and multi-image composition using Google's Gemini 2.5 Flash Image API. Supports flexible aspect ratios and character consistency across generations.1-
- AlicenseAqualityDmaintenanceMCP server for log file analysis. Gives LLMs the ability to efficiently analyze large log files without loading them into context.7100MIT