SEQ MCP Server

SEQ MCP Server

Enables LLMs to query and analyze logs from SEQ structured logging server with capabilities for searching events, retrieving event details, analyzing log patterns, and accessing saved searches.

Category
访问服务器

Tools

search_events

Search for events in SEQ logs with powerful filtering

get_event

Get detailed information about a specific log event

analyze_logs

Analyze log patterns and statistics over a time period

list_signals

List all configured signals (saved searches) in SEQ

check_health

Check the health status of the SEQ server

README

SEQ MCP Server

An MCP (Model Context Protocol) server that enables LLMs to query and analyze logs from SEQ structured logging server.

Features

  • Search Events: Query logs with powerful SEQ filter syntax
  • Get Event Details: Retrieve complete information about specific log events
  • Analyze Logs: Statistical analysis of log patterns over time periods
  • List Signals: Access saved searches/signals configured in SEQ
  • Health Check: Monitor SEQ server status

Prerequisites

  • Node.js 18+
  • Access to a SEQ server instance
  • SEQ API key (optional but recommended for secure instances)

Installation

Option 1: Using Docker (Recommended)

# Using GitHub Container Registry
docker pull ghcr.io/roeej/seq-mcp:latest

# Or using Docker Hub
docker pull roeej/seq-mcp:latest

Option 2: From Source

git clone https://github.com/RoeeJ/seq-mcp.git
cd seq-mcp
npm install
npm run build

Configuration

Environment Variables

Variable Description Default Required
SEQ_URL URL of your SEQ server http://localhost:5341 Yes
SEQ_API_KEY API key for authentication - No*
SEQ_DEFAULT_LIMIT Default number of events to return 100 No
SEQ_TIMEOUT Request timeout in milliseconds 30000 No

*Required if your SEQ instance has authentication enabled

Setup Instructions

  1. Copy the example environment file:
cp .env.example .env
  1. Edit .env with your SEQ server details:
SEQ_URL=http://your-seq-server:5341
SEQ_API_KEY=your-api-key-here

Usage with Claude Desktop

macOS

  1. Open Claude Desktop settings
  2. Navigate to "Developer" → "Edit Config"
  3. Add the SEQ server configuration:
{
  "mcpServers": {
    "seq": {
      "command": "node",
      "args": ["/absolute/path/to/seq-mcp/dist/index.js"],
      "env": {
        "SEQ_URL": "http://localhost:5341",
        "SEQ_API_KEY": "your-api-key-here"
      }
    }
  }
}

Windows

  1. Open Claude Desktop settings
  2. Navigate to "Developer" → "Edit Config"
  3. Add the SEQ server configuration:
{
  "mcpServers": {
    "seq": {
      "command": "node.exe",
      "args": ["C:\\path\\to\\seq-mcp\\dist\\index.js"],
      "env": {
        "SEQ_URL": "http://localhost:5341",
        "SEQ_API_KEY": "your-api-key-here"
      }
    }
  }
}

Usage with Claude Code

Option 1: Using .env file

  1. Create a .env file in your project root:
SEQ_URL=http://localhost:5341
SEQ_API_KEY=your-api-key-here
  1. Add to your Claude Code MCP configuration:
{
  "seq": {
    "command": "node",
    "args": ["/path/to/seq-mcp/dist/index.js"]
  }
}

Option 2: Using environment variables directly

{
  "seq": {
    "command": "node",
    "args": ["/path/to/seq-mcp/dist/index.js"],
    "env": {
      "SEQ_URL": "http://localhost:5341",
      "SEQ_API_KEY": "your-api-key-here",
      "SEQ_DEFAULT_LIMIT": "200",
      "SEQ_TIMEOUT": "60000"
    }
  }
}

Option 3: Using system environment variables

Set environment variables in your shell:

# macOS/Linux - add to ~/.bashrc or ~/.zshrc
export SEQ_URL="http://localhost:5341"
export SEQ_API_KEY="your-api-key-here"

# Windows PowerShell
$env:SEQ_URL = "http://localhost:5341"
$env:SEQ_API_KEY = "your-api-key-here"

Then use a simple configuration:

{
  "seq": {
    "command": "node",
    "args": ["/path/to/seq-mcp/dist/index.js"]
  }
}

Getting API Keys from SEQ

  1. Open your SEQ instance in a web browser
  2. Navigate to Settings → API Keys
  3. Click "Add API Key"
  4. Provide a title (e.g., "MCP Server")
  5. Set appropriate permissions (typically "Read" is sufficient)
  6. Copy the generated API key

Example Usage in Claude

Once configured, you can query your logs naturally:

"Show me all error logs from the last hour"
"Find logs containing 'timeout' errors"
"Analyze the log patterns for my API service"
"What are the most common errors in the last 24 hours?"
"Get details for event ID abc123"

Available Tools

search_events

Search for events with filters:

- query: SEQ filter syntax (e.g., "Level = 'Error'" or "@Message like '%failed%'")
- count: Number of results (1-1000)
- fromDate/toDate: ISO date strings
- level: Filter by log level

get_event

Get detailed information about a specific event by ID.

analyze_logs

Analyze log patterns:

- query: Optional SEQ filter
- timeRange: 1h, 6h, 24h, 7d, or 30d
- groupBy: Property name to group results

list_signals

List all configured signals (saved searches) in SEQ.

check_health

Check SEQ server health status.

Troubleshooting

Connection Issues

  1. Verify SEQ is running:

    curl http://localhost:5341/api/health
    
  2. Check API key permissions: Ensure your API key has "Read" permissions

  3. Network/Firewall: Ensure the MCP server can reach your SEQ instance

  4. Timeout errors: Increase SEQ_TIMEOUT for large queries

Common Errors

  • "Unauthorized": Check your API key is correct
  • "Connection refused": Verify SEQ_URL and that SEQ is running
  • "Timeout": Query may be too complex, try adding more specific filters

Development

# Run in development mode
npm run dev

# Run tests
npm test

# Lint code
npm run lint

# Type check
npm run typecheck

SEQ Query Examples

  • Level = 'Error' - All error logs
  • @Message like '%timeout%' - Messages containing "timeout"
  • Application = 'MyApp' and Level in ['Warning', 'Error'] - Warnings and errors from MyApp
  • @Timestamp > Now() - 1h - Events from last hour
  • StatusCode >= 400 - HTTP errors
  • Environment = 'Production' and ResponseTime > 1000 - Slow production requests
  • UserId = '12345' - All logs for specific user
  • @Exception is not null - All logs with exceptions

Advanced Configuration

Using with Docker

If SEQ is running in Docker:

{
  "seq": {
    "command": "node",
    "args": ["/path/to/seq-mcp/dist/index.js"],
    "env": {
      "SEQ_URL": "http://host.docker.internal:5341",
      "SEQ_API_KEY": "your-api-key"
    }
  }
}

Using with Remote SEQ

For cloud-hosted SEQ instances:

{
  "seq": {
    "command": "node",
    "args": ["/path/to/seq-mcp/dist/index.js"],
    "env": {
      "SEQ_URL": "https://seq.yourcompany.com",
      "SEQ_API_KEY": "your-api-key",
      "SEQ_TIMEOUT": "60000"
    }
  }
}

Docker Usage

Running the Container

# Basic usage
docker run --rm \
  -e SEQ_URL=http://host.docker.internal:5341 \
  -e SEQ_API_KEY=your-api-key \
  ghcr.io/roeej/seq-mcp:latest

# With all environment variables
docker run --rm \
  -e SEQ_URL=http://your-seq-server:5341 \
  -e SEQ_API_KEY=your-api-key \
  -e SEQ_DEFAULT_LIMIT=200 \
  -e SEQ_TIMEOUT=60000 \
  ghcr.io/roeej/seq-mcp:latest

Using with Claude Desktop (Docker)

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "seq": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "SEQ_URL=http://host.docker.internal:5341",
        "-e", "SEQ_API_KEY=your-api-key",
        "ghcr.io/roeej/seq-mcp:latest"
      ]
    }
  }
}

Using with Claude Code (Docker)

{
  "seq": {
    "command": "docker",
    "args": [
      "run",
      "--rm",
      "-i",
      "-e", "SEQ_URL=http://your-seq-server:5341",
      "-e", "SEQ_API_KEY=your-api-key",
      "ghcr.io/roeej/seq-mcp:latest"
    ]
  }
}

Docker Compose Example

Create a docker-compose.yml:

version: '3.8'

services:
  seq-mcp:
    image: ghcr.io/roeej/seq-mcp:latest
    environment:
      - SEQ_URL=http://seq:5341
      - SEQ_API_KEY=${SEQ_API_KEY}
    networks:
      - seq-network

  seq:
    image: datalust/seq:latest
    ports:
      - "5341:5341"
    environment:
      - ACCEPT_EULA=Y
    networks:
      - seq-network

networks:
  seq-network:
    driver: bridge

Architecture

  • MCP Server: Handles tool definitions and request routing
  • SEQ Client: Manages API communication with SEQ
  • Type Safety: Full TypeScript with Zod validation
  • Error Handling: Graceful degradation and meaningful error messages

Security

  • API keys are never logged or exposed
  • All requests are validated before execution
  • Timeout protection for long-running queries
  • Read-only operations (no log modification)
  • Supports both HTTP and HTTPS connections

CI/CD Pipeline

This project uses GitHub Actions for continuous integration and deployment:

  • CI: Runs on every push and PR to ensure code quality

    • Linting with ESLint
    • Type checking with TypeScript
    • Unit tests with Vitest
    • Multi-version Node.js testing (18.x, 20.x)
  • Docker Publishing:

    • Automatically builds and publishes to GitHub Container Registry on main branch
    • Publishes to Docker Hub on version tags
    • Multi-platform builds (linux/amd64, linux/arm64)
    • Semantic versioning tags

Creating a Release

  1. Tag your release:

    git tag v1.0.0
    git push origin v1.0.0
    
  2. The GitHub Action will automatically:

    • Build multi-platform Docker images
    • Push to ghcr.io/roeej/seq-mcp:1.0.0
    • Push to dockerhub/roeej/seq-mcp:1.0.0 (requires secrets setup)

Required GitHub Secrets

For Docker Hub publishing (optional):

  • DOCKERHUB_USERNAME: Your Docker Hub username
  • DOCKERHUB_TOKEN: Docker Hub access token

Note: GitHub Container Registry (ghcr.io) publishing works automatically with the repository's GITHUB_TOKEN, no additional setup required.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选