S

Seq日志监控服务器

@ahmad2x4/mcp-server-seq
Hosted
0 Stars 493 次浏览 ahmad2x4 更新于 2026-08-23

Seq MCP服务器启用了与Seq API端点的交互,用于日志记录和监控,提供了管理信号、事件和警报的工具,并具有广泛的过滤和配置选项。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "seq": {
      "args": [
        "/Users/ahmadreza/source/ahmad2x4/mcp-server-seq/build/seq-server.js"
      ],
      "command": "node",
      "env": {
        "SEQ_API_KEY": "your-api-key",
        "SEQ_BASE_URL": "your-seq-url"
      }
    }
  }
}

该服务需要配置环境变量:SEQ_API_KEY、SEQ_BASE_URL

可用工具 (3 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get-signals 3 个参数

该工具无需必填参数,直接调用即可

get-events 6 个参数

Retrieve and analyze a list of event filtered by parameters. Use this tool when you need to: - Investigate events that are being logged in the SEQ server - Details of each event is a structured log and can provide usefull information - Events could be information, error, debug, or critical - Analyze error patterns and frequencies

该工具无需必填参数,直接调用即可

get-alertstate

该工具无需必填参数,直接调用即可

服务介绍

Seq MCP 服务器

Seq 的 API 端点的 MCP 服务器,用于与您的日志和监控系统进行交互。该服务器通过 Model Context Protocol 提供对 Seq API 功能的全面访问。

特性

工具

信号管理

  • get-signals - 获取带有过滤选项的信号
    • 按所有者 ID 过滤
    • 过滤共享/私有信号
    • 支持部分匹配

事件管理

  • get-events - 使用广泛的过滤选项检索事件
    • 按信号 ID 过滤
    • 自定义过滤表达式
    • 可配置的事件数量(最大 100)
    • 灵活的时间范围选项
    • 日期范围过滤

警报管理

  • get-alertstate - 检索警报的当前状态

资源

信号列表

  • signals - 列出所有共享信号及其详细信息
    • 信号 ID
    • 标题
    • 描述
    • 共享状态
    • 所有者信息

配置

该服务器需要以下环境变量:

  • SEQ_BASE_URL(可选):您的 Seq 服务器 URL(默认为 'http://localhost:8080')
  • SEQ_API_KEY(必需):您的 Seq API 密钥

与 Claude Desktop 一起使用

将以下内容添加到您的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "seq": {
      "command": "npx",
      "args": ["-y", "mcp-seq"],
      "env": {
        "SEQ_BASE_URL": "your-seq-url",
        "SEQ_API_KEY": "your-api-key"
      }
    }
  }
}

开发

安装依赖项:

npm install

构建服务器:

npm run build

开发时启用自动重建:

npm run dev

运行测试:

npm run test-script

时间范围选项

get-events 工具支持以下时间范围选项:

  • 1m - 最近 1 分钟
  • 15m - 最近 15 分钟
  • 30m - 最近 30 分钟
  • 1h - 最近 1 小时
  • 2h - 最近 2 小时
  • 6h - 最近 6 小时
  • 12h - 最近 12 小时
  • 1d - 最近 1 天
  • 7d - 最近 7 天
  • 14d - 最近 14 天
  • 30d - 最近 30 天

安装

此工具仍在开发中,我们尚未将其推送到 npm 仓库。您需要在本地克隆此仓库然后构建 npm run build

要与 Claude Desktop 一起使用,请添加服务器配置:

在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "seq": {
      "command":"node",
      "args": ["/Users/ahmadreza/source/ahmad2x4/mcp-server-seq/build/seq-server.js"],
      "env": {
        "SEQ_BASE_URL": "your-seq-url",
        "SEQ_API_KEY": "your-api-key"
      }
    }
  }
}

调试

由于 MCP 服务器通过 stdio 通信,调试可能会比较困难。该服务器实现了所有操作的适当错误处理和日志记录。您可以运行测试脚本来验证功能:

npm run test-script

类型安全

该服务器使用以下方法实现全面的类型安全:

  • TypeScript 用于静态类型检查
  • Zod 模式验证用于运行时类型检查
  • 适当的错误处理和响应格式化
    =======

相关 MCP 服务