Skip to main content

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 URIDescriptionExample Target
loki://system/healthBackend reachability, readiness status, and active label count.Health status JSON
loki://schema/labelsGlobal list of all indexed label names in the Loki cluster.["app", "namespace", "container", "cluster", "job"]

Configuration & Guardrail Resources

Resource URIDescription
loki://config/guardrailsActive query safety limits (max_query_bytes, max_time_window_hours, max_log_limit, cardinality_threshold).
loki://config/backendsTarget backend connection settings (URL, auth mode, tenant OrgID).

Reference Resources (Static Guides)

Resource URIDescription
loki://reference/logqlComplete LogQL reference covering stream selectors, regex line filters, parsers (json, logfmt, pattern), and metric aggregations.
loki://reference/best-practicesArchitectural guide on label cardinality, avoiding high-cardinality selectors, and using structured metadata.
loki://reference/query-templatesCurated templates for error investigation, latency tracing, and audit logs.
loki://reference/label-governanceProduction 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"
]
}