Simple Loki MCP Server

Seamlessly connect your AI agents to Grafana Loki for advanced log analysis and monitoring with the Simple Loki MCP Server.

Simple Loki MCP Server

What does “Simple Loki” MCP Server do?

The Simple Loki MCP Server is a Model Context Protocol (MCP) interface that enables AI assistants to directly query and analyze logs from a Grafana Loki instance. By using tools like logcli or falling back to the Loki HTTP API, this server allows seamless integration of log data into development workflows. It supports full LogQL querying, label value retrieval, and provides formatted results in several output options (default, raw, JSON lines). With its flexible authentication and configuration via environment variables or config files, Simple Loki MCP Server is ideal for enhancing observability, troubleshooting, and monitoring tasks within AI-powered applications or automation flows.

List of Prompts

No explicit prompt templates are mentioned in the repository or documentation.

List of Resources

No explicit MCP resources are listed in the repository or documentation.

List of Tools

  • query-loki
    Query logs from Loki with filtering options. This tool allows users to submit LogQL queries and retrieve log entries, supporting various output formats and label metadata access.

Use Cases of this MCP Server

  • Log Analysis and Troubleshooting
    Developers can use Simple Loki MCP Server to analyze and filter log data from Grafana Loki, making it easier to debug applications and investigate issues.
  • Automated Incident Response
    AI assistants can automatically fetch and summarize relevant logs during incident workflows, improving response time and accuracy.
  • Observability Dashboards
    Integrate log querying capabilities into custom dashboards, enabling real-time log insights directly within development or monitoring tools.
  • Security Monitoring
    Use AI agents to monitor logs for suspicious patterns or activities, triggering alerts or automated actions when anomalies are detected.
  • Performance Optimization
    Analyze historical log data to identify bottlenecks, errors, or trends that impact system performance, assisting in proactive optimization.

How to set it up

Windsurf

  1. Ensure Node.js v16+ is installed.
  2. Edit your Windsurf configuration file (e.g., settings.json).
  3. Add the Simple Loki MCP Server to the mcpServers section:
    {
      "mcpServers": {
        "simple-loki": {
          "command": "npx",
          "args": ["-y", "simple-loki-mcp"],
          "env": {
            "LOKI_ADDR": "https://loki.sup.band"
          }
        }
      }
    }
    
  4. Save and restart Windsurf.
  5. Verify the server is running by checking for log querying capabilities.

Claude

  1. Install Node.js v16+.
  2. Use Smithery to install the server:
    npx -y @smithery/cli install @ghrud92/simple-loki-mcp --client claude
    
  3. Add/update your Claude configuration as follows:
    {
      "mcpServers": {
        "simple-loki": {
          "command": "npx",
          "args": ["-y", "simple-loki-mcp"],
          "env": {
            "LOKI_ADDR": "https://loki.sup.band"
          }
        }
      }
    }
    
  4. Save and restart Claude.
  5. Confirm Loki log querying is available.

Cursor

  1. Confirm Node.js v16+ is installed.
  2. Open Cursor’s configuration file.
  3. Insert the following under mcpServers:
    {
      "mcpServers": {
        "simple-loki": {
          "command": "npx",
          "args": ["-y", "simple-loki-mcp"],
          "env": {
            "LOKI_ADDR": "https://loki.sup.band"
          }
        }
      }
    }
    
  4. Save changes and restart Cursor.
  5. Test log querying functionality.

Cline

  1. Make sure Node.js v16+ is available.
  2. Locate and open Cline’s configuration file.
  3. Add Simple Loki MCP entry:
    {
      "mcpServers": {
        "simple-loki": {
          "command": "npx",
          "args": ["-y", "simple-loki-mcp"],
          "env": {
            "LOKI_ADDR": "https://loki.sup.band"
          }
        }
      }
    }
    
  4. Save and restart Cline.
  5. Check for successful log query integration.

Securing API Keys

Store sensitive credentials (like LOKI_ADDR or tokens) in environment variables for security. Example:

{
  "mcpServers": {
    "simple-loki": {
      "command": "npx",
      "args": ["-y", "simple-loki-mcp"],
      "env": {
        "LOKI_ADDR": "${LOKI_ADDR_ENV}",
        "LOKI_TOKEN": "${LOKI_TOKEN_ENV}"
      },
      "inputs": {
        "query": "${YOUR_LOGQL_QUERY}"
      }
    }
  }
}

How to use this MCP inside flows

Using MCP in FlowHunt

To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

FlowHunt MCP flow

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:

{
  "simple-loki": {
    "transport": "streamable_http",
    "url": "https://yourmcpserver.example/pathtothemcp/url"
  }
}

Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change “simple-loki” to whatever the actual name of your MCP server is and replace the URL with your own MCP server URL.


Overview

SectionAvailabilityDetails/Notes
OverviewDescribes Loki log querying via MCP
List of PromptsNone provided
List of ResourcesNone specified
List of Toolsquery-loki tool described
Securing API KeysMentioned in setup instructions
Sampling Support (less important in evaluation)Not mentioned

Based on the above tables, the Simple Loki MCP Server is focused and functional but lacks breadth in prompt and resource support. It is easy to set up and has clear documentation for integration and API key security. Overall, it is practical for log querying but limited in advanced MCP capabilities.


MCP Score

Has a LICENSEYes (MIT)
Has at least one toolYes
Number of Forks3
Number of Stars2

Rating:
I would rate this MCP server 6/10. It is solid for its purpose and easy to integrate, but lacks multi-tool variety, prompt templates, and explicit resource definitions which are essential for broader MCP use. It does not mention Roots or Sampling support.

Frequently asked questions

What does the Simple Loki MCP Server do?

It provides an MCP interface for querying and analyzing logs from Grafana Loki within AI-powered workflows, supporting LogQL queries, label retrieval, and multiple output formats.

What are the main use cases?

Log analysis, automated incident response, observability dashboards, security monitoring, and performance optimization for systems using Grafana Loki.

How do I secure my credentials?

Store sensitive information such as LOKI_ADDR or authentication tokens in environment variables. Example: 'env': { 'LOKI_ADDR': '${LOKI_ADDR_ENV}', 'LOKI_TOKEN': '${LOKI_TOKEN_ENV}' }.

Does it support prompt templates or resources?

No explicit prompt templates or resource definitions are included; its main focus is on log querying via the 'query-loki' tool.

How do I integrate it with FlowHunt?

Add the MCP component to your flow, configure the MCP server in the system MCP configuration with the appropriate transport and URL, then connect it to your AI agent for log querying features.

Integrate Simple Loki MCP Server with FlowHunt

Supercharge your AI workflows by enabling direct log analysis and monitoring through the Simple Loki MCP Server. Effortless integration with FlowHunt and popular AI platforms.

Learn more