Skip to main content

LogIntel MCP Server

Python 3.11+ Poetry License: MIT Tests

Universal Model Context Protocol (MCP) server that connects LLMs to application logs across Datadog, Grafana Loki, AWS CloudWatch, and local log files.

Ask your AI assistant questions like:

  • "Why did orders spike at 2 AM?"
  • "Find all timeout errors in the payment service from last hour"
  • "Correlate 500 errors across api, payment, and db services"
  • "Compare error rates before and after the deployment at 3 PM"

Features

  • 🔌 Multi-backend support — Datadog, Grafana Loki, AWS CloudWatch, local files
  • 🔍 Natural language queries — Ask in plain English, get structured results
  • 📁 Local file provider — Search, filter, tail, and aggregate JSON/regex/plain-text logs
  • ☁️ CloudWatch provider — Query AWS CloudWatch Logs Insights with natural language
  • 📊 Datadog provider — Search and aggregate via Datadog Logs v2 API
  • 🔥 Loki provider — Query Grafana Loki with LogQL label matchers and metric queries
  • 🧠 Intelligent analysis — Root cause analysis, cross-service correlation, anomaly detection
  • 🔗 Cross-service correlation — Trace ID, timestamp proximity, and field matching
  • ⚡ Caching & pagination — TTL cache for repeated queries; cursor-based pagination
  • 🛡️ Read-only by default — Safe to use in production; no log mutation

MCP Tools

Tool Description
list_log_sources List all configured log sources
get_source_health Check connectivity of a source
get_source_schema Get field/schema info for a source
search_logs Search logs with natural language or query
filter_logs Filter by time, level, service, host, custom fields
tail_logs Return latest N entries from a source
aggregate_logs Count/group by field, time bucketing
summarize_logs Generate natural language summary
correlate_logs Cross-source correlation by trace_id or timestamp
analyze_root_cause Multi-step incident root cause analysis
compare_time_periods Before/after comparison with diff report
detect_error_patterns Detect recurring error patterns
find_anomalies Statistical anomaly detection
natural_language_to_query Translate NL to provider query syntax
explain_query Explain a provider-native query in plain English

MCP Prompts

Prompt Description
investigate_incident Structured 6-step SRE investigation workflow
oncall_summary Generate a concise shift summary

Quick Start

Installation

PyPI (recommended)

pip install logintel-mcp

# Or with uv
uv pip install logintel-mcp
uvx -y logintel-mcp --config ~/.logintelrc.yaml

npm (wrapper)

npx -y logintel-mcp-server --config ~/.logintelrc.yaml

Docker (GHCR)

docker run --rm -v "$HOME/.logintelrc.yaml:/etc/logintel/.logintelrc.yaml" \
  ghcr.io/firas-mcp-servers/logintel-mcp-server:latest

From source

git clone https://github.com/firas-mcp-servers/logintel-mcp-server.git
cd logintel-mcp-server
poetry install

Configuration

Create a .logintelrc.yaml file:

sources:
  datadog-prod:
    type: datadog
    apiKey: "${DATADOG_API_KEY}"
    appKey: "${DATADOG_APP_KEY}"
    site: "datadoghq.com"
    defaultIndexes: ["main", "prod"]

  loki-default:
    type: loki
    url: "http://localhost:3100"
    defaultLabels:
      app: "api"

  cloudwatch-app:
    type: cloudwatch
    region: "us-east-1"
    profile: "production"
    logGroups:
      - "/aws/lambda/my-app"

  local-app:
    type: local
    paths:
      - "/var/log/myapp/*.log"
    parseJson: true
    timestampField: "timestamp"
    levelField: "level"
    serviceField: "service"

defaults:
  timeRange: "1h"
  maxResults: 100
  timezone: "UTC"

intelligence:
  enableCaching: true
  cacheTtlSeconds: 60
  anomalySensitivity: "medium"
  maxCorrelationDepth: 3

Run the Server

# stdio transport (default)
logintel-mcp --config ~/.logintelrc.yaml

# Or via Python module
python -m logintel --config ~/.logintelrc.yaml

Claude Desktop Integration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "log-intel": {
      "command": "uvx",
      "args": ["-y", "logintel-mcp", "--config", "/path/to/.logintelrc.yaml"]
    }
  }
}

Or with Docker:

{
  "mcpServers": {
    "log-intel": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-v", "/path/to/.logintelrc.yaml:/etc/logintel/.logintelrc.yaml",
        "ghcr.io/firas-mcp-servers/logintel-mcp-server:latest"
      ]
    }
  }
}

Cursor Integration

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "log-intel": {
      "command": "npx",
      "args": ["-y", "logintel-mcp-server", "--config", "./.logintelrc.yaml"]
    }
  }
}

Development

# Install dependencies
poetry install --with dev

# Run tests (100% coverage gate)
poetry run pytest --cov=src/logintel --cov-fail-under=100

# Or use the convenience tasks
poetry run poe test       # full suite with coverage
poetry run poe test-fast  # quick run without coverage
poetry run poe lint       # ruff check
poetry run poe fix        # ruff check --fix + ruff format
poetry run poe check      # lint + test combo

# Run MCP Inspector for manual testing
poetry run python -m logintel --config ./examples/config.yaml
# In another terminal:
npx -y @modelcontextprotocol/inspector

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    MCP Host (Claude/Cursor/etc.)            │
│                         ┌─────────┐                         │
│                         │  LLM    │                         │
│                         └────┬────┘                         │
│                              │ MCP Protocol (JSON-RPC)      │
└──────────────────────────────┼───────────────────────────────┘
                               │
                    ┌──────────▼──────────┐
                    │  LogIntel MCP Server │
                    │   (this project)     │
                    └──────────┬──────────┘
                               │
         ┌─────────────────────┼─────────────────────┐
         │                     │                     │
   ┌─────▼─────┐       ┌──────▼──────┐     ┌───────▼───────┐
   │  Datadog  │       │Grafana Loki │     │AWS CloudWatch │
   │   APIs    │       │  HTTP API   │     │  Logs Insights│
   └───────────┘       └─────────────┘     └───────────────┘
         │                     │                     │
         └─────────────────────┼─────────────────────┘
                               │
                        ┌──────▼──────┐
                        │ Local Files │
                        │  (fs/grep)  │
                        └─────────────┘

Roadmap

Phase Focus Status
0 Foundation — scaffolding, config, health checks ✅ Complete
1 Local File Provider ✅ Complete
2 CloudWatch Provider ✅ Complete
3 Datadog Provider ✅ Complete
4 Loki Provider ✅ Complete
5 Intelligence Layer — root cause, correlation, caching ✅ Complete
6 Polish — Docker, PyPI, npm, CI/CD, docs ✅ Complete

License

MIT

Metadata

Release files for logintel-mcp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logintel-mcp 1.0.1
File Size Uploaded Provenance Actions
logintel_mcp-1.0.1.tar.gz 35.6 kB Without provenance Details for logintel_mcp-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for logintel-mcp 1.0.1
File Interpreter ABI Platform Actions
logintel_mcp-1.0.1-py3-none-any.whl Python 3 none any Details for logintel_mcp-1.0.1-py3-none-any.whl

Total release size: 81.2 kB

Release files / logintel_mcp-1.0.1.tar.gz

Download URL logintel_mcp-1.0.1.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
19633628d3383ed7d910cc5a420a7b904edf927fd339419bcad2df16f083d8d6
BLAKE2b-256 checksum
How to use checksums
20acee1935d6135cc859196229023d594dbfab7cf015d776b787856c93a15ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.5 Linux/6.17.0-1013-azure

Release files / logintel_mcp-1.0.1-py3-none-any.whl

Download URL logintel_mcp-1.0.1-py3-none-any.whl
Size 45.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
910df7fdaf1c4e287adde617e48c0018dd910664dd50a13c0f2d17ae26259b78
BLAKE2b-256 checksum
How to use checksums
5940f279a97006bd6765d195e15c4028c6c71d50a98681ff082b26c88a42453b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.5 Linux/6.17.0-1013-azure

Security for logintel-mcp 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page