Complete AI Training

MCP server · Analytics

Loki MCP server

by incu6us

Lets your AI search and read your Grafana Loki logs by asking plain questions in chat.

Flow diagram: you ask your AI “What errors happened in the payments app in the last hour?”, the Loki MCP server connects it to Grafana Loki, and you get back matching log lines in chat.

This is a small helper that connects your AI assistant to Grafana Loki, the place where many teams keep their application logs. Once it is set up, you can ask your AI things like which errors happened last night, and it will go and look in Loki for you. It is handy for anyone who deals with logs but does not want to learn a query language first.

What is an MCP server? The 30-second version

On its own, your AI can only chat with you. An MCP server is a small helper program that gives your AI a new skill or a connection to another app. This one connects your AI to your Loki log system, so it can look up labels, values and log lines there when you ask. You stay in the chat, and the helper does the talking to Loki behind the scenes.

What this MCP server does

You ask your AI a question about your logs, like what errors happened in the last hour. The AI uses this helper to first check which labels and values exist in your Loki, so it knows what it can search for. Then it builds a proper log query and sends it to Loki. Loki sends back the matching log lines, and the AI shows them to you as a readable answer in the chat. You never have to write the query yourself.

Flow diagram: you ask your AI “What errors happened in the payments app in the last hour?”, the Loki MCP server connects it to Grafana Loki, and you get back matching log lines in chat. Click to zoom

What you can do with it

  • List all the label names available in your Loki
  • Find the values of a specific label, like all app names
  • Find which log streams are active right now
  • Fetch log lines over a time window you choose
  • Look up logs at one exact moment in time
  • Filter logs by app, level or message text
  • Get a short summary of recent errors instead of reading raw logs

Try asking your AI

  • “What errors happened in the payments app in the last hour?”
  • “List all the label names available in Loki right now.”
  • “Show me the last 50 log lines from the nginx app.”
  • “Which apps are sending logs at the moment?”

What it gives back to you

You get back log lines, lists of label names or values, and lists of active streams, shown as text in the chat. The AI can also summarise what it found, like counting errors or pointing out a pattern. Nothing in your Loki is changed; it only reads.

Before you start

What you need

  • A Grafana Loki instance you can reach, with its address (URL)
  • Login details for that Loki if it needs them, like a username and password or a token
  • The Loki MCP server program installed on your computer
  • An AI client that supports MCP, like Claude Desktop or Claude Code

Good to know

This helper can read every log line your Loki login can see, so treat the login details you give it as sensitive and do not expose it on the open internet without protection.

Install it with your AI

Add Loki MCP server to your AI, no technical skills needed

You don't install anything by hand. You copy one prompt, paste it into an AI that can work on your computer, and it checks, installs and connects the server for you, asking you when it needs something.

Sign in to get the install prompt

Members get a ready-made prompt that lets the Claude desktop app check Loki MCP server, install it and connect it for them, step by step. You don't need any technical skills: you copy, paste and answer a few questions. Your connected AI can also find and install any of the 4,066 MCP servers here for you.

Sign in Become a member

Who it's for

Developers, support engineers and anyone on call who needs to look through application logs without learning a query language.