Query Loki logs through Grafana and retrieve labels using an MCP server.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Grafana Loki MCP.
queryLoki query string
startStart time (ISO format, Unix timestamp, or Grafana-style relative time like 'now-1h', default: 1 hour ago)
endEnd time (ISO format, Unix timestamp, or Grafana-style relative time like 'now', default: now)
limitMaximum number of log lines to return (default: 100)
directionQuery direction ('forward' or 'backward', default: 'backward')
max_per_lineMaximum characters per log line (0 for unlimited, default: 100)
A FastMCP server that allows querying Loki logs from Grafana.
GRAFANA_URL: URL of your Grafana instanceGRAFANA_API_KEY: Grafana API key with appropriate permissionsSet the following environment variables:
GRAFANA_URL: URL of your Grafana instanceGRAFANA_API_KEY: Grafana API key with appropriate permissionsYou can also provide these values as command line arguments:
Additional options:
--transport: Transport protocol to use (stdio or sse, default: stdio)Run the test suite:
Run with coverage:
Query Loki logs through Grafana.
Parameters:
query: Loki query stringstart: Start time (ISO format, Unix timestamp, or Grafana-style relative time like 'now-1h', default: 1 hour ago)end: End time (ISO format, Unix timestamp, or Grafana-style relative time like 'now', default: now)limit: Maximum number of log lines to return (default: 100)direction: Query direction ('forward' or 'backward', default: 'backward')max_per_line: Maximum characters per log line (0 for unlimited, default: 100)Get all label names from Loki.
Get values for a specific label from Loki.
Parameters:
label: Label nameFormat Loki query results in a more readable format.
Parameters:
results: Loki query results from query_lokiformat_type: Output format ('text', 'json', or 'markdown', default: 'text')max_per_line: Maximum characters per log line (0 for unlimited, default: 0)This project is licensed under the MIT License - see the LICENSE file for details.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/tumf-grafana-loki-mcp)<a href="https://allmcps.com/mcp/tumf-grafana-loki-mcp"><img src="https://allmcps.com/api/badge/tumf-grafana-loki-mcp?style=directory" alt="Grafana Loki MCP on AllMCPs" /></a>