graylog-mcp
Provides tools for fetching messages from Graylog instances, allowing search queries, time ranges, field selection, and multi-instance support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@graylog-mcp Search for recent errors in production Graylog instance."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Graylog MCP Server
Requirements
Node.js 18+
Configuration
Configure one or more Graylog instances using numbered env vars:
Variable | Required | Description |
| yes | Graylog base URL for instance N |
| yes | API token for instance N |
| no | Human-readable label (default: |
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=stagingOr 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.jsonLinux:
~/.config/claude-desktop/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Use the same JSON structure shown above for Cursor.
Use
Once configured, the fetch_graylog_messages tool becomes available and will be automatically called when needed. Example prompts:
Search for the latest 20 error logs of the example application in the last 15 minutes.Search for the latest 20 error logs of the example application in the last 15 minutes.
Query the "staging" Graylog instance.Available tools
fetch_graylog_messages
Fetch messages from Graylog.
Parameters:
query(string, required): Search query. Example:level:ERROR AND service:api.instance(string, optional): Label of the Graylog instance to query. Defaults to the first configured instance.searchTimeRangeInSeconds(number, optional): Relative time range in seconds. Default:900(15 minutes).searchCountLimit(number, optional): Max number of messages. Default:50.fields(string, optional): Comma-separated fields to include. Default:*(all fields).
Troubleshooting
Ensure at least
GRAYLOG_BASE_URL_INSTANCE_1andGRAYLOG_API_TOKEN_INSTANCE_1are set.Verify Node.js 18+ is installed.
Set
DEBUG=truein the env to enable verbose logging to stderr.
License
MIT
Available Tools
1 toolfetch_graylog_messagesA
Fetch messages from a Graylog instance.
Active instances: "instance_1". Default instance: "instance_1".
Use the "instance" parameter to target a specific Graylog server. Each instance is identified by its label (set via GRAYLOG_LABEL_INSTANCE_N env var). If no label is configured, instances are identified as "instance_1", "instance_2", etc.
Inputs: query (required), instance, searchTimeRangeInSeconds, searchCountLimit, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools. The tool's purpose is clearly stated.
The single tool name 'fetch_graylog_messages' follows a consistent verb_noun pattern, which is clear and predictable.
The server has only one tool for a domain (Graylog) that typically requires multiple operations. One tool feels insufficient for the apparent scope, leading to a score of 2.
The server provides only a single fetch tool, lacking any other operations such as search, create, update, or delete for messages, nor any management of streams or dashboards. This is severely incomplete for a Graylog integration.
Maintenance
Related MCP Connectors
Query your app's logs, metrics and incidents from your AI assistant.
Search log events, investigate anomalies, and manage cases in your Knowledge Grid tenant.
Ingest and search LogsLoom logs from coding agents.
Search and analyze meeting transcripts, summaries, soundbites and analytics from Fireflies.ai
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query and analyze logs from Graylog instances using universal search with relative or absolute time windows, supporting both full result retrieval and lightweight count-only queries.43 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and analyze logs in Graylog using three powerful tools: generic log search with Lucene queries, smart UUID/trace ID lookup across multiple fields, and stream-specific message retrieval with automatic field normalization.24 npmMIT
- AlicenseDqualityBmaintenanceIntegrates AI assistants with Graylog to query and analyze log data using Elasticsearch syntax and stream-specific filtering. It enables users to perform advanced searches, retrieve log statistics, and manage Graylog streams through natural language.912MIT
- AlicenseAqualityCmaintenanceAn MCP server that gives AI assistants direct access to your Graylog logs -- search, aggregate, analyze, and cluster log data through natural language.23335 npmMIT