pmm-mcp

v0.3.2
pmm-mcp Checked 9 hours ago Published 1 month ago

MCP server (read-only by default) for Percona Monitoring and Management (PMM) 2.x and 3.x: PromQL metrics and Query Analytics

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pmm_promql

Run an instant PromQL query against the PMM metrics store (VictoriaMetrics). Common labels: service_name (e.g. db01-mysql), service_type (mysql|mongodb|postgresql), node_name, environment. Examples: rate(mysql_global_status_questions{service_name="db01-mysql"}[5m]) mysql_global_status_threads_running 100 - avg by (node_name)(rate(node_cpu_seconds_total{mode="idle"}[5m]))*100 time: RFC3339 or unix timestamp (default: now).

ParameterTypeDescription
query *string
time

pmm_promql_range

PromQL over a time range. start/end: RFC3339 (e.g. 2026-10-02T08:00:00Z) or unix timestamp. For long ranges increase step (e.g. 300s for one day); at most 3000 points per series are allowed and at most 50 series are returned (`truncated` and `series_total` say when that happened).

ParameterTypeDescription
end *string
query *string
start *string
stepstring

pmm_label_values

List the values of a label (e.g. label=service_name, match='mysql_up').

ParameterTypeDescription
label *string
match

pmm_label_names

List all label names, optionally only for series matching a selector (e.g. match='mysql_up').

ParameterTypeDescription
match

pmm_metric_names

Discover metric names. contains: case-insensitive substring (e.g. 'innodb_buffer_pool', 'replication').

ParameterTypeDescription
contains
limitinteger

pmm_metric_metadata

Help text and type (counter/gauge/histogram) of a metric, to write a correct PromQL query.

ParameterTypeDescription
metric *string

pmm_list_services

List monitored services: service_name, service_type, node_name, environment and up status. service_type: mysql | mongodb | postgresql | proxysql | haproxy (default: all).

ParameterTypeDescription
service_type

pmm_list_alerts

Currently firing alerts. label_filter: Alertmanager matcher such as 'severity="critical"'. Returns name, state, severity, labels, annotations summary, startsAt and the silencedBy ids.

ParameterTypeDescription
include_silencedboolean
label_filter

pmm_alert_rules

Alert rule definitions with their current state (firing | pending | inactive), grouped by folder/group. state: optional filter on the rule state.

ParameterTypeDescription
state

pmm_list_silences

Alert silences (who muted what, until when).

ParameterTypeDescription
active_onlyboolean

pmm_search_dashboards

Search PMM/Grafana dashboards by title or tag. PMM ships dashboards for every database engine; use the result uid with pmm_dashboard_queries to see the exact PromQL PMM itself uses.

ParameterTypeDescription
limitinteger
querystring
tag

pmm_dashboard_queries

Panels of a dashboard with their PromQL/SQL queries and template variables. Much smaller than the dashboard JSON, and the quickest way to learn which metrics answer a question ("how does PMM compute replication lag?").

ParameterTypeDescription
uid *string

pmm_annotations

Annotations in a time window (deploys, restarts, maintenance markers set in PMM/Grafana). Use them to correlate a metric or QAN change with something that happened. tags: comma-separated.

ParameterTypeDescription
end
hoursnumber
limitinteger
tags

pmm_whoami

Identity and role behind the configured token, plus the server URL. First thing to call when requests fail with 401/403 or when you are unsure what the token is allowed to see.

pmm_qan_top_queries

Query Analytics: heaviest queries (grouped by fingerprint). hours: look-back window; end: window end (e.g. '2026-10-02 11:05:00', UTC; default now). node_name / username / client_host: exact-match filters; contains: case-insensitive text in the fingerprint (e.g. a table name). order_by: load (total time) | count | avg_time | rows_examined | max_time | errors. Returned fields: queryid, service_name, database, fingerprint, num_queries, total_time_s, avg_ms, max_ms, p99_ms, rows_examined, rows_sent, load (average concurrent queries = total_time / window).

ParameterTypeDescription
client_host
contains
database
end
hoursnumber
limitinteger
node_name
order_bystring
service_name
username

pmm_qan_by_service

QAN: total load per service (which database spends the most time on queries). service_type: mysql | mongodb | postgresql.

ParameterTypeDescription
end
hoursnumber
service_type

pmm_qan_query_detail

For a single queryid: a real query example, tables, and the distribution over time (buckets of bucket_minutes). Use it to see when a query started misbehaving. queryid and service_name come from pmm_qan_top_queries; the same queryid can appear in several services, and if service_name is omitted they are aggregated together.

ParameterTypeDescription
queryid *string
bucket_minutesinteger
end
hoursnumber
service_name

pmm_qan_sql

Free-form SELECT against the QAN ClickHouse (read-only). Table: pmm.metrics, 1-minute period_start slices. Important columns: queryid, service_name, service_type, database, schema, username, client_host, node_name, period_start, fingerprint, example, num_queries, num_queries_with_errors, m_query_time_{sum,cnt,max,p99}, m_lock_time_sum, m_rows_examined_sum, m_rows_sent_sum, m_rows_affected_sum, m_no_index_used_sum, m_full_scan_sum, m_tmp_disk_tables_sum, m_docs_scanned_sum (mongo), m_shared_blks_read_sum (pg), tables. Always filter on period_start; the table is large. Only a…

ParameterTypeDescription
sql *string
max_rowsinteger

pmm_qan_schema

Columns and types of pmm.metrics as the connected PMM actually has them, so pmm_qan_sql queries can be written without guessing column names (they differ between PMM versions).