Skip to main content
Glama
EKS Metrics MCP Server

EKS Metrics MCP Server

by normalzzz

EKS Metrics MCP Server

Python MCP server for querying Amazon EKS cluster metrics.

Implemented now:

  • Kubernetes API server /metrics, equivalent to kubectl get --raw /metrics

  • Metric filtering by exact metric name, metric name regex, and labels

  • A source selector that currently supports api_server and reserves cloudwatch

CloudWatch metric collection is intentionally left as a future extension.

Install

python3.11 -m pip install -e .

The MCP Python SDK requires Python 3.10 or newer. If python points to Python 3.9, use python3.11 or another Python 3.10+ interpreter in both installation and MCP client configuration.

The server uses the Kubernetes Python client. Authentication follows the same configuration sources as kubectl:

  • In-cluster service account credentials when running inside Kubernetes

  • Local kubeconfig from KUBECONFIG or ~/.kube/config

  • Optional per-call kube_context and kubeconfig_path tool arguments

The Kubernetes identity must be allowed to call the API server non-resource URL /metrics.

Related MCP server: MCP Datadog Playcourt

Run

eks-metrics-mcp-server

or:

python3.11 -m eks_metrics_mcp_server.server

Codex MCP config

[mcp_servers.eks-metrics]
enabled = true
command = "python3.11"
args = ["-m", "eks_metrics_mcp_server.server"]
cwd = "/root/eks-metrics-server/eks-metrics-mcp-server"

[mcp_servers.eks-metrics.env]
PYTHONPATH = "/root/eks-metrics-server/eks-metrics-mcp-server/src"

MCP Tools

get_eks_metrics

Fetch metrics from the selected source.

Important arguments:

  • source: api_server or cloudwatch; only api_server is implemented

  • metric_name: exact Prometheus metric name

  • metric_name_pattern: regular expression for metric names

  • label_selectors: label key/value filters

  • limit: maximum returned samples

  • include_raw: include original Prometheus sample line

  • kube_context: kubeconfig context to use

  • kubeconfig_path: kubeconfig path to use

Example metric names from Kubernetes API server metrics include apiserver_request_total, apiserver_request_duration_seconds_bucket, and apiserver_current_inflight_requests.

list_api_server_metric_names

Return metric names available from /metrics, including type/help metadata and sample counts.

Kubernetes RBAC

For an in-cluster deployment, bind a service account to a role that can read the /metrics non-resource URL:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: eks-metrics-mcp-api-server-metrics
rules:
  - nonResourceURLs:
      - /metrics
    verbs:
      - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: eks-metrics-mcp-api-server-metrics
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: eks-metrics-mcp-api-server-metrics
subjects:
  - kind: ServiceAccount
    name: eks-metrics-mcp
    namespace: default

Available Tools

2 tools
get_eks_metricsC

Fetch EKS metrics from api_server or cloudwatch.

The api_server source calls Kubernetes API server /metrics, equivalent to kubectl get --raw /metrics. CloudWatch is reserved for a future implementation step.

Inputs: limit, source, include_raw, metric_name, +6 more. Returns: result

list_api_server_metric_namesC

List metric names exposed by Kubernetes API server /metrics.

Inputs: kube_context, kubeconfig_path, timeout_seconds, metric_name_pattern. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 2 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose: one fetches actual metrics data, the other lists available metric names. No overlap or ambiguity.

    Naming Consistency5/5

    Both tools use consistent snake_case verb_noun pattern: get_eks_metrics and list_api_server_metric_names. Naming is predictable and uniform.

    Tool Count4/5

    With 2 tools, the server is minimal but well-scoped for its purpose of EKS metrics retrieval. It slightly edges into 'thin' territory but is still reasonable.

    Completeness3/5

    Core operations (fetch metrics, list names) are present, but there are notable gaps like filtering, aggregation, or time-range queries. CloudWatch support is missing.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      Enables access to Amazon Managed Prometheus workspaces through natural language queries. Supports listing workspaces, executing PromQL queries, and retrieving workspace details and metrics with AWS authentication.
      4
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables monitoring and querying of Datadog metrics for Kubernetes clusters, APM traces, infrastructure hosts, and databases through a unified interface.
      -
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to execute PromQL queries and discover metrics within AWS Managed Prometheus (AMP) using SigV4 authentication. It provides tools for instant and range queries, label management, and metric discovery in secure, VPC-isolated environments.
      MIT