Skip to main content
Glama
snickery

loki-tail-mcp

by snickery

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PORTNoHTTP listen port. Default: 83258325
LOKI_URLNoLoki base URL. Default: http://loki:3100http://loki:3100
LOKI_ALIASESNoExtra vocabulary merged over the built-ins: term=fragment or term=frag|frag2, comma-separated.
LOKI_TIMEOUTNoUpstream request timeout (s). Default: 3030
LOKI_MAX_LIMITNoRow cap maximum. Default: 10001000
LOKI_TENANT_IDNoSent as X-Scope-OrgID for multi-tenant Loki.
LOKI_BASIC_AUTHNouser:password for a basic-auth-fronted Loki (reverse proxy, Grafana Cloud).
MCP_BEARER_TOKENNoRequired in HTTP mode; server refuses to start without it. Not used in --stdio mode.
LOKI_DEFAULT_LIMITNoRow cap. Default: 100100
LOKI_EPHEMERAL_PATTERNSNoComma-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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
loki_query_rangeA

Run a LogQL range query against Loki.

query: LogQL expression, e.g. {container="nginx"} |= "ERROR" or a metric query like rate({container="traefik"}[5m]). start: Duration back from now (15m, 2h, 3d), RFC3339 timestamp, or ns-since-epoch. Default 1h. end: Same format as start. Default now. limit: Max log lines to return (clamped to server max, default 100). direction: backward (newest first) or forward. Default backward.

Returns compact timestamp [labels] message lines, newest first. For metric queries returns {labels} ts:val ts:val ... per series.

loki_query_instantA

Run a LogQL instant query at a single point in time.

Best for metric queries like count_over_time({container="crowdsec"}[5m]). For raw log search, prefer loki_query_range.

loki_tail_containerA

Tail the most recent log lines for a single container.

container: Container name (e.g. nginx, traefik, arr-sonarr). Exact names work best; an unknown name is resolved against live container names (service vocabulary like vpn works) — a unique match is tailed automatically and flagged in the output, otherwise candidate names are returned. minutes: How far back to look. Default 15. limit: Max lines to return. Default 200. filter: Optional substring filter applied as LogQL |= "filter". Case-sensitive. Leave empty for no filter.

loki_list_labelsA

List all label names Loki has seen in the given lookback window.

lookback: Duration (1h, 24h, 7d). Default 1h. Shorter is faster.

loki_list_label_valuesA

List all values seen for a given label in the lookback window.

label: Label name (e.g. container, service_name, job, host). lookback: Duration (1h, 24h, 7d). Default 1h.

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 (<_> marks the variable parts) with occurrence counts.

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 status field enables {container="x"} | logfmt | status>=500.

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 (adoring_neumann) and hex-suffixed batch workers (transcode-ffmpeg-<hash>) number in the thousands over 24h and would swamp the response. They remain queryable via loki_query_range; use loki_list_label_values('container') for the raw unfiltered list.

lookback: Duration (1h, 24h, 7d). Default 1h.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/snickery/loki-tail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server