flink-mcp-server

v0.4.4
flink-mcp-server Checked 3 days ago Published 1 month ago

Platform-independent, read-only MCP server for monitoring Apache Flink clusters via the REST API

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

list_clusters

Flink clusters from the config file and, if enabled, discovered in Kubernetes (names and URLs, never credentials). `discovery_error` explains a failed discovery.

fleet_overview

Overview of every configured cluster in one call; unreachable clusters are reported with an error instead of failing the whole call.

diagnose_deployment

Kubernetes/operator-level health of one FlinkDeployment: operator errors, JobManager state and its pods (CrashLoopBackOff, OOMKilled, image pull errors, unschedulable). Use diagnose_job for problems inside a running job.

ParameterTypeDescription
name *string
namespace *string

cluster_overview

Flink version, TaskManager/slot counts and job counts by state.

ParameterTypeDescription
cluster

list_jobs

All jobs (running and recently finished) with state and duration.

ParameterTypeDescription
cluster

job_details

State and per-vertex status/parallelism of one job.

ParameterTypeDescription
job_id *string
cluster

job_exceptions

Root exception and the most recent entries of the job's exception history.

ParameterTypeDescription
job_id *string
cluster
limitinteger

checkpoint_stats

Checkpoint counts, failure rate, last completed/failed checkpoint.

ParameterTypeDescription
job_id *string
cluster

backpressure

Per-vertex backpressure (avg ms/s backpressured, busy, idle) for a job.

ParameterTypeDescription
job_id *string
cluster

vertex_metrics

Operator/task metrics of a job's vertices (all of them, or one vertex_id from job_details), aggregated over subtasks as min/max/avg. Without names it lists the metric ids (narrow with search, e.g. "lag"). A name may omit the operator prefix: "currentFetchEventTimeLag" matches "Source__<name>.currentFetchEventTimeLag".

ParameterTypeDescription
job_id *string
cluster
names
search
vertex_id

list_savepoints

Savepoints of a job, the latest completed checkpoint, and what the job was restored from, each with its storage path. Use it to find where a job can be restarted from; paths are only present for savepoints and for checkpoints retained on cancellation.

ParameterTypeDescription
job_id *string
cluster

job_timeline

What happened to a job and when, oldest first: the latest time it entered each state, recorded failures (exception history), failed checkpoints, savepoints and restores, and, for Kubernetes clusters, operator and pod events. Flink keeps no event log, so the result lists its `coverage` limits and any source that could not be read; a restart is shown only when a recorded failure or restore proves it. Keeps the most recent `limit` events.

ParameterTypeDescription
job_id *string
cluster
limitinteger

diagnose_job

One-call health verdict for a job: combines state, task status, exceptions, checkpoints, backpressure and source lag into ranked findings. Start here when asked "why is this job unhealthy/slow?". When Prometheus is configured it also reports trends over the last `history` (default "1h"; "off" to skip): restarts, checkpoint failures and durations, sustained backpressure. Those are observations with their metric and window, not causes; a Prometheus problem never changes the live diagnosis.

ParameterTypeDescription
job_id *string
cluster
historystring

taskmanagers

TaskManagers with slot usage and resources.

ParameterTypeDescription
cluster

list_log_files

Log files of the JobManager, or of one TaskManager when `taskmanager_id` is given (ids come from `taskmanagers`).

ParameterTypeDescription
cluster
taskmanager_id

get_logs

Tail of a Flink log: the JobManager's, or one TaskManager's when `taskmanager_id` is given. `level` ("WARN", "ERROR", ...) keeps only entries at that level or above, each with its stack trace; `search` keeps entries containing the text (case-insensitive). `file` defaults to the newest *.log; see `list_log_files`. The result also counts the warnings and errors in the whole file, so a clean tail of a noisy file is not mistaken for a clean log.

ParameterTypeDescription
cluster
file
level
linesinteger
search
taskmanager_id

job_metrics

Job-level metrics. Give `names` to read values; omit it to list the available metric ids (narrow them with `search`, e.g. "checkpoint"). Flink fetches metrics lazily, so right after a job starts the first answer can take a couple of seconds.

ParameterTypeDescription
job_id *string
cluster
names
search

list_jars

JAR files uploaded to the cluster with their entry classes.

ParameterTypeDescription
cluster

cluster_config

JobManager configuration (secrets are masked by Flink). Use `search` to filter keys, e.g. "checkpoint" or "state.backend".

ParameterTypeDescription
cluster
search

job_config

Execution configuration of a job.

ParameterTypeDescription
job_id *string
cluster