(token: string, body: unknown, sessionId?: string, browser = false)
| 59 | }; |
| 60 | |
| 61 | const mcp = (token: string, body: unknown, sessionId?: string, browser = false) => |
| 62 | handler( |
| 63 | new Request(`${BASE}/mcp${browser ? "?elicitation_mode=browser" : ""}`, { |
| 64 | method: "POST", |
| 65 | headers: { |
| 66 | authorization: `Bearer ${token}`, |
| 67 | "content-type": "application/json", |
| 68 | accept: "application/json, text/event-stream", |
| 69 | ...(sessionId ? { "mcp-session-id": sessionId } : {}), |
| 70 | }, |
| 71 | body: JSON.stringify(body), |
| 72 | }), |
| 73 | ); |
| 74 | |
| 75 | const initSession = async (token: string, browser = false): Promise<string> => { |
| 76 | const res = await mcp( |
no test coverage detected