Skip to main content

Universal MCP server for application log intelligence across Datadog, Grafana Loki, AWS CloudWatch, and local files.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logintel_mcp-1.0.0.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logintel_mcp-1.0.0-py3-none-any.whl (45.5 kB view details)

Uploaded Python 3

File details

Details for the file logintel_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: logintel_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Linux/6.17.0-1013-azure

File hashes

Hashes for logintel_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3f03fe59fa7f48d1605d30c9882a5d7c2e46cbfbc601010011aedcb87558b813
MD5 eb050a967301b5f7635f5381cdccb71e
BLAKE2b-256 74cfe6d0470a28ad5c3fca88510ffe7e863599673c4ac51418ef1b61a2322840

See more details on using hashes here.

File details

Details for the file logintel_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: logintel_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 45.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Linux/6.17.0-1013-azure

File hashes

Hashes for logintel_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4530adc8165da1b6121530dd98706f1aab63b67c100364b6ef5b1dfb572d60d7
MD5 09a1ecc21d1db1cf9bf41698e2cdba91
BLAKE2b-256 b1d748ef2a7240c0636a7d3fc9b5cb628e065695a24f49421c3149d647c5ce53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page