Skip to main content
MCPJungle uses the OpenTelemetry SDK to emit metrics and exposes them in the Prometheus text format at the /metrics endpoint. The metrics are well-suited for scraping with Prometheus and visualising in Grafana.

Enabling metrics

In enterprise mode, OpenTelemetry is enabled automatically — no extra configuration is required. In development mode, metrics are disabled by default. To enable them without switching to enterprise mode, set the OTEL_ENABLED environment variable before starting the server:
export OTEL_ENABLED=true

# Optionally attach resource attributes to every metric (e.g., deployment environment)
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=enterprise

mcpjungle start
OTEL_ENABLED accepts true / 1 to enable and false / 0 to disable. In enterprise mode you can use OTEL_ENABLED=false to opt out of metrics collection.

Accessing the metrics endpoint

Once the server is running with metrics enabled, scrape the endpoint:
curl http://localhost:8080/metrics
The response is standard Prometheus text exposition format. Example output:
# HELP mcpjungle_tool_calls_total Total number of tool calls
# TYPE mcpjungle_tool_calls_total counter
mcpjungle_tool_calls_total{mcp_server_name="calculator",tool_name="calculator__add",outcome="success"} 42
mcpjungle_tool_calls_total{mcp_server_name="github",tool_name="github__git_commit",outcome="error"} 3

# HELP mcpjungle_tool_call_latency_seconds Latency of tool calls in seconds
# TYPE mcpjungle_tool_call_latency_seconds histogram
mcpjungle_tool_call_latency_seconds_bucket{mcp_server_name="calculator",tool_name="calculator__add",outcome="success",le="0.1"} 40
mcpjungle_tool_call_latency_seconds_bucket{mcp_server_name="calculator",tool_name="calculator__add",outcome="success",le="+Inf"} 42
mcpjungle_tool_call_latency_seconds_sum{mcp_server_name="calculator",tool_name="calculator__add",outcome="success"} 1.243
mcpjungle_tool_call_latency_seconds_count{mcp_server_name="calculator",tool_name="calculator__add",outcome="success"} 42

Available metrics

MetricTypeDescription
mcpjungle_tool_calls_totalCounterTotal number of tool calls, including prompt calls.
mcpjungle_tool_call_latency_secondsHistogramLatency in seconds for each tool call.
Both metrics carry the following labels:
LabelDescription
mcp_server_nameName of the upstream MCP server that owns the tool.
tool_nameCanonical tool name (server__tool, e.g. calculator__add).
outcomesuccess or error.
The latency histogram uses buckets at: 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10, 20, 30 seconds.

Using Prometheus and Grafana

The production Docker Compose file (docker-compose.prod.yaml) ships with a Prometheus container pre-configured to scrape MCPJungle every 15 seconds:
scrape_configs:
  - job_name: 'mcpjungle'
    static_configs:
      - targets: ['mcpjungle:8080']
    metrics_path: '/metrics'
    scrape_interval: 15s
To bring up the full stack including Prometheus:
curl -O https://raw.githubusercontent.com/mcpjungle/MCPJungle/refs/heads/main/docker-compose.prod.yaml
docker compose -f docker-compose.prod.yaml up -d
Prometheus will be accessible at http://localhost:9090. From there you can connect a Grafana instance (not included in the compose file) and build dashboards using the mcpjungle_* metrics.
Use OTEL_RESOURCE_ATTRIBUTES to attach additional metadata (such as cluster name or deployment environment) to all metrics emitted by a specific MCPJungle instance. This is useful when you run more than one instance and want to filter metrics by environment in Grafana.