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
実行方法
Python 3.11以降をインストールし、仮想環境を作成して有効にします。
py -3.11 -m venv .venv .\.venv\Scripts\Activate.ps1 pip install -r requirements.txtデフォルトがお使いの構成と一致しない場合は、シェルで環境変数を設定します。
.env.exampleに利用可能な設定が一覧表示されています。デフォルトでは、http://127.0.0.1:3100のLokiとservice_nameラベルを想定しています。サーバーを起動します。
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"を指定してサーバーを起動してください。
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityDmaintenanceEnables 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.29MIT
- AlicenseNot gradedqualityDmaintenanceThis 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.23MIT
- FlicenseAqualityDmaintenanceEnables 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
- AlicenseNot gradedqualityCmaintenanceProvides 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.1MIT
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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