Skip to content

Commit 1c46ec7

Browse files
committed
feat(kubevirt): add vm_guest_info tool for QEMU guest agent access
Add new vm_guest_info tool that enables querying information from inside VirtualMachines using the QEMU guest agent, without requiring SSH access or credentials. The tool supports querying: - os: Operating system information (name, version, kernel, hostname) - filesystem: Mounted filesystems and disk usage - network: Network interfaces and IP addresses - users: Currently logged-in users and sessions This provides a secure way to gather runtime information from VMs for monitoring, troubleshooting, and compliance purposes. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Ben Oukhanov <boukhanov@redhat.com>
1 parent c863a2e commit 1c46ec7

10 files changed

Lines changed: 1193 additions & 18 deletions

File tree

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,13 @@ For a secure production setup with dedicated ServiceAccount and read-only access
7777
If you have npm installed, this is the fastest way to get started with `kubernetes-mcp-server` on Claude Desktop.
7878

7979
Open your `claude_desktop_config.json` and add the mcp server to the list of `mcpServers`:
80-
``` json
80+
81+
```json
8182
{
8283
"mcpServers": {
8384
"kubernetes": {
8485
"command": "npx",
85-
"args": [
86-
"-y",
87-
"kubernetes-mcp-server@latest"
88-
]
86+
"args": ["-y", "kubernetes-mcp-server@latest"]
8987
}
9088
}
9189
}
@@ -135,14 +133,14 @@ Alternatively, you can install the extension manually by editing the `mcp.json`
135133
If you have npm installed, this is the fastest way to get started with `kubernetes-mcp-server`.
136134

137135
Open your goose `config.yaml` and add the mcp server to the list of `mcpServers`:
136+
138137
```yaml
139138
extensions:
140139
kubernetes:
141140
command: npx
142141
args:
143142
- -y
144143
- kubernetes-mcp-server@latest
145-
146144
```
147145
148146
## 🎥 Demos <a id="demos"></a>
@@ -193,11 +191,11 @@ uvx kubernetes-mcp-server@latest --help
193191
### Configuration Options
194192

195193
| Option | Description |
196-
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
194+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197195
| `--port` | Starts the MCP server in Streamable HTTP mode (path /mcp) and Server-Sent Event (SSE) (path /sse) mode and listens on the specified port . |
198196
| `--log-level` | Sets the logging level (values [from 0-9](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md)). Similar to [kubectl logging levels](https://kubernetes.io/docs/reference/kubectl/quick-reference/#kubectl-output-verbosity-and-debugging). |
199197
| `--config` | (Optional) Path to the main TOML configuration file. See [Configuration Reference](docs/configuration.md) for details. |
200-
| `--config-dir` | (Optional) Path to drop-in configuration directory. Files are loaded in lexical (alphabetical) order. Defaults to `conf.d` relative to the main config file if `--config` is specified. See [Configuration Reference](docs/configuration.md) for details. |
198+
| `--config-dir` | (Optional) Path to drop-in configuration directory. Files are loaded in lexical (alphabetical) order. Defaults to `conf.d` relative to the main config file if `--config` is specified. See [Configuration Reference](docs/configuration.md) for details. |
201199
| `--kubeconfig` | Path to the Kubernetes configuration file. If not provided, it will try to resolve the configuration (in-cluster, default location, etc.). |
202200
| `--list-output` | Output format for resource list operations (one of: yaml, table) (default "table") |
203201
| `--read-only` | If set, the MCP server will run in read-only mode, meaning it will not allow any write operations (create, update, delete) on the Kubernetes cluster. This is useful for debugging or inspecting the cluster without making changes. |
@@ -235,6 +233,7 @@ endpoint = "http://localhost:4317"
235233
```
236234

237235
For comprehensive TOML configuration documentation, including:
236+
238237
- All configuration options and their defaults
239238
- Drop-in configuration files for modular settings
240239
- Dynamic configuration reload via SIGHUP
@@ -266,7 +265,7 @@ The following sets of tools are available (toolsets marked with ✓ in the Defau
266265
<!-- AVAILABLE-TOOLSETS-START -->
267266

268267
| Toolset | Description | Default |
269-
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
268+
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
270269
| config | View and manage the current local Kubernetes configuration (kubeconfig) | ✓ |
271270
| core | Most common tools for Kubernetes management (Pods, Generic Resources, Events, etc.) | ✓ |
272271
| helm | Tools for managing Helm charts and releases | |
@@ -362,26 +361,26 @@ In case multi-cluster support is enabled (default) and you have access to multip
362361
- `port` (`number`) - TCP/IP port to expose from the Pod container (Optional, no port exposed if not provided)
363362

364363
- **resources_list** - List Kubernetes resources and objects in the current cluster by providing their apiVersion and kind and optionally the namespace and label selector
365-
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
364+
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
366365
- `apiVersion` (`string`) **(required)** - apiVersion of the resources (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)
367366
- `fieldSelector` (`string`) - Optional Kubernetes field selector to filter resources by field values (e.g. 'status.phase=Running', 'metadata.name=myresource'). Supported fields vary by resource type. For Pods: metadata.name, metadata.namespace, spec.nodeName, spec.restartPolicy, spec.schedulerName, spec.serviceAccountName, status.phase (Pending/Running/Succeeded/Failed/Unknown), status.podIP, status.nominatedNodeName. See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/
368367
- `kind` (`string`) **(required)** - kind of the resources (examples of valid kind are: Pod, Service, Deployment, Ingress)
369368
- `labelSelector` (`string`) - Optional Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the resources by label
370369
- `namespace` (`string`) - Optional Namespace to retrieve the namespaced resources from (ignored in case of cluster scoped resources). If not provided, will list resources from all namespaces
371370

372371
- **resources_get** - Get a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name
373-
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
372+
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
374373
- `apiVersion` (`string`) **(required)** - apiVersion of the resource (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)
375374
- `kind` (`string`) **(required)** - kind of the resource (examples of valid kind are: Pod, Service, Deployment, Ingress)
376375
- `name` (`string`) **(required)** - Name of the resource
377376
- `namespace` (`string`) - Optional Namespace to retrieve the namespaced resource from (ignored in case of cluster scoped resources). If not provided, will get resource from configured namespace
378377

379378
- **resources_create_or_update** - Create or update a Kubernetes resource in the current cluster by providing a YAML or JSON representation of the resource
380-
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
379+
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
381380
- `resource` (`string`) **(required)** - A JSON or YAML containing a representation of the Kubernetes resource. Should include top-level fields such as apiVersion,kind,metadata, and spec
382381

383382
- **resources_delete** - Delete a Kubernetes resource in the current cluster by providing its apiVersion, kind, optionally the namespace, and its name
384-
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
383+
(common apiVersion and kind include: v1 Pod, v1 Service, v1 Node, apps/v1 Deployment, networking.k8s.io/v1 Ingress, route.openshift.io/v1 Route)
385384
- `apiVersion` (`string`) **(required)** - apiVersion of the resource (examples of valid apiVersion are: v1, apps/v1, networking.k8s.io/v1)
386385
- `gracePeriodSeconds` (`integer`) - Optional duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used
387386
- `kind` (`string`) **(required)** - kind of the resource (examples of valid kind are: Pod, Service, Deployment, Ingress)
@@ -531,6 +530,11 @@ In case multi-cluster support is enabled (default) and you have access to multip
531530
- `storage` (`string`) - Optional storage size for the VM's root disk when using DataSources (e.g., '30Gi', '50Gi', '100Gi'). Defaults to 30Gi. Ignored when using container disks.
532531
- `workload` (`string`) - The workload for the VM. Accepts OS names (e.g., 'fedora' (default), 'ubuntu', 'centos', 'centos-stream', 'debian', 'rhel', 'opensuse', 'opensuse-tumbleweed', 'opensuse-leap') or full container disk image URLs
533532

533+
- **vm_guest_info** - Get guest operating system information from a VirtualMachine's QEMU guest agent. Requires the guest agent to be installed and running inside the VM. Provides detailed information about the OS, filesystems, network interfaces, and logged-in users.
534+
- `info_type` (`string`) - Type of information to retrieve: 'all' (default - all available info), 'os' (operating system details), 'filesystem' (disk and filesystem info), 'users' (logged-in users), 'network' (network interfaces and IPs)
535+
- `name` (`string`) **(required)** - The name of the virtual machine
536+
- `namespace` (`string`) **(required)** - The namespace of the virtual machine
537+
534538
- **vm_lifecycle** - Manage KubeVirt VirtualMachine lifecycle: start, stop, or restart a VM
535539
- `action` (`string`) **(required)** - The lifecycle action to perform: 'start' (changes runStrategy to Always), 'stop' (changes runStrategy to Halted), or 'restart' (stops then starts the VM)
536540
- `name` (`string`) **(required)** - The name of the virtual machine
@@ -567,7 +571,6 @@ In case multi-cluster support is enabled (default) and you have access to multip
567571

568572
</details>
569573

570-
571574
<!-- AVAILABLE-TOOLSETS-TOOLS-END -->
572575

573576
### Prompts
@@ -594,21 +597,18 @@ In case multi-cluster support is enabled (default) and you have access to multip
594597

595598
</details>
596599

597-
598600
<!-- AVAILABLE-TOOLSETS-PROMPTS-END -->
599601

600602
### Resources
601603

602604
<!-- AVAILABLE-TOOLSETS-RESOURCES-START -->
603605

604-
605606
<!-- AVAILABLE-TOOLSETS-RESOURCES-END -->
606607

607608
### Resource Templates
608609

609610
<!-- AVAILABLE-TOOLSETS-RESOURCES-TEMPLATES-START -->
610611

611-
612612
<!-- AVAILABLE-TOOLSETS-RESOURCES-TEMPLATES-END -->
613613

614614
## Helm Chart

0 commit comments

Comments
 (0)