# devops MCP server

> Provides AI agents with real-time read and write access to Kubernetes, ArgoCD, Prometheus, PagerDuty, and Loki infrastructure.

- Repository: https://github.com/NotHarshhaa/devops-mcp
- Page: https://hostedmcp.org/servers/notharshhaa/devops-mcp
- Transport: stdio
- Stars: 4
- License: MIT
- Latest version: 2.1.1

## Install

### Claude Code

```sh
claude mcp add --env 'ARGOCD_TOKEN=<YOUR_ARGOCD_TOKEN>' --env 'LOKI_TOKEN=<YOUR_LOKI_TOKEN>' --env 'PAGERDUTY_TOKEN=<YOUR_PAGERDUTY_TOKEN>' --env 'PROMETHEUS_BEARER_TOKEN=<YOUR_PROMETHEUS_BEARER_TOKEN>' devops-mcp -- npx -y @notharshhaa/devops-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "devops-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@notharshhaa/devops-mcp"
      ],
      "env": {
        "ARGOCD_TOKEN": "<YOUR_ARGOCD_TOKEN>",
        "LOKI_TOKEN": "<YOUR_LOKI_TOKEN>",
        "PAGERDUTY_TOKEN": "<YOUR_PAGERDUTY_TOKEN>",
        "PROMETHEUS_BEARER_TOKEN": "<YOUR_PROMETHEUS_BEARER_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "devops-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@notharshhaa/devops-mcp"
      ],
      "env": {
        "ARGOCD_TOKEN": "<YOUR_ARGOCD_TOKEN>",
        "LOKI_TOKEN": "<YOUR_LOKI_TOKEN>",
        "PAGERDUTY_TOKEN": "<YOUR_PAGERDUTY_TOKEN>",
        "PROMETHEUS_BEARER_TOKEN": "<YOUR_PROMETHEUS_BEARER_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"devops-mcp","type":"stdio","command":"npx","args":["-y","@notharshhaa/devops-mcp"],"env":{"ARGOCD_TOKEN":"<YOUR_ARGOCD_TOKEN>","LOKI_TOKEN":"<YOUR_LOKI_TOKEN>","PAGERDUTY_TOKEN":"<YOUR_PAGERDUTY_TOKEN>","PROMETHEUS_BEARER_TOKEN":"<YOUR_PROMETHEUS_BEARER_TOKEN>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "devops-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@notharshhaa/devops-mcp"
      ],
      "env": {
        "ARGOCD_TOKEN": "<YOUR_ARGOCD_TOKEN>",
        "LOKI_TOKEN": "<YOUR_LOKI_TOKEN>",
        "PAGERDUTY_TOKEN": "<YOUR_PAGERDUTY_TOKEN>",
        "PROMETHEUS_BEARER_TOKEN": "<YOUR_PROMETHEUS_BEARER_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add devops-mcp --env 'ARGOCD_TOKEN=<YOUR_ARGOCD_TOKEN>' --env 'LOKI_TOKEN=<YOUR_LOKI_TOKEN>' --env 'PAGERDUTY_TOKEN=<YOUR_PAGERDUTY_TOKEN>' --env 'PROMETHEUS_BEARER_TOKEN=<YOUR_PROMETHEUS_BEARER_TOKEN>' -- npx -y @notharshhaa/devops-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.devops-mcp]
command = "npx"
args = ["-y", "@notharshhaa/devops-mcp"]

[mcp_servers.devops-mcp.env]
ARGOCD_TOKEN = "<YOUR_ARGOCD_TOKEN>"
LOKI_TOKEN = "<YOUR_LOKI_TOKEN>"
PAGERDUTY_TOKEN = "<YOUR_PAGERDUTY_TOKEN>"
PROMETHEUS_BEARER_TOKEN = "<YOUR_PROMETHEUS_BEARER_TOKEN>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'ARGOCD_TOKEN=<YOUR_ARGOCD_TOKEN>' -e 'LOKI_TOKEN=<YOUR_LOKI_TOKEN>' -e 'PAGERDUTY_TOKEN=<YOUR_PAGERDUTY_TOKEN>' -e 'PROMETHEUS_BEARER_TOKEN=<YOUR_PROMETHEUS_BEARER_TOKEN>' devops-mcp npx -- -y @notharshhaa/devops-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "devops-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@notharshhaa/devops-mcp"
      ],
      "env": {
        "ARGOCD_TOKEN": "<YOUR_ARGOCD_TOKEN>",
        "LOKI_TOKEN": "<YOUR_LOKI_TOKEN>",
        "PAGERDUTY_TOKEN": "<YOUR_PAGERDUTY_TOKEN>",
        "PROMETHEUS_BEARER_TOKEN": "<YOUR_PROMETHEUS_BEARER_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `ARGOCD_TOKEN` | no | yes | ArgoCD authentication token |
| `LOKI_TOKEN` | no | yes | Loki authentication token |
| `PAGERDUTY_TOKEN` | no | yes | PagerDuty API token |
| `PROMETHEUS_BEARER_TOKEN` | no | yes | Prometheus bearer token |
| `ARGOCD_SERVER` | no | no | ArgoCD server URL |
| `DEVOPS_MCP_AUDIT_LOG` | no | no |  |
| `DEVOPS_MCP_DRY_RUN` | no | no |  |
| `K8S_ALLOWED_NAMESPACES` | no | no |  |
| `K8S_CONTEXT` | no | no | Kubernetes context to use |
| `KUBECONFIG` | no | no | Path to Kubernetes kubeconfig file |
| `LOKI_URL` | no | no | Loki server URL |
| `MCP_ALLOWED_HOSTS` | no | no |  |
| `MCP_ALLOWED_ORIGINS` | no | no |  |
| `MCP_AUTH_TOKEN` | no | no |  |
| `MCP_CACHE_TTL_MS` | no | no |  |
| `MCP_HTTP_HOST` | no | no |  |
| `MCP_REQUEST_STATE_SECRET` | no | no |  |
| `PAGERDUTY_USER_EMAIL` | no | no | PagerDuty user email for mutations requiring From header |
| `PROMETHEUS_URL` | no | no | Prometheus server URL |

## Tools (39)

- `k8s__list_pods`
- `k8s__get_pod_logs`
- `k8s__describe_resource`
- `k8s__get_events`
- `k8s__list_deployments`
- `k8s__get_resource_usage`
- `k8s__get_node_status`
- `k8s__get_network_policies`
- `k8s__get_ingresses`
- `k8s__list_cronjobs`
- `k8s__get_cronjob_status`
- `k8s__diff_resource`
- `k8s__get_hpa`
- `k8s__list_pvcs`
- `k8s__list_services`
- `k8s__list_contexts`
- `k8s__switch_context`
- `k8s__scale_deployment`
- `k8s__apply_manifest`
- `k8s__rollout_restart`
- `k8s__delete_resource`
- `argo__list_apps`
- `argo__get_app`
- `argo__get_app_diff`
- `argo__get_app_history`
- `argo__get_resource_tree`
- `argo__sync_app`
- `argo__rollback_app`
- `argo__terminate_op`
- `prom__query`
- `prom__query_range`
- `prom__list_alerts`
- `prom__get_firing_alerts`
- `prom__list_targets`
- `prom__label_values`
- `prom__metric_metadata`
- `prom__compare_periods`
- `prom__slo_status`
- `prom__summarize_service_health`

## FAQ

### How can I prevent the AI from making accidental changes?

You can enable a global dry run mode by setting the DEVOPS_MCP_DRY_RUN environment variable to true.

### Does the server support different safety levels for tools?

Yes, tools follow a three-tier safety model: Read (safe), Mutate (defaults to dry-run), and Destructive (requires confirmation).
