Journald MCP Server

io.github.james116bluePublished by GitHub account james116bluev0.1.0Updated Oct 24, 2026

Incident forensic with log files analyzing

VerifiedSTDIODesktop onlyDeveloper ToolsSecurity & Monitoring

Overview

AI-generated overview

Read-only MCP server that lets an assistant query local systemd journal logs, filtering by time range, unit, syslog identifier and message text.

What you can do
  • List systemd units and syslog identifiers found in the journal, optionally within a time range
  • Get the datetime of the first journal entry
  • Fetch journal entries filtered by since/until, unit, identifier and case-insensitive message substring, with a limit
  • Get recent logs from the last N minutes for a unit
  • Accept natural-language datetimes such as "2 hours ago" or "yesterday at 3pm", interpreted as UTC
When to use it
Useful for incident forensics and troubleshooting on a Linux machine: having the assistant pull recent service logs, narrow them to a time window or unit, and search messages for errors without manual journalctl commands.
Requirements
Runs locally as a Python 3.12+ process (PyPI package journald-mcp-server, or uv sync and server.py), with systemd-python for journal access. The user should be in the systemd-journal group to read logs without root. Default transport is stdio; sse and streamable-http are optional.
Before you install
Journal logs can contain sensitive system and application data, including secrets or personal information, which is passed to the assistant and its model provider. Access is read-only, but the server should be run with the least privilege needed (systemd-journal group rather than root). HTTP transports expose the log data on a listening port.

Installation

In SourceWeft

  1. Open Journald MCP Server in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

Journald MCP Server

An MCP server for accessing systemd journal logs.

Features

  • List systemd units from journal logs
  • List syslog identifiers from journal logs
  • Get datetime of first journal entry
  • Filter journal entries by datetime range (since/until)
  • Filter by systemd unit or syslog identifier
  • Filter by message content (case-insensitive substring matching)
  • Natural language datetime parsing (e.g., "2 hours ago", "yesterday at 3pm")
  • List units and identifiers within specific time ranges

Installation

bash
# Install dependenciesuv sync

Usage

Run as non-root: Give the user systemd-journal group access usermod -aG systemd-journal $USER

Run the server with:

bash
uv run server.py [OPTIONS]

CLI Options

  • --transport: Transport protocol to use (stdio, sse, or streamable-http). Default: stdio
  • --port: Port to listen on for HTTP transport (ignored for stdio transport). Default: 3002
  • --log-level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default: INFO

Examples

  1. Run with stdio transport (default, for MCP clients that communicate via stdin/stdout):

    bash
    python server.py
  2. Run with HTTP transport on custom port:

    bash
    python server.py --transport streamable-http --port 8080
  3. Run with SSE transport:

    bash
    python server.py --transport sse --port 3000
  4. Run with debug logging:

    bash
    python server.py --log-level DEBUG

MCP Integration

The server provides the following MCP resources and tools:

Resources

  • journal://units: List unique systemd units from journal logs (all accessible time)
  • journal://syslog-identifiers: List unique syslog identifiers from journal logs (all accessible time)
  • journal://first-entry-datetime: Get the datetime of the first entry in the journal
  • journal://units/{since}/{until}: List unique systemd units within a specified time range
  • journal://syslog-identifiers/{since}/{until}: List unique syslog identifiers within a specified time range

Tools

  • get_journal_entries: Get journal entries with datetime filtering

    • Parameters: since (optional), until (optional), unit (optional), identifier (optional), message_contains (optional), limit (default: 100)
    • Returns: List of entries with timestamp, unit, identifier, and message
    • Example: Get logs from last 2 hours containing "error": since="2 hours ago", message_contains="error"
  • get_recent_logs: Get recent journal logs from the last N minutes

    • Parameters: minutes (default: 60), unit (optional), limit (default: 50)
    • Returns: Formatted string of recent log messages

Datetime Input Format

The server uses natural language datetime parsing via the dateparser library. Supported formats include:

  • Relative times: "2 hours ago", "yesterday at 3pm", "last week", "now"
  • Absolute times: "2024-01-15 14:30", "2024-01-15T14:30:00"
  • Mixed: "today at 9am", "tomorrow 3pm"

All times are interpreted as UTC and returned in human-readable format: "YYYY-MM-DD HH:MM:SS UTC"

Development

This project uses:

  • Python 3.12+
  • MCP FastMCP
  • systemd-python for journal access
  • Click for CLI interface
  • dateparser for natural language datetime parsing

Project Structure

journald-mcp-server/├── journald_mcp_server/     # Main package│   ├── __init__.py│   ├── server.py           # MCP server implementation│   └── datetime_utils.py   # Datetime parsing and formatting utilities├── tests/                  # Test suite│   ├── __init__.py│   └── test_server.py├── server.py              # Entry point wrapper├── pyproject.toml└── README.md

Running Tests

bash
python -m pytest tests/

Source: README.md at commit d9843ed

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.