Loading...
pip install grafana-loki-mcp{
"mcpServers": {
"loki": {
"command": "uvx",
"args": [
"grafana-loki-mcp",
"-u",
"GRAFANA_URL",
"-k",
"GRAFANA_API_KEY"
]
}
}
}query_lokiQueries Loki logs based on a provided query string and time range.
Read-only operation; retrieves log data without modification.
get_loki_labelsRetrieves all label names from Loki.
Read-only operation; retrieves label names without modification.
get_loki_label_valuesRetrieves values for a specific label from Loki.
Read-only operation; retrieves label values without modification.
format_loki_resultsFormats Loki query results into a more readable format.
Read-only operation; transforms data without modifying the source.
This MCP server is relatively safe for querying and formatting Loki logs, provided the Grafana API key is securely managed and access is appropriately controlled. Risks are elevated if the API key is exposed or if log data contains sensitive information without proper redaction.