Skip to main content
Glama
piotr-szybicki

Local Loki MCP server

로컬 Loki MCP 서버

로컬 Grafana Loki 인스턴스를 위한 작은 읽기 전용 MCP 서버입니다. FastAPI와 공식 MCP Python SDK로 구축되었습니다.

제공하는 기능

  • search_logs(service, start, end, text=None) — 필수 서비스와 선택적 리터럴 텍스트를 필수 RFC 3339 시간 범위 내에서 검색합니다.

  • list_services(start, end) — 사용 가능한 서비스 레이블 값을 나열합니다.

  • loki_health() — Loki가 준비되었는지 확인합니다.

공개 도구에는 limit 매개변수가 없습니다. 요청은 또한 Loki의 limit 쿼리 매개변수를 생략하므로 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
  2. 기본값이 설정과 일치하지 않으면 셸에서 환경 변수를 설정합니다. .env.example에 사용 가능한 설정이 나열되어 있습니다. 기본값은 http://127.0.0.1:3100의 Loki와 service_name 레이블을 기대합니다.

  3. 서버를 시작합니다.

    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