Loki MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOKI_URL | No | Base URL of the Loki instance | |
| LOKI_PASSWORD | No | Basic auth password | |
| LOKI_USERNAME | No | Basic auth username | |
| LOKI_TENANT_ID | No | X-Scope-OrgID header for multi-tenant deployments | |
| LOKI_BEARER_TOKEN | No | Bearer token authentication | |
| LOKI_HTTP_TIMEOUT | No | HTTP request timeout (Go duration, e.g. 10s, 1m) | 30s |
| LOKI_TLS_SKIP_VERIFY | No | Skip TLS certificate verification | false |
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 | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| label_valuesA | List the values a single label takes in Loki over a time window. Use it after labels to fill in a selector: labels says "app" exists, label_values with label="app" says which apps are actually logging, and one of those goes into {app="..."} for query_range. Only values seen inside the window are returned, so widening start/end surfaces more. Returns the raw Loki JSON response: {"status","data":["value","list"]}. An unknown label name is not an error; it comes back as an empty list. Read-only: it never writes to or mutates Loki. |
| labelsA | List the label names Loki knows about in a time window. Start here when the log schema is unknown: labels gives the names (app, namespace, level), then label_values gives the values for one of them, and together they let you write a valid selector for query_range. Only labels present on streams that received data inside the window are returned, so widening start/end surfaces more. Returns the raw Loki JSON response: {"status","data":["label","names"]}. Read-only: it never writes to or mutates Loki. |
| queryA | Run a LogQL instant query against Loki, evaluating the expression at a single point in time. Use this for metric expressions (rate, count_over_time, sum by) when one value per series is enough, or for a quick "what is happening right now" check. To read log lines across a time window, use query_range instead. To discover which labels exist before writing a selector, use labels and label_values. Returns the raw Loki JSON response: {"status","data":{"resultType","result"}}, where resultType is "vector" for metric expressions and "streams" for log selectors. Read-only: it never writes to or mutates Loki. |
| query_rangeA | Run a LogQL range query against Loki, returning results across a time window. This is the tool to reach for when reading logs: searching for errors, tailing a service over the last hour, or graphing a metric expression over time. Use query instead when a single point-in-time value is enough. If the selector is unknown, call labels and label_values first. Returns the raw Loki JSON response: {"status","data":{"resultType","result"}}, where resultType is "streams" for log selectors and "matrix" for metric expressions. Loki truncates at limit entries, so a full result set may mean logs were cut off; narrow start/end or tighten the selector rather than raising limit. Read-only: it never writes to or mutates Loki. |
| seriesA | List the log streams matching a selector, as complete label sets. Use it to see which concrete streams a selector actually covers and what other labels they carry: {app="nginx"} may expand to one series per pod, region or level. That answers "does this selector match anything" and "how many streams am I about to read" without fetching log lines. For the lines themselves, use query_range; for label names and values in isolation, use labels and label_values. Returns the raw Loki JSON response: {"status","data":[{"label":"value"}]}, one object per stream. A selector matching nothing comes back as an empty list. Read-only: it never writes to or mutates Loki. |
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 5 tools
Each tool serves a distinct purpose: labels lists names, label_values lists values for a given label, query runs instant queries, query_range runs range queries, and series lists matching streams. No overlap or ambiguity between them.
All tool names are in snake_case and follow a clear pattern: label_values, labels, query, query_range, series. They are consistent in style and predictable, with multi-word names clearly separated by underscores.
With 5 tools, the server is well-scoped for a log querying service. Each tool is essential and there are no redundant or excessive entries.
The tool surface covers the full read-only workflow for Loki: discovering labels, discovering label values, running instant queries, running range queries, and checking stream coverage. No obvious gaps for typical use cases.