Log Intelligence MCP Server
Ingests logs from Elasticsearch, either from JSON dumps, full ES responses or NDJSON files, or from live queries against an Elasticsearch endpoint with a chosen index, filter query and result limit. Supports API-key or username/password authentication, sorts results by a configurable timestamp field and returns per-document log entries for clustering, search and anomaly analysis.
Reads log entries from SQLite database files and debug log tables, mapping columns by convention (Timestamp/created_at, Level/severity, Message/msg, Exception/error) with an optional SQL filter, and turning any remaining columns into searchable structured properties for fingerprinting, grouping and timeline analysis.
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., "@Log Intelligence MCP Server Ingest my Serilog logs and summarize errors since yesterday's deployment"
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.
Log Intelligence MCP Server
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
structuredContentwith 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-mcpQuick Start (from source)
npm install
npm run build
npm start # stdio transport for MCP clientslog-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 helpMCP Client Configuration
Cursor (recommended: npx)
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 |
| Load logs from a source (serilog, elastic, sql, flatfile). Re-ingesting a source name replaces it unless |
| Ingested sources with entry/error counts and time ranges |
| Remove one source, or everything |
| Cluster and summarise error-level entries |
| Find errors in a comparison window absent from a baseline window |
| Compare error patterns before/after a deployment |
| Substring or regex search across messages and exceptions, filterable by level, source, fingerprint and time |
| Entries immediately before and after a timestamp, across all levels |
| Count entries by a structured property (or |
| 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 |
| List all ingested log sources with entry counts |
| Overall stats: total entries, error count, unique patterns |
| Details and sample entries for one error cluster (fingerprints autocomplete) |
Prompts
Prompt | Description |
| Guided workflow: ingest, summarise, detect anomalies, inspect context |
| Deep dive into a specific error pattern |
| 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 outagewebserver.log-- Flat file format with Java stack traceselastic-dump.json-- Elasticsearch JSON dumplog-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 toolsclear_logsClear logsADestructiveIdempotent
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 patternsARead-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 timelineBRead-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 contextARead-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 propertyARead-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 logsAIdempotent
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 sourcesARead-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 deploymentARead-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 logsARead-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 errorsARead-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
Scored across 10 tools
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.
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.
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.
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
Related MCP Connectors
Exception tracking for .NET. Let your AI coding agent search and triage errors and stack traces.
Production errors your coding agent can read: search, stack traces, releases, resolve, setup.
Investigate errors, track deployments, analyze performance, and manage application monitoring
Search logs, investigate errors, check deployments, and monitor uptime for your elmah.io org.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables 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.-
- FlicenseBqualityDmaintenanceProvides tools to analyze test failures, cluster similar failures, and detect flaky tests from input or log files, helping QA teams debug and triage issues.3-
- AlicenseNot gradedqualityDmaintenanceEnables AI to automatically diagnose bugs by querying logs, tracing call chains, and analyzing code across multiple log platforms like Elasticsearch and Loki.MIT
- AlicenseNot gradedqualityFmaintenanceEnables LLMs to analyze logs by extracting patterns, redacting secrets, and providing token-efficient summaries from files, Docker containers, or journald.5MIT