Skip to main content
Glama
piotr-szybicki

Local Loki MCP server

Локальный MCP-сервер Loki

Небольшой MCP-сервер только для чтения для локального экземпляра Grafana Loki. Он построен на FastAPI и официальном MCP Python SDK.

Что он предоставляет

  • search_logs(service, start, end, text=None) — выполняет поиск по обязательному сервису и необязательному литеральному тексту в обязательном временном диапазоне RFC 3339.

  • list_services(start, end) — перечисляет доступные значения метки service-label.

  • loki_health() — проверяет, готов ли Loki.

Публичный инструмент не имеет параметра limit. Запрос также опускает параметр запроса limit Loki, поэтому применяется собственное настроенное значение по умолчанию/максимум Loki.

Related MCP server: grafana-mcp

Запуск

  1. Установите Python 3.11 или новее, затем создайте и активируйте виртуальное окружение.

py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
  1. Задайте переменные окружения в вашей оболочке, если значения по умолчанию не соответствуют вашей настройке. В .env.example перечислены доступные настройки. По умолчанию ожидается Loki по адресу http://127.0.0.1:3100 и метка service_name.

  2. Запустите сервер.

uvicorn main:app --reload

Конечная точка MCP Streamable HTTP: http://127.0.0.1:8000/mcp. Собственная конечная точка проверки работоспособности сервера: http://127.0.0.1:8000/health.

Пример

Вызов search_logs с:

{
  "service": "checkout",
  "text": "connection refused",
  "start": "2026-08-26T08:00:00Z",
  "end": "2026-08-26T09:00:00Z"
}

генерирует следующий LogQL-запрос:

{service_name="checkout"} |= "connection refused"

Если ваши метки используют app вместо этого, запустите сервер с $env:LOKI_SERVICE_LABEL = "app".

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables querying and formatting Loki logs from Grafana via the Model Context Protocol. It supports LogQL queries, label retrieval, and provides results in text, JSON, or markdown formats.
    29
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    This MCP server enables natural-language querying of Grafana logs by automatically detecting log sources and service labels. It provides read-only access to log data with intelligent caching for efficient repeat queries.
    23
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Enables querying OpenTelemetry logs stored in OpenSearch across development and production environments. Provides tools for searching logs by various criteria including free-text Lucene queries, trace IDs, service names, error levels, and specific fields.
    8
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides read-only access to Loki, Prometheus, and Tempo APIs, enabling natural language queries for logs, metrics, and traces. Supports multiple instances and authentication via bearer tokens.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Read-only access to Auralogs production logs: search logs, inspect errors, review AI analyses.

  • MEOK ABCI Bridge MCP — read-only Tendermint / Cosmos blockchain query for agents. Built-in registry

  • Software component catalog: search your org's services, docs, APIs, dependencies, and ownership.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/piotr-szybicki/local-grafana-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server