Create the appropriate TransportOptions object for the selected transport

* In useConnection.ts

  - In the case for "stdio", let the transportOptions be the same as "sse"
 because it will use that transport to the proxy regardless
This commit is contained in:
cliffhall
2025-05-02 17:50:00 -04:00
parent b7ec3829d4
commit f9cbfbe822

View File

@@ -312,7 +312,18 @@ export function useConnection({
mcpProxyServerUrl.searchParams.append("command", command); mcpProxyServerUrl.searchParams.append("command", command);
mcpProxyServerUrl.searchParams.append("args", args); mcpProxyServerUrl.searchParams.append("args", args);
mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env)); mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
transportOptions = {}; transportOptions = {
authProvider: serverAuthProvider,
eventSourceInit: {
fetch: (
url: string | URL | globalThis.Request,
init: RequestInit | undefined,
) => fetch(url, { ...init, headers }),
},
requestInit: {
headers,
},
};
break; break;
case "sse": case "sse":