Skip to main content
Glama
Log Intelligence MCP Server

Log Intelligence MCP Server

by eamonboyle

Log Intelligence MCP Server

Add to Cursor Install in VS Code

An AI-powered log analysis server built on the Model Context Protocol (MCP). It ingests structured logs from multiple sources, detects anomalies, clusters similar errors, summarises recurring failures, and identifies regressions after deployments.

Features

  • Multi-source ingestion -- Serilog JSON/CLEF, Elasticsearch dumps or live endpoints, SQLite databases, plain text log files

  • Error fingerprinting -- Normalises variable data (ids, numbers, paths, emails, …) and clusters similar error messages

  • Anomaly detection -- Statistical spike detection using z-score analysis on time-bucketed error rates

  • Regression detection -- Compares error patterns before/after a deployment date

  • Context and search -- Substring or regex search, and the entries surrounding any point in time

  • Property breakdowns -- Count errors by any structured property (application, host, status code, …)

  • Timeline visualisation -- Error frequency bucketed over time with ASCII bar charts

  • Structured output -- Every tool returns both readable text and JSON structuredContent with a published schema

Requires Node.js 22 or newer.

Related MCP server: MCP Test Failure Analysis Server

Install

# From npm (recommended)
npm install -g log-intelligence-mcp

# Or run without installing
npx log-intelligence-mcp

Quick Start (from source)

npm install
npm run build
npm start          # stdio transport for MCP clients
log-intelligence-mcp [options]

  -c, --config <path>  Config file (default: ./log-intelligence.config.json, or $LOG_INTELLIGENCE_CONFIG)
  -v, --version        Print the version and exit
  -h, --help           Show help

MCP Client Configuration

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "log-intelligence": {
      "command": "npx",
      "args": ["-y", "log-intelligence-mcp"]
    }
  }
}

Cursor (global install)

{
  "mcpServers": {
    "log-intelligence": {
      "command": "log-intelligence-mcp",
      "args": ["--config", "/path/to/log-intelligence.config.json"]
    }
  }
}

Cursor (local development)

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

Claude Desktop / Claude Code

Add to claude_desktop_config.json, or run claude mcp add log-intelligence -- npx -y log-intelligence-mcp:

{
  "mcpServers": {
    "log-intelligence": {
      "command": "npx",
      "args": ["-y", "log-intelligence-mcp"],
      "env": { "LOG_INTELLIGENCE_CONFIG": "/path/to/log-intelligence.config.json" }
    }
  }
}

Tools

Tool

Description

ingest_logs

Load logs from a source (serilog, elastic, sql, flatfile). Re-ingesting a source name replaces it unless mode: "append"

list_sources

Ingested sources with entry/error counts and time ranges

clear_logs

Remove one source, or everything

summarise_errors

Cluster and summarise error-level entries

detect_new_error_pattern

Find errors in a comparison window absent from a baseline window

regression_after_date

Compare error patterns before/after a deployment

search_logs

Substring or regex search across messages and exceptions, filterable by level, source, fingerprint and time

get_log_context

Entries immediately before and after a timestamp, across all levels

group_by_property

Count entries by a structured property (or level, source, fingerprint)

get_error_timeline

Error frequency over time with optional anomaly detection

All tools accept ISO 8601 dates and return structuredContent matching their advertised outputSchema, so clients can work with the data directly rather than parsing text.

Resources

URI

Description

logs://sources

List all ingested log sources with entry counts

logs://summary

Overall stats: total entries, error count, unique patterns

logs://cluster/{fingerprint}

Details and sample entries for one error cluster (fingerprints autocomplete)

Prompts

Prompt

Description

analyse-logs

Guided workflow: ingest, summarise, detect anomalies, inspect context

investigate-error

Deep dive into a specific error pattern

review-deployment

Go/no-go review of a deployment using regression detection

Log Sources

Serilog JSON (.clef)

Reads Compact Log Event Format files -- one JSON object per line with @t, @l, @mt, @m, @x fields -- and classic Serilog JSON (Timestamp, Level, RenderedMessage, Properties). When only a message template is present it is rendered from the event properties for display, and the template itself is used for clustering. Files are streamed, so large logs are fine.

ingest_logs(source="serilog", path="./logs/app.clef")

Elasticsearch

Accepts a JSON array of _source documents, a full ES response (hits.hits[]._source), or NDJSON. Field names follow common conventions including ECS (@timestamp, log.level, message, error.stack_trace); nested objects and dotted keys both work, and numeric levels (pino, syslog) are understood.

# File dump
ingest_logs(source="elastic", path="./dumps/errors.json")

# Live query
ingest_logs(source="elastic", endpoint="http://localhost:9200", index="app-logs", filter="level:error", limit=5000)

Live queries authenticate with apiKey in the config file or the ELASTIC_API_KEY environment variable, or with ELASTIC_USERNAME and ELASTIC_PASSWORD. Credentials are only sent to endpoints the operator chose: an elastic source in the config file, or the URL in ELASTIC_URL. An ingest_logs call naming any other endpoint is sent without credentials, so a model (or text in the logs it reads) cannot redirect them to another host. A warning is returned when credentials go over plain http:// to a non-loopback host. Results are sorted by timestampField (default @timestamp) and capped at 10 000 documents; a warning is returned when more matched.

SQLite Debug Tables

Reads from SQLite database files. Columns are mapped by convention (Timestamp/created_at, Level/severity, Message/msg, Exception/error); other columns become properties.

ingest_logs(source="sql", path="./debug.db", table="Logs", filter="Level = 'Error'")

Flat Files

Parses 2026-02-10T07:10:00Z [ERROR] message and 2026-02-10 07:10:00,123 ERROR message styles plus Apache/Nginx combined access logs (status ≥ 500 becomes an error, ≥ 400 a warning). Lines that do not start a new entry -- stack frames, Caused by: lines, wrapped text -- are attached to the previous entry as its exception. Files are streamed.

ingest_logs(source="flatfile", path="./logs/app.log")

# Custom format via regex with named groups
ingest_logs(source="flatfile", path="./app.log", pattern="^level=(?<level>\\w+) ts=(?<timestamp>\\S+) msg=(?<message>.*)$")

Configuration

Optionally create a log-intelligence.config.json to pre-configure sources. It is looked for in the working directory, or at the path given by --config / LOG_INTELLIGENCE_CONFIG. Relative paths are resolved against the config file's own directory, so it works regardless of where the MCP client launches the server from.

{
  "sources": [
    { "name": "app-logs", "type": "serilog", "path": "./logs/app.clef" },
    { "name": "db-errors", "type": "sql", "path": "./debug.db", "table": "Logs", "filter": "Level = 'Error'" },
    { "name": "prod-es", "type": "elastic", "endpoint": "https://es.internal:9200", "index": "app-*", "filter": "log.level:error", "limit": 5000 }
  ],
  "defaults": {
    "bucketMinutes": 60,
    "anomalyThreshold": 2.0,
    "maxSamples": 3
  }
}

Pre-configured sources are ingested when the server starts. Problems with the file are reported on stderr instead of being silently ignored.

How It Works

Error Fingerprinting

Messages are normalised by replacing variable tokens -- timestamps, URLs, email addresses, IPs, UUIDs, file paths, quoted strings, and any word containing a digit (30ms, db2, abc123def456) -- then collapsed and SHA-256 hashed to a 16-character fingerprint. The first line of the exception, if any, is included. Entries sharing a fingerprint form an error cluster.

Anomaly Detection

Error entries are bucketed into time windows. The baseline mean and standard deviation are computed, and buckets where count > mean + threshold * stddev are flagged as anomalous. Each bucket gets a z-score for ranking.

Regression Detection

Given a deployment date, the detector splits logs into before/after windows, clusters errors independently in each, then performs a set-diff to identify:

  • New errors -- appeared only after deployment

  • Increased errors -- existed before but the hourly rate grew by more than increaseFactor (default 2×)

  • Resolved errors -- disappeared after deployment

Sample Data

The samples/ directory contains example log files for testing:

  • app.clef -- Serilog CLEF format with a simulated deployment at 09:05 followed by a Redis outage

  • webserver.log -- Flat file format with Java stack traces

  • elastic-dump.json -- Elasticsearch JSON dump

  • log-intelligence.config.json -- Config to auto-ingest all samples

The repository root already contains a config pointing at the samples, so npm start from a source checkout serves them immediately. Try regression_after_date with deploymentDate="2026-02-10T09:05:00Z", hoursBefore=2, hoursAfter=2.

Development

npm run dev         # run from source with tsx
npm run typecheck   # tsc --noEmit over src and tests
npm test            # node:test suite (engine, adapters, config, end-to-end MCP client)
npm run build       # emit dist/

The end-to-end tests drive the server through the SDK's in-memory transport with a real MCP client, so tool schemas, structured output and resource templates are exercised exactly as a client would see them.

License

MIT

Available Tools

10 tools
clear_logsClear logsA
DestructiveIdempotent

Remove ingested log entries from memory: a single source by name, or everything when no source is given.

Inputs: source. Returns: removed, remaining

detect_new_error_patternDetect new error patternsA
Read-onlyIdempotent

Find error patterns present in a comparison window that never occurred in a baseline window. Useful for spotting novel failures after a change.

Inputs: baselineEnd (required), baselineStart (required), comparisonEnd (required), comparisonStart (required), +1 more. Returns: newPatterns, baselineErrors, comparisonErrors

get_error_timelineError timelineB
Read-onlyIdempotent

Error frequency bucketed over time as an ASCII chart, optionally with z-score spike detection.

Inputs: source, endDate, startDate, fingerprint, +3 more. Returns: buckets, anomalies, totalErrors, bucketMinutes

get_log_contextLog contextA
Read-onlyIdempotent

Show the log entries immediately before and after a point in time, across all levels. Use it to see what led up to an error and what happened next.

Inputs: timestamp (required), after, before, source, +1 more. Returns: after, before, timestamp

group_by_propertyGroup by propertyA
Read-onlyIdempotent

Count log entries by the value of a structured property (e.g. Application, StatusCode, user.id). Use level, source or fingerprint as pseudo-properties. Defaults to error/fatal entries only.

Inputs: property (required), topN, level, source, +3 more. Returns: total, groups, missing, property, +1 more

ingest_logsIngest logsA
Idempotent

Ingest log entries from a data source (Serilog CLEF/JSON, Elasticsearch dump or live endpoint, SQLite database, or flat text file). Re-ingesting a source with the same name replaces its previous entries unless mode is "append".

Inputs: source (required), mode, name, path, +6 more. Returns: type, errors, source, skipped, +4 more

list_sourcesList sourcesA
Read-onlyIdempotent

List all ingested log sources with entry counts, error counts and time ranges.

Inputs: no named parameters. Returns: sources, totalEntries

regression_after_dateRegression after deploymentA
Read-onlyIdempotent

Compare error patterns before and after a deployment date. Reports new errors, errors whose hourly rate increased, and errors that disappeared.

Inputs: deploymentDate (required), source, hoursAfter, hoursBefore, +1 more. Returns: summary, newErrors, afterWindow, beforeWindow, +3 more

search_logsSearch logsA
Read-onlyIdempotent

Search message and exception text across all ingested entries. Case-insensitive substring match by default, or a regular expression.

Inputs: query (required), level, limit, regex, +4 more. Returns: query, total, entries, returned

summarise_errorsSummarise errorsA
Read-onlyIdempotent

Cluster error- and fatal-level entries by normalised message and list the top patterns with counts, time spans, sources and sample messages.

Inputs: topN, source, endDate, minCount, +1 more. Returns: clusters, truncated, totalErrors, uniquePatterns

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (ingest vs search vs context vs timeline vs grouping). The main overlap is between detect_new_error_pattern and regression_after_date, which both compare error patterns across two time windows and could easily be confused. The rest are distinguishable from descriptions.

    Naming Consistency4/5

    Nine of ten tools follow a verb_noun snake_case pattern (ingest_logs, list_sources, summarise_errors, etc.). The outlier is regression_after_date, which starts with a noun rather than a verb, slightly breaking the consistent verb-first convention.

    Tool Count5/5

    Ten tools is a well-scoped size for a log intelligence server, covering ingestion, source management, search, context, and several error-analysis angles without bloat. Each tool appears to earn its place.

    Completeness4/5

    The surface covers ingestion, listing, clearing, searching, context retrieval, and multiple error-analysis workflows, which is strong lifecycle coverage. Minor gaps exist, such as no explicit scoped search by source/time or export/raw-entry pagination, but core log intelligence workflows are well supported.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI-powered debugging through structured logging with pattern recognition and intelligent analysis. Allows applications to write structured logs and receive actionable debugging insights based on error patterns and frequency analysis.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI to automatically diagnose bugs by querying logs, tracing call chains, and analyzing code across multiple log platforms like Elasticsearch and Loki.
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables LLMs to analyze logs by extracting patterns, redacting secrets, and providing token-efficient summaries from files, Docker containers, or journald.
      5
      MIT