If your Loki is already configured as a Grafana datasource, you likely do not need this integration — the Grafana integration covers Loki log queries through a single MCP server. Connect Loki directly only if you run Loki standalone without Grafana, or if your Loki is not accessible through your Grafana instance.
What this integration enables
- LogQL queries — agents search log streams for error messages, exception traces, and service-level events during diagnosis
- Time-window correlation — agents narrow log searches to the incident time window and affected services automatically
- Multi-tenant support — if you run a multi-tenant Loki, configure the Tenant ID to scope queries to the correct org
Prerequisites
- An environment selected in the top-right context switcher — Settings → Environment → Integrations is scoped to that environment and stays disabled until one is selected
- A running Loki instance reachable from your network
- The
loki-mcpserver running and reachable from sureops
Integration connections are per-environment. Connecting Loki here only applies to the environment that was selected in the context switcher at the time — it does not carry over to your other environments. Repeat this connect flow for each environment that needs Loki.
Setup
1
Stand up loki-mcp
Deploy an MCP server that speaks LogQL against your Loki instance. The sureops demo environment doesn’t use this integration — Grafana is already connected there and covers Loki queries.For your own environment, deploy your MCP server of choice with your Loki base URL configured as its upstream.
2
Connect in sureops
In sureops, go to Settings → Environment → Integrations and click Connect next to Loki.Fill in:
- Integration Name — prefilled; change it if you need to tell two configurations of this integration apart
- MCP Server Endpoint — the URL of your running
loki-mcpserver (e.g.https://loki-mcp.internal.company.com/mcp) - Bearer Token — the token your
loki-mcpendpoint (or the proxy in front of it) expects. sureops always sends this toloki-mcpas anAuthorization: Bearerheader, so there is no authentication method to choose. The form won’t save a blank token, so if nothing in front ofloki-mcpchecks a token, put it behind an ingress or proxy that does.
3
Configure Tenant ID (after connecting, if needed)
Once connected, reopen the Loki integration from Settings → Environment → Integrations. If you run a multi-tenant Loki, a Settings section appears below the connection status with a Tenant ID field — set it there, not on the connect form. When set, it’s sent as the
X-Scope-OrgID header. There’s no system default — fake is just the value single-tenant Loki commonly expects if it enforces the header at all; don’t type it in unless that’s genuinely your tenant ID. Leave it blank for single-tenant Loki.Required credentials
Fields collected when you connect the integration:
Field configured afterward, via the integration’s Settings section once connected: