grafana-loki-mcp

grafana-loki-mcp

3.4

If you are the rightful owner of grafana-loki-mcp 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.

A FastMCP server that allows querying Loki logs from Grafana.

Grafana-Loki MCP Server is a FastMCP server designed to facilitate querying of Loki logs through the Grafana API. It supports various transport protocols and allows users to format query results in multiple formats such as text, JSON, and markdown. The server is built to work with Python 3.10+ and requires FastMCP and Requests libraries. Users can install it via pip and configure it using environment variables or command line arguments. The server provides tools to query logs, retrieve labels, and format results, making it a versatile solution for log management and analysis.

Features

  • Query Loki logs through Grafana API
  • Get Loki labels and label values
  • Format query results in different formats (text, JSON, markdown)
  • Support for both stdio and SSE transport protocols

Tools

  1. query_loki

    Query Loki logs through Grafana.

  2. get_loki_labels

    Get all label names from Loki.

  3. get_loki_label_values

    Get values for a specific label from Loki.

  4. format_loki_results

    Format Loki query results in a more readable format.