( serverName: string, config: McpSSEServerConfig | McpHTTPServerConfig | McpWebSocketServerConfig, )
| 123 | * @returns Combined headers object |
| 124 | */ |
| 125 | export async function getMcpServerHeaders( |
| 126 | serverName: string, |
| 127 | config: McpSSEServerConfig | McpHTTPServerConfig | McpWebSocketServerConfig, |
| 128 | ): Promise<Record<string, string>> { |
| 129 | const staticHeaders = config.headers || {} |
| 130 | const dynamicHeaders = |
| 131 | (await getMcpHeadersFromHelper(serverName, config)) || {} |
| 132 | |
| 133 | // Dynamic headers override static headers if both are present |
| 134 | return { |
| 135 | ...staticHeaders, |
| 136 | ...dynamicHeaders, |
| 137 | } |
| 138 | } |
| 139 |
no test coverage detected