LG

lcaliani/graylog-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

11 stars 5 forks Качество 77 Тренд 12MIT

A lightweight and easy-to-use MCP server for querying and retrieving logs from Graylog. Integrate your AI assistants (like Cursor and Claude) with your Graylog instance.

Обзор

A minimal MCP (Model Context Protocol) server in JavaScript that integrates with Graylog. - JavaScript MCP server - Tools: fetch_graylog_messages (query Graylog and return messages) - Multi-instance support — query multiple Graylog servers from a single MCP server Configure one or more Graylog instances using numbered env vars: Replace N with 1, 2, 3, … to register as many instances as needed. Only instances with both BASE_URL and API_TOKEN set will be active. No installation needed — npx downloads and runs the server automatically. - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Linux: ~/.config/claude-desktop/claude_desktop_config.json - Windows: %APPDATA%\Claude\claude_desktop_config.json Use the same JSON structure shown above for Cursor. Once configured, the fetch_graylog_messages tool becomes available and will be automatically called when needed. Example prompts:

README

Показан фрагмент оригинального README. Открыть оригинал.

Graylog MCP Server

A minimal MCP (Model Context Protocol) server in JavaScript that integrates with Graylog.

Features

  • JavaScript MCP server
  • Tools: fetch_graylog_messages (query Graylog and return messages)
  • Multi-instance support — query multiple Graylog servers from a single MCP server

Requirements

  • Node.js 18+

Configuration

Configure one or more Graylog instances using numbered env vars:

Variable Required Description
GRAYLOG_BASE_URL_INSTANCE_N yes Graylog base URL for instance N
GRAYLOG_API_TOKEN_INSTANCE_N yes API token for instance N
GRAYLOG_LABEL_INSTANCE_N no Human-readable label (default: instance_N)

Replace N with 1, 2, 3, … to register as many instances as needed. Only instances with both BASE_URL and API_TOKEN set will be active.

Use with an MCP client

No installation needed — npx downloads and runs the server automatically.

Claude Code

claude mcp add graylog-mcp npx @lcaliani/graylog-mcp-server@latest \
  -e GRAYLOG_BASE_URL_INSTANCE_1=http://your-graylog-production.example.com:9000 \
  -e GRAYLOG_API_TOKEN_INSTANCE_1=your_production_token \
  -e GRAYLOG_LABEL_INSTANCE_1=production \
  -e GRAYLOG_BASE_URL_INSTANCE_2=http://your-graylog-staging.example.com:9000 \
  -e GRAYLOG_API_TOKEN_INSTANCE_2=your_staging_token \
  -e GRAYLOG_LABEL_INSTANCE_2=staging

Or add it manually to ~/.claude.json:

{
  "mcpServers": {
    "graylog-mcp": {
      "command": "npx",
      "args": ["@lcaliani/graylog-mcp-server@latest"],
      "env": {
        "GRAYLOG_BASE_URL_INSTANCE_1":  "http://your-graylog-production.example.com:9000",
        "GRAYLOG_API_TOKEN_INSTANCE_1": "your_production_token",
        "GRAYLOG_LABEL_INSTANCE_1":     "production",

        "GRAYLOG_BASE_URL_INSTANCE_2":  "http://your-graylog-staging.example.com:9000",
        "GRAYLOG_API_TOKEN_INSTANCE_2": "your_staging_token",
        "GRAYLOG_LABEL_INSTANCE_2":     "staging"
      }
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "graylog-mcp": {
      "command": "npx",
      "args": ["@lcaliani/graylog-mcp-server@latest"],
      "env": {
        "GRAYLOG_BASE_URL_INSTANCE_1":  "http://your-graylog-production.example.com:9000",
        "GRAYLOG_API_TOKEN_INSTANCE_1": "your_production_token",
        "GRAYLOG_LABEL_INSTANCE_1":     "production",

        "GRAYLOG_BASE_URL_INSTANCE_2":  "http://your-graylog-staging.example.com:9000",
        "GRAYLOG_API_TOKEN_INSTANCE_2": "your_staging_token",
        "GRAYLOG_LABEL_INSTANCE_2":     "staging"
      }
    }
  }
}

Claude Desktop

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/claude-desktop/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Use the same JSON structure shown above for Cursor.


Use

Открыть полный README на GitHub

Установка

npx @lcaliani/graylog-mcp-server@latest
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "graylog-mcp": { "command": "npx", "args": ["@lcaliani/graylog-mcp-server@latest"], "env": { "GRAYLOG_BASE_URL_INSTANCE_1": "http://your-graylog-production.example.com:9000", "GRAYLOG_API_TOKEN_INSTANCE_1": "your_production_token", "GRAYLOG_LABEL_INSTANCE_1": "production", "GRAYLOG_BASE_URL_INSTANCE_2": "http://your-graylog-staging.example.com:9000", "GRAYLOG_API_TOKEN_INSTANCE_2": "your_staging_token", "GRAYLOG_LABEL_INSTANCE_2": "staging" } } } }