(extra?: Record<string, string>)
| 34 | private initPromise: Promise<void> | null = null; |
| 35 | |
| 36 | private buildHeaders(extra?: Record<string, string>): Record<string, string> { |
| 37 | const headers: Record<string, string> = { |
| 38 | "Content-Type": "application/json", |
| 39 | ...extra, |
| 40 | }; |
| 41 | const key = getApiKey(); |
| 42 | if (key) headers["Authorization"] = `Bearer ${key}`; |
| 43 | if (this.sessionId) headers["mcp-session-id"] = this.sessionId; |
| 44 | return headers; |
| 45 | } |
| 46 | |
| 47 | private async doInitialize(): Promise<void> { |
| 48 | const res = await fetch(`${getBaseUrl()}/mcp`, { |
no test coverage detected