UNPKG

xmcp

Version:

The TypeScript MCP framework

29 lines (28 loc) • 966 B
/** * A header with a static value (use only for non-sensitive values) */ export interface StaticHeader { name: string; value: string; } /** * A header that reads its value from an environment variable at runtime. * Use this for sensitive values like API keys and authorization tokens. */ export interface EnvHeader { name: string; /** The name of the environment variable to read at runtime */ env: string; } export type CustomHeader = StaticHeader | EnvHeader; export type CustomHeaders = CustomHeader[]; export declare const createEmptyHeader: () => StaticHeader; /** * Check if a header uses an environment variable reference */ export declare const isEnvHeader: (header: CustomHeader) => header is EnvHeader; /** * Converts CustomHeaders to a Record, resolving environment variables at runtime. * Throws if a required env var is not set. */ export declare const headersToRecord: (headers: CustomHeaders) => Record<string, string>;