copy_pod_files
Copy files between Kubernetes Pods and the local machine. Read from a Pod or write to it, supporting directories and both text and binary files.
Instructions
Pod 与 MCP 客户端之间拷贝文件
Args: pod_name: Pod 名称 direction: 拷贝方向,"from_pod" 读取 Pod 文件内容,"to_pod" 将内容写入 Pod pod_paths: from_pod 时为 Pod 内文件路径(JSON 数组或单个路径,支持目录);to_pod 时为 Pod 内目标文件路径 content: to_pod 时必填(local_path 未指定时),要写入 Pod 的文件内容 encoding: to_pod 时 content 的编码方式,"text"(默认)或 "base64"(二进制文件) local_path: 本地文件路径。from_pod 时指定则直接将解码后的文件保存到此目录(二进制文件不再需要中间 base64 文件);to_pod 时指定则从此本地文件读取内容写入 Pod namespace: 命名空间,默认为 default container: 容器名称,多容器 Pod 需指定 kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用
Returns: from_pod: 文件内容或本地保存路径; to_pod: 写入确认
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| encoding | No | text | |
| pod_name | Yes | ||
| container | No | ||
| direction | Yes | ||
| namespace | No | default | |
| pod_paths | Yes | ||
| local_path | No | ||
| cluster_name | No | ||
| kubeconfig_path | No |