Skip to main content
Glama

InfraClaude

Give Claude superpowers over your infrastructure — MCP Server for Kubernetes, Docker, Terraform, Prometheus, and Security tools.

CI License: MIT MCP Compatible TypeScript

InfraClaude is an MCP (Model Context Protocol) server that exposes infrastructure management tools to Claude. Through InfraClaude, Claude Code can query Kubernetes clusters, manage Docker containers, check Prometheus metrics, run Terraform plans, and perform security scans — all through natural language.

Architecture

┌─────────────────────────────────────────────────────────┐
│                Claude Code / Claude Desktop              │
│                                                          │
│  User: "Check if any pods are crashlooping"             │
│                         │                                │
│                    MCP Client                            │
└─────────────────────────┼────────────────────────────────┘
                          │ MCP Protocol (stdio)
                          ▼
┌─────────────────────────────────────────────────────────┐
│                 InfraClaude MCP Server                    │
│                                                          │
│  ┌───────────┐ ┌──────────┐ ┌────────────┐             │
│  │ Kubernetes │ │  Docker  │ │ Prometheus │             │
│  │  16 tools  │ │  9 tools │ │  5 tools   │             │
│  └───────────┘ └──────────┘ └────────────┘             │
│  ┌───────────┐ ┌──────────┐ ┌────────────┐             │
│  │ Terraform │ │ Security │ │   System   │             │
│  │  5 tools  │ │  3 tools │ │  4 tools   │             │
│  └───────────┘ └──────────┘ └────────────┘             │
│                                                          │
│  Safety Layer: Command Guard → RBAC → Audit Logger      │
└─────────────────────────────────────────────────────────┘

Plus: Claude Code Hooks + Custom Skills

Related MCP server: AWS Sage

Features

  • 42+ infrastructure tools across Kubernetes, Docker, Prometheus, Terraform, Security, and System

  • Safety-first design — 4-tier risk classification (Safe → Caution → Dangerous → Blocked)

  • Audit logging — every operation logged for compliance

  • Claude Code hooks — pre/post tool-use safety checks and automation

  • Custom skills — K8s troubleshooting, incident response, Docker debugging, security review

  • MCP resources — cluster info, service health, infrastructure summary

  • MCP prompts — guided troubleshooting, capacity planning, security audit workflows

Quick Start

# Clone and build
git clone https://github.com/batu-sonmez/infraclaude.git
cd infraclaude
npm install
npm run build

# Add to Claude Code (~/.claude/claude_code_config.json)
{
  "mcpServers": {
    "infraclaude": {
      "command": "node",
      "args": ["/path/to/infraclaude/dist/index.js"],
      "env": {
        "KUBECONFIG": "~/.kube/config",
        "PROMETHEUS_URL": "http://localhost:9090"
      }
    }
  }
}

Then in Claude Code:

"Show me all pods in production"
"Why is my pod crashing?"
"Run a security audit on the default namespace"
"What's the CPU usage of my cluster?"
"Scan the nginx:latest image for vulnerabilities"

Demo

Set up a local demo environment with intentionally broken pods:

make demo-setup

Then try the demo scenarios.

Safety Model

InfraClaude classifies every operation by risk level:

Level

Action

Example

Safe

Always allowed

k8s_get_pods, prom_instant_query

Caution

Allowed with warning

k8s_scale_deployment

Dangerous

Requires confirmation

k8s_delete_pod

Blocked

Never allowed

k8s_delete_namespace, terraform_apply

System namespaces (kube-system, kube-public) have additional protections.

See Safety Documentation for details.

Documentation

Tech Stack

Component

Technology

MCP Server

TypeScript + @modelcontextprotocol/sdk

Kubernetes

@kubernetes/client-node

Docker

dockerode

Prometheus

Native fetch API

Terraform

CLI wrapper

Security

Trivy, Gitleaks CLI

Testing

Vitest

CI/CD

GitHub Actions

License

MIT — see LICENSE.

Available Tools

43 tools
docker_compose_logsB

Show logs from Docker Compose services

Inputs: directory, service, tail.

docker_compose_psC

Show status of Docker Compose services

Inputs: directory.

docker_container_logsC

Fetch logs from a Docker container

Inputs: id (required), tail, since.

docker_container_statsC

Get real-time CPU, memory, and network stats for a container

Inputs: id (required).

docker_inspect_containerC

Get detailed information about a Docker container

Inputs: id (required).

docker_inspect_imageC

Get detailed information about a Docker image

Inputs: name (required).

docker_inspect_networkA

Get detailed info about a Docker network including connected containers

Inputs: id (required).

docker_list_containersB

List Docker containers with their status, image, and ports

Inputs: all.

docker_list_imagesB

List local Docker images with repository, tag, and size

Inputs: all.

docker_list_networksB

List Docker networks with driver and scope

Inputs: no named parameters.

k8s_cordon_nodeA

Mark a node as unschedulable (cordon) — prevents new pods from being scheduled

Inputs: name (required).

k8s_delete_podA

Delete a specific pod (it will be recreated if managed by a controller)

Inputs: name (required), namespace.

k8s_describe_nodeB

Get detailed node info including capacity, allocatable resources, conditions, and taints

Inputs: name (required).

k8s_describe_podB

Get detailed information about a specific pod including containers, resources, and events

Inputs: name (required), namespace.

k8s_get_deploymentsB

List deployments with replica status, strategy, and age

Inputs: namespace, label_selector.

k8s_get_eventsC

List cluster events filtered by namespace and type (Normal/Warning)

Inputs: namespace, type, field_selector, limit.

k8s_get_nodesA

List all cluster nodes with status, roles, and version

Inputs: no named parameters.

k8s_get_pod_logsC

Fetch logs from a pod with options for tail lines, time range, and container selection

Inputs: name (required), namespace, container, tail, +2 more.

k8s_get_podsB

List pods in a Kubernetes namespace with their status, restarts, and age

Inputs: namespace, label_selector, field_selector.

k8s_get_servicesB

List services with type, cluster IP, ports, and age

Inputs: namespace.

k8s_rollback_deploymentC

Rollback a deployment to the previous revision

Inputs: name (required), namespace.

k8s_rollout_statusC

Check the rollout status of a deployment

Inputs: name (required), namespace.

k8s_scale_deploymentC

Scale a deployment to a specified number of replicas

Inputs: name (required), replicas (required), namespace.

k8s_top_nodesA

Show CPU and memory usage for all cluster nodes (requires metrics-server)

Inputs: no named parameters.

k8s_top_podsA

Show CPU and memory usage for pods (requires metrics-server)

Inputs: namespace.

k8s_uncordon_nodeA

Mark a node as schedulable (uncordon) — re-enables pod scheduling

Inputs: name (required).

prom_active_alertsA

List all currently firing Prometheus alerts

Inputs: no named parameters.

prom_alert_rulesA

List all Prometheus alert rules and their current state

Inputs: no named parameters.

prom_instant_queryC

Execute a PromQL instant query and return current values

Inputs: query (required).

prom_range_queryB

Execute a PromQL query over a time range and return series data

Inputs: query (required), start, end, step.

prom_targetsB

Show Prometheus scrape target health status

Inputs: no named parameters.

security_gitleaks_scanC

Scan a directory for leaked secrets and credentials using Gitleaks

Inputs: directory.

security_k8s_auditB

Audit Kubernetes namespace for security misconfigurations (privileged containers, missing limits, RBAC issues)

Inputs: namespace.

security_trivy_scanC

Scan a container image for vulnerabilities using Trivy

Inputs: image (required), severity.

system_disk_usageC

Show disk usage for the system or a specific path

Inputs: path.

system_logsC

Read system logs from journalctl or a log file

Inputs: unit, lines, path.

system_network_connectionsC

Show active network connections and listening ports

Inputs: state.

system_processesC

List top processes sorted by CPU or memory usage

Inputs: sort_by, limit.

terraform_outputB

Read Terraform output values

Inputs: directory (required), name.

terraform_planA

Run terraform plan to preview infrastructure changes (read-only, safe)

Inputs: directory (required).

terraform_state_listB

List all resources in the Terraform state

Inputs: directory (required).

terraform_state_showB

Show details of a specific resource in Terraform state

Inputs: directory (required), resource (required).

terraform_validateC

Validate Terraform configuration and check formatting

Inputs: directory (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 43 tools

    Disambiguation4/5

    Most tools have distinct purposes with clear boundaries between domains (Docker, Kubernetes, Prometheus, Security, System, Terraform). However, there is some overlap between docker_compose_logs and docker_container_logs, and between k8s_get_pods and k8s_describe_pod, which could cause minor confusion. Overall, the descriptions help clarify differences, but the sheer number of tools increases cognitive load.

    Naming Consistency5/5

    Tool names follow a highly consistent snake_case pattern with clear domain prefixes (docker_, k8s_, prom_, security_, system_, terraform_) and descriptive verb_noun combinations. This predictable structure makes it easy to understand each tool's purpose and domain at a glance, with no deviations in naming conventions.

    Tool Count2/5

    With 43 tools, this server feels overloaded for a single MCP server. While the tools cover multiple infrastructure domains, the count is excessive and will overwhelm agents. A more focused approach with separate servers for Docker, Kubernetes, monitoring, etc., would be more appropriate. The scope is too broad for effective tool selection.

    Completeness4/5

    Within each domain, the tool coverage is quite comprehensive. Docker has inspection, listing, and monitoring tools; Kubernetes covers pod management, scaling, rollouts, and monitoring; Prometheus includes queries and alerts; Security has scanning tools; System provides diagnostics; and Terraform covers state and planning. Minor gaps exist (e.g., no Docker container creation/management, no Kubernetes pod creation), but agents can work around these given the broad coverage.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A production-ready MCP server ecosystem providing Claude AI with 150+ specialized tools across enhanced memory, data analytics, security, design, and infrastructure domains with PostgreSQL, Redis, Qdrant, and Docker orchestration.
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      A unified MCP server for AWS that enables natural language infrastructure management, cross-service resource discovery, and dependency mapping. It features 30 intelligent tools for cost optimization, incident investigation, and multi-account operations protected by a robust safety system.
      30
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      An AI-DevOps MCP server that gives LLMs read-only-by-default access to Kubernetes clusters, Prometheus metrics, and GitHub Actions, enabling natural language queries about infrastructure status and safe write operations with previews.
      MIT