MCP Graylog 服务器 logo

MCP Graylog 服务器

Community
mothlike

Model Context Protocol server for querying Graylog 6+ from AI assistants

Publishermothlike
Repositorymcp-graylog
LanguagePython
Forks
9
Stars
12
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Graylog 服务器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    12 stars and 9 forks from the linked repository.

MCP Graylog

MCP Graylog is a Model Context Protocol server for querying Graylog 6+ from AI assistants. The default transport is Codex stdio. Streamable HTTP is available only when you explicitly opt in for a remote, shared, or containerized runtime. The server uses MCP Python SDK 2.x and supports its current and legacy protocol revisions.

Install Dependencies

Use Python 3.11 or newer. If you are new to Python projects, the safest setup is to keep this server in its own virtual environment.

  1. Install Python 3.11+ and uv.

    On macOS with Homebrew:

    sh
    brew install python@3.11 uv

    If Python is already installed, you can install uv with pip:

    sh
    python3 -m pip install --user uv
  2. Create and activate a virtual environment from the repository root:

    sh
    uv venv venv --python 3.11
    source venv/bin/activate
  3. Install the server dependencies:

    sh
    uv pip install -e .

    For development, tests, linting, and type checks, install the dev extras:

    sh
    uv pip install -e ".[dev]"
  4. Check that the command is available:

    sh
    uv run mcp-graylog --help
  5. If you installed the dev extras, run the test suite:

    sh
    uv run pytest -q

Quick Start: Codex Stdio

Install the project dependencies, then add this server to your Codex config:

toml
[mcp_servers.graylog]
command = "uv"
args = ["run", "mcp-graylog"]

[mcp_servers.graylog.env]
GRAYLOG_ENDPOINT = "https://graylog.example.com"
GRAYLOG_TOKEN = "gl2-your-token"
MCP_SERVER_TRANSPORT = "stdio"

Run the command from this repository when Codex starts the MCP server:

sh
uv run mcp-graylog

Token authentication with GRAYLOG_TOKEN is preferred. Legacy basic credentials are still supported by the runtime for older installations, but new setups should use a Graylog access token.

MCP Client Configuration Examples

All local client examples use stdio. Run them from this repository checkout, or replace uv with an absolute command that can start mcp-graylog in your environment.

Codex

Add this to ~/.codex/config.toml:

toml
[mcp_servers.graylog]
command = "uv"
args = ["run", "mcp-graylog"]

[mcp_servers.graylog.env]
GRAYLOG_ENDPOINT = "https://graylog.example.com"
GRAYLOG_TOKEN = "gl2-your-token"
MCP_SERVER_TRANSPORT = "stdio"

Claude Code

For a project-shared server, add .mcp.json at the repository root:

json
{
  "mcpServers": {
    "graylog": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "mcp-graylog"],
      "env": {
        "GRAYLOG_ENDPOINT": "https://graylog.example.com",
        "GRAYLOG_TOKEN": "gl2-your-token",
        "MCP_SERVER_TRANSPORT": "stdio"
      }
    }
  }
}

Equivalent CLI setup:

sh
claude mcp add-json graylog '{"type":"stdio","command":"uv","args":["run","mcp-graylog"],"env":{"GRAYLOG_ENDPOINT":"https://graylog.example.com","GRAYLOG_TOKEN":"gl2-your-token","MCP_SERVER_TRANSPORT":"stdio"}}'

Cursor

Add .cursor/mcp.json in the project, or ~/.cursor/mcp.json globally:

json
{
  "mcpServers": {
    "graylog": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "mcp-graylog"],
      "env": {
        "GRAYLOG_ENDPOINT": "https://graylog.example.com",
        "GRAYLOG_TOKEN": "gl2-your-token",
        "MCP_SERVER_TRANSPORT": "stdio"
      }
    }
  }
}

OpenCode

Add this to opencode.jsonc:

jsonc
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "graylog": {
      "type": "local",
      "command": ["uv", "run", "mcp-graylog"],
      "environment": {
        "GRAYLOG_ENDPOINT": "https://graylog.example.com",
        "GRAYLOG_TOKEN": "gl2-your-token",
        "MCP_SERVER_TRANSPORT": "stdio"
      },
      "enabled": true
    }
  }
}

Hermes

Add this to ~/.hermes/config.yaml:

yaml
mcp_servers:
  graylog:
    command: "uv"
    args: ["run", "mcp-graylog"]
    env:
      GRAYLOG_ENDPOINT: "https://graylog.example.com"
      GRAYLOG_TOKEN: "gl2-your-token"
      MCP_SERVER_TRANSPORT: "stdio"

Run /reload-mcp in Hermes after changing the file.

OpenClaw

Add this to ~/.openclaw/openclaw.json under mcp.servers, or use openclaw mcp set graylog '<json>' with the same server object:

json
{
  "mcp": {
    "servers": {
      "graylog": {
        "command": "uv",
        "args": ["run", "mcp-graylog"],
        "env": {
          "GRAYLOG_ENDPOINT": "https://graylog.example.com",
          "GRAYLOG_TOKEN": "gl2-your-token",
          "MCP_SERVER_TRANSPORT": "stdio"
        }
      }
    }
  }
}

Streamable HTTP

Use Streamable HTTP only when the server must be reachable from another process or host:

sh
GRAYLOG_ENDPOINT="https://graylog.example.com" \
GRAYLOG_TOKEN="gl2-your-token" \
MCP_SERVER_ALLOWED_HOSTS="mcp.example.com,mcp.example.com:*" \
uv run mcp-graylog --transport streamable-http --host 0.0.0.0 --port 8000 --path /mcp

The equivalent environment setting is:

sh
MCP_SERVER_TRANSPORT=streamable-http
MCP_SERVER_HOST=0.0.0.0
MCP_SERVER_PORT=8000
MCP_SERVER_PATH=/mcp
MCP_SERVER_DNS_REBINDING_PROTECTION=true
MCP_SERVER_ALLOWED_HOSTS=mcp.example.com,mcp.example.com:*
MCP_SERVER_ALLOWED_ORIGINS=https://app.example.com

MCP_SERVER_ALLOWED_HOSTS contains the exact hostnames accepted by the HTTP transport. Add both the bare hostname and hostname:* when clients may use an explicit port. For a direct IP deployment, use a value such as 192.0.2.10:*. Configure MCP_SERVER_ALLOWED_ORIGINS only for browser clients. To accept requests for any host behind a trusted reverse proxy, set MCP_SERVER_DNS_REBINDING_PROTECTION=false. This disables both Host and Origin validation and should not be used when the server is exposed directly.

Configuration

VariableRequiredDefaultDescription
GRAYLOG_ENDPOINTyes-Base URL for Graylog, without embedded credentials.
GRAYLOG_TOKENyes for new setups-Preferred Graylog access token.
GRAYLOG_VERIFY_SSLnotrueVerify TLS certificates.
GRAYLOG_TIMEOUTno30Graylog HTTP timeout in seconds.
MCP_SERVER_TRANSPORTnostdiostdio or streamable-http.
MCP_SERVER_HOSTno127.0.0.1Streamable HTTP bind host.
MCP_SERVER_PORTno8000Streamable HTTP bind port.
MCP_SERVER_PATHno/mcpStreamable HTTP MCP path.
MCP_SERVER_DNS_REBINDING_PROTECTIONnotrueValidate HTTP Host and Origin headers.
MCP_SERVER_ALLOWED_HOSTSnolocalhost valuesComma-separated allowed Host values.
MCP_SERVER_ALLOWED_ORIGINSnolocalhost valuesComma-separated allowed browser origins.
LOG_LEVELnoINFOServer log level.

Graylog 6+ API Compatibility

The server uses the current Graylog Search Scripting and system APIs:

  • POST /api/search/messages
  • POST /api/search/aggregate
  • GET /api/streams
  • GET /api/streams/{stream_id}
  • GET /api/system

It does not use the legacy universal search API. Search payloads use query, timerange, streams, fields, size, and from.

MCP Tools

  • search_logs(search) searches messages with a typed MessageSearchInput.
  • search_stream_logs(stream_id, search) searches messages in one stream.
  • aggregate_logs(aggregation) runs grouped aggregations with AggregateLogsInput.
  • list_streams() returns available Graylog streams.
  • get_stream_info(stream_id) returns one stream definition.
  • search_streams_by_name(stream_name) filters streams locally by title.
  • get_system_info() returns Graylog system information.
  • get_error_logs(hours=1, limit=100) searches recent error and critical logs.
  • get_log_count_by_level(hours=1) aggregates recent logs by level.

Tool Input Examples

json
{
  "query": "level:ERROR",
  "timerange": {"value": 1, "unit": "h"},
  "streams": [],
  "fields": ["timestamp", "source", "level", "message"],
  "limit": 50,
  "offset": 0
}
json
{
  "query": "*",
  "timerange": {"keyword": "Last 24 hours"},
  "field": "source",
  "metric": "count",
  "limit": 10
}
json
{
  "stream_id": "000000000000000000000001",
  "search": {
    "query": "source:api",
    "timerange": {"value": 24, "unit": "h"},
    "fields": ["timestamp", "source", "message"],
    "limit": 25,
    "offset": 0
  }
}

Development

sh
uv sync --extra dev
uv run pytest
uv run ruff check .

The package entrypoint is mcp-graylog, provided by mcp_graylog.cli:main.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "mothlike-mcp_graylog": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-graylog"
      ]
    }
  }
}

Use MCP Graylog 服务器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Graylog 服务器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Graylog 服务器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Graylog 服务器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mothlike-mcp_graylog": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-graylog"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Graylog 服务器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Graylog 服务器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Graylog 服务器 to help me with this task?
MCP Graylog 服务器
Sure. I read it.
Here is what I found using MCP Graylog 服务器.

Frequently asked questions

What is the MCP Graylog 服务器 MCP server used for?

MCP Graylog 服务器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Graylog 服务器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Graylog 服务器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Graylog 服务器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Graylog 服务器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Graylog 服务器 MCP to TypingMind?

MCP Graylog 服务器 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Graylog 服务器 MCP provide in TypingMind?

MCP Graylog 服务器 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Graylog 服务器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Graylog 服务器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇