mcp-server-kubernetes
Version:
MCP server for interacting with Kubernetes clusters via kubectl
20 lines (19 loc) • 744 B
TypeScript
import { Request, Response, NextFunction } from "express";
/**
* Authentication middleware for MCP HTTP transports.
*
* When the MCP_AUTH_TOKEN environment variable is set, this middleware
* requires all requests to include a matching X-MCP-AUTH header.
*
* This provides a simple authentication mechanism for securing MCP endpoints
* in cluster environments where full OAuth may be overkill.
*
* Example usage:
* Server: MCP_AUTH_TOKEN=my-secret-token
* Client: X-MCP-AUTH: my-secret-token
*/
export declare function createAuthMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
/**
* Returns whether authentication is enabled (MCP_AUTH_TOKEN is set)
*/
export declare function isAuthEnabled(): boolean;