Loki MCP Server Resources Reference
The TalkOps Loki MCP Server exposes 8 read-only resources (loki:// URIs). These endpoints provide dynamic cluster health introspection, indexed label schemas, active guardrail limits, and static LogQL cheat sheets.
Dynamic Cluster Resources
| Resource URI | Description | Example Target |
|---|---|---|
loki://system/health | Backend reachability, readiness status, and active label count. | Health status JSON |
loki://schema/labels | Global list of all indexed label names in the Loki cluster. | ["app", "namespace", "container", "cluster", "job"] |
Configuration & Guardrail Resources
| Resource URI | Description |
|---|---|
loki://config/guardrails | Active query safety limits (max_query_bytes, max_time_window_hours, max_log_limit, cardinality_threshold). |
loki://config/backends | Target backend connection settings (URL, auth mode, tenant OrgID). |
Reference Resources (Static Guides)
| Resource URI | Description |
|---|---|
loki://reference/logql | Complete LogQL reference covering stream selectors, regex line filters, parsers (json, logfmt, pattern), and metric aggregations. |
loki://reference/best-practices | Architectural guide on label cardinality, avoiding high-cardinality selectors, and using structured metadata. |
loki://reference/query-templates | Curated templates for error investigation, latency tracing, and audit logs. |
loki://reference/label-governance | Production standards for label naming conventions and multi-tenant isolation. |
Resource Usage Examples
1. Checking Cluster Health (loki://system/health)
{
"uri": "loki://system/health",
"mimeType": "application/json",
"text": {
"status": "ready",
"backend_url": "http://loki-gateway.monitoring:80",
"version": "3.0.0",
"active_labels_count": 14,
"multi_tenant_enabled": true,
"org_id": "production"
}
}
2. Discovering Indexed Labels (loki://schema/labels)
{
"uri": "loki://schema/labels",
"mimeType": "application/json",
"text": [
"app",
"component",
"container",
"environment",
"instance",
"job",
"namespace",
"node_name",
"pod",
"stream"
]
}