MCPcopy Index your code
hub / github.com/codeaashu/claude-code / ensureTransport

Function ensureTransport

src/services/mcp/utils.ts:313–323  ·  view source on GitHub ↗
(type?: string)

Source from the content-addressed store, hash-verified

311}
312
313export function ensureTransport(type?: string): 'stdio' | 'sse' | 'http' {
314 if (!type) return 'stdio'
315
316 if (type !== 'stdio' && type !== 'sse' && type !== 'http') {
317 throw new Error(
318 `Invalid transport type: ${type}. Must be one of: stdio, sse, http`,
319 )
320 }
321
322 return type as 'stdio' | 'sse' | 'http'
323}
324
325export function parseHeaders(headerArray: string[]): Record<string, string> {
326 const headers: Record<string, string> = {}

Callers 1

registerMcpAddCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected