loki-query-mcp
v0.1.5MCP server for querying Grafana Loki logs in plain English
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
query_loki_logs Query Loki Logs
Run a raw LogQL query against Loki and return log entries.
| Parameter | Type | Description |
|---|---|---|
logql * | string | |
direction | string | |
end | ||
limit | integer | |
start |
find_service_logs Find Service Logs
Find log lines for a service filtered by level. Pass start/end as ISO8601 (e.g. "2026-04-14T13:40:00Z"). Pass environment=None to query all environments.
| Parameter | Type | Description |
|---|---|---|
app * | string | |
end | ||
environment | ||
level | string | |
limit | integer | |
owner | ||
start |
find_error_patterns Find Error Patterns
Group recurring log messages by pattern for a service, sorted by frequency. Loki counts internally — no line limit, works for any volume. Pass start/end as ISO8601. Pass environment=None to query all environments.
| Parameter | Type | Description |
|---|---|---|
app * | string | |
end | ||
environment | ||
level | string | |
owner | ||
start |
list_label_values List Label Values
List available values for a given Loki label. Useful for discovering services, environments, owners, etc.
| Parameter | Type | Description |
|---|---|---|
label * | string | |
end | ||
filter_query | ||
start |
list_label_names List Label Names
List all available Loki label names.
| Parameter | Type | Description |
|---|---|---|
end | ||
start |
count_service_logs Count Service Logs
Count logs for a service filtered by level over a time window. Pass start/end as ISO8601. Pass environment=None to query all environments.
| Parameter | Type | Description |
|---|---|---|
app * | string | |
end | ||
environment | ||
level | string | |
owner | ||
start |
find_log_streams Find Log Streams
Discover active log streams for a service. Returns full label combinations (region, cluster, pod, etc.). Call this before querying to understand where a service runs.
| Parameter | Type | Description |
|---|---|---|
app * | string | |
end | ||
environment | ||
owner | ||
start |