logzio-mcp-server

jklnr/logzio-mcp-server

3.2

If you are the rightful owner of logzio-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

MCP Server for Logz.io enables AI assistants to interact with Logz.io's log management platform through natural language.

Tools
  1. search_logs

    Search through logs with simple queries and filters.

  2. query_logs

    Execute advanced Lucene queries for precise log analysis.

  3. get_log_stats

    Retrieve aggregated log statistics and metrics.

MCP Server for Logz.io

License: MIT Node.js Version TypeScript

An unofficial* Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Logz.io's log management platform. Includes tools for simple log search, Lucene query search, and fetching basic statistics from logz io.

*I'll be a little surprised if logz io makes an official MCP server. Instead, they seem to be leaning heavily into integrating AI directly into their tooling, which makes sense, but doesn't give the user much flexibility over models or integration with external tools.. which is why this project exists.

šŸš€ Quick Start

Add this to your Claude/Cursor/etc configuration file:

{
  "mcpServers": {
    
    # other servers ...
    
    "logzio": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-logzio", 
        "apiKey", "YOUR_LOGZIO_API_KEY"
      ]
    }
  }
}

US is the default region. For other regions:

{
  "mcpServers": {
    
    # other servers ...
    
    "logzio": {
      "command": "npx", 
      "args": [
        "-y",
        "mcp-server-logzio",
        "apiKey", "YOUR_LOGZIO_API_KEY",
        "region", "eu" # add this for example
      ]
    }
  }
}

šŸ› ļø Advanced Configuration

Command Line Arguments

ArgumentDescriptionDefaultRequired
apiKey <key>Your Logz.io API key-Yes
region <region>Logz.io region (us, us-west, eu, ca, au, uk)usNo
logzioUrl <url>Custom Logz.io API URL (overrides region)-No
--timeout <ms>Request timeout30000No
--retry-attempts <num>Retry attempts3No
--max-results <num>Max results per query1000No

Supported Regions

The server automatically maps region codes to the correct Logz.io API endpoints:

Region CodeDescriptionAPI Endpoint
usUS East (default)https://api.logz.io
us-westUS Westhttps://api-wa.logz.io
euEuropehttps://api-eu.logz.io
caCanadahttps://api-ca.logz.io
auAustraliahttps://api-au.logz.io
ukUnited Kingdomhttps://api-uk.logz.io

Finding Your Region: Log into your Logz.io account and check the URL in your browser:

  • https://app.logz.io → use region us
  • https://app-eu.logz.io → use region eu
  • https://app-ca.logz.io → use region ca
  • etc.

šŸ”§ Available Tools

These are the tools your agent will see.

search_logs

Search through logs with simple queries and filters.

Parameters:

  • query (required): Search query string
  • timeRange: Time range (1h, 6h, 12h, 24h, 3d, 7d, 30d)
  • from/to: Custom time range (ISO 8601)
  • logType: Filter by log type
  • severity: Filter by severity level
  • limit: Maximum results (1-1000)
  • sort: Sort order (asc/desc)

query_logs

For more advanced search using Lucene queries

Parameters:

  • luceneQuery (required): Lucene query string
  • from/to: Time range (ISO 8601)
  • size: Maximum results (1-1000)
  • sort: Sort order (asc/desc)

get_log_stats

Retrieve aggregated log statistics and metrics.

Parameters:

  • timeRange: Time range (1h, 6h, 12h, 24h, 3d, 7d, 30d)
  • from/to: Custom time range (ISO 8601)
  • groupBy: Fields to group by

šŸ—ļø Development, if you want to mess with the code

Prerequisites

  • Node.js 18+
  • TypeScript 5.8+
  • Valid Logz.io account and API key

Setup

# Clone the repository
git clone https://github.com/modelcontextprotocol/mcp-server-logzio.git
cd mcp-server-logzio

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run in development mode
npm run dev

Scripts

  • npm run build - Compile TypeScript
  • npm run dev - Run in development mode
  • npm test - Run test suite
  • npm run format - Format code with Prettier
  • npm run type-check - Type check without emission

šŸ“ Project Structure

mcp-server-logzio/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ api/           # Logz.io API client and types
│   ā”œā”€ā”€ tools/         # MCP tool implementations
│   ā”œā”€ā”€ utils/         # Utilities (logging, errors)
│   ā”œā”€ā”€ config.ts      # Configuration management
│   ā”œā”€ā”€ server.ts      # MCP server implementation
│   └── index.ts       # Entry point
ā”œā”€ā”€ tests/             # Test suites
ā”œā”€ā”€ examples/          # Usage examples
ā”œā”€ā”€ docs/              # Documentation
└── dist/              # Compiled output