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