loki-tail-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | HTTP listen port. Default: 8325 | 8325 |
| LOKI_URL | No | Loki base URL. Default: http://loki:3100 | http://loki:3100 |
| LOKI_ALIASES | No | Extra vocabulary merged over the built-ins: term=fragment or term=frag|frag2, comma-separated. | |
| LOKI_TIMEOUT | No | Upstream request timeout (s). Default: 30 | 30 |
| LOKI_MAX_LIMIT | No | Row cap maximum. Default: 1000 | 1000 |
| LOKI_TENANT_ID | No | Sent as X-Scope-OrgID for multi-tenant Loki. | |
| LOKI_BASIC_AUTH | No | user:password for a basic-auth-fronted Loki (reverse proxy, Grafana Cloud). | |
| MCP_BEARER_TOKEN | No | Required in HTTP mode; server refuses to start without it. Not used in --stdio mode. | |
| LOKI_DEFAULT_LIMIT | No | Row cap. Default: 100 | 100 |
| LOKI_EPHEMERAL_PATTERNS | No | Comma-separated regexes marking names as ephemeral; replaces the defaults when set. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| loki_query_rangeA | Run a LogQL range query against Loki. query: LogQL expression, e.g. Returns compact |
| loki_query_instantA | Run a LogQL instant query at a single point in time. Best for metric queries like |
| loki_tail_containerA | Tail the most recent log lines for a single container. container: Container name (e.g. |
| loki_list_labelsA | List all label names Loki has seen in the given lookback window. lookback: Duration ( |
| loki_list_label_valuesA | List all values seen for a given label in the lookback window. label: Label name (e.g. |
| loki_patternsA | Mine a container's recent logs into recurring patterns — the fastest
way to summarize what a noisy service is saying. One call turns
thousands of lines into a ranked list of templates ( container: exact container name (use loki_list_containers / loki_tail_container to find it). minutes: how far back to mine. Default 60. Requires the Loki pattern ingester; only logs ingested after it was enabled are mined, so a small window right after enablement is normal. |
| loki_log_volumeA | Rank containers by log volume (bytes) — "which service suddenly got noisy". Leave container empty to rank the whole fleet; set it to scope to one container. minutes: window to measure. Default 60. limit: max rows. Default 10. |
| loki_detected_fieldsA | Discover the fields Loki can auto-extract from a container's logs
(name, type, cardinality, parser — e.g. logfmt/json). Use this before
writing a LogQL parse stage in loki_query_range, e.g. finding that a
service logs logfmt with a container: exact container name. minutes: window to sample. Default 60. limit: max fields. Default 20. |
| loki_list_containersA | List durable container names actively logging in the lookback window. Hides ephemeral noise — podman auto-names ( lookback: Duration ( |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose. The two query tools (instant vs range) are explicitly differentiated in their descriptions, and the discovery/analysis tools (labels, patterns, volume, fields, containers) do not overlap. Even tail_container is clearly a convenience wrapper for a specific use case.
Six of nine tools follow a consistent loki_verb_noun pattern (query_instant, query_range, tail_container, list_labels, list_label_values, list_containers). Three tools (patterns, log_volume, detected_fields) use noun phrases, breaking the verb-first convention. This is a minor inconsistency that doesn't hinder usability.
Nine tools is a well-scoped number for a Loki exploration server. Each tool serves a distinct purpose without redundancy, covering querying, metadata discovery, log analysis, and container navigation. The count is neither too small nor overwhelming.
The tool set covers the full range of Loki interactions: instant queries, range queries, metadata discovery (labels, values), container listing and tailing, pattern mining, volume ranking, and field detection for parsing. There are no obvious gaps for a read-only log exploration workflow.