Acts as a bridge to observability backends for querying Prometheus metrics and Loki logs, enabling alert investigation, troubleshooting, and correlation of metrics and logs for monitored services.
Provides tools for querying Prometheus metrics using PromQL, discovering metrics and labels, retrieving current and historical metric values, and investigating service health and performance issues.
otel-mcp
MCP server for querying Prometheus metrics and Loki logs with OIDC authentication.
Features
Query Prometheus metrics (PromQL)
Query Loki logs (LogQL)
HTTP API for K8s deployment
Service discovery (metrics, labels, log streams)
Quick Start
Local Development
Production (Kubernetes + Authentik)
See K8S_DEPLOYMENT.md for full deployment guide.
Available Tools
Prometheus (5 tools)
query_prometheus- Execute PromQL instant queriesquery_prometheus_range- Query metrics over time rangelist_metrics- List available metricslist_label_values- Get label values (discover services)list_labels- List all label names
Loki (4 tools)
query_loki- Execute LogQL queriessearch_logs- Simple log search with filterslist_log_labels- List log stream labelslist_log_label_values- Get log label values
Usage
Production: K8s with Authentik OAuth Proxy
Deploy HTTP server behind Authentik for authentication.
See K8S_DEPLOYMENT.md for complete setup.
Local: MCP stdio (Development)
For local MCP clients like Claude Desktop.
Configuration Options
Variable | Default | Description |
|
| Prometheus endpoint |
|
| Loki endpoint |
|
| Enable OIDC auth |
| - | OIDC provider URL |
| - | OAuth2 client ID |
| - | Token audience (optional) |
|
| Logging level |
|
| Query timeout (seconds) |
Backend Authentication
Prometheus/Loki support Basic Auth and Bearer tokens:
Example Queries
License
MIT