We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/robertn702/mcp-sunsama'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
client-resolver.ts•961 B
import { SunsamaClient } from "sunsama-api";
import { getGlobalSunsamaClient } from "../auth/stdio.js";
import type { SessionData } from "../auth/types.js";
import { getTransportConfig } from "../config/transport.js";
/**
* Gets the appropriate SunsamaClient instance based on transport type
* @param session - Session data for HTTP transport (undefined/null for stdio)
* @returns Promise<SunsamaClient> Authenticated SunsamaClient instance
* @throws {Error} If session is not available for HTTP transport or global client not initialized for stdio
*/
export async function getSunsamaClient(session?: SessionData | null): Promise<SunsamaClient> {
const transportConfig = getTransportConfig();
if (transportConfig.transportType === "httpStream") {
if (!session?.sunsamaClient) {
throw new Error("Session not available. Authentication may have failed.");
}
return session.sunsamaClient;
}
return await getGlobalSunsamaClient();
}