UNPKG

mcp-server-kubernetes

Version:

MCP server for interacting with Kubernetes clusters via kubectl

88 lines (87 loc) 3.15 kB
import { KubernetesManager } from "../types.js"; export declare const kubectlLogsSchema: { readonly name: "kubectl_logs"; readonly description: "Get logs from Kubernetes resources like pods, deployments, or jobs"; readonly annotations: { readonly readOnlyHint: true; }; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly resourceType: { readonly type: "string"; readonly enum: readonly ["pod", "deployment", "job", "cronjob"]; readonly description: "Type of resource to get logs from"; }; readonly name: { readonly type: "string"; readonly description: "Name of the resource"; }; readonly namespace: { type: "string"; description: string; default: string; }; readonly container: { readonly type: "string"; readonly description: "Container name (required when pod has multiple containers)"; }; readonly tail: { readonly type: "number"; readonly description: "Number of lines to show from end of logs"; }; readonly since: { readonly type: "string"; readonly description: "Show logs since relative time (e.g. '5s', '2m', '3h')"; }; readonly sinceTime: { readonly type: "string"; readonly description: "Show logs since absolute time (RFC3339)"; }; readonly timestamps: { readonly type: "boolean"; readonly description: "Include timestamps in logs"; readonly default: false; }; readonly previous: { readonly type: "boolean"; readonly description: "Include logs from previously terminated containers"; readonly default: false; }; readonly follow: { readonly type: "boolean"; readonly description: "Follow logs output (not recommended, may cause timeouts)"; readonly default: false; }; readonly labelSelector: { readonly type: "string"; readonly description: "Filter resources by label selector"; }; readonly context: { type: "string"; description: string; default: string; }; }; readonly required: readonly ["resourceType", "name", "namespace"]; }; }; export declare function kubectlLogs(k8sManager: KubernetesManager, input: { resourceType: string; name: string; namespace: string; container?: string; tail?: number; since?: string; sinceTime?: string; timestamps?: boolean; previous?: boolean; follow?: boolean; labelSelector?: string; context?: string; }): Promise<{ content: { type: string; text: string; }[]; }>;