export type GetApiMcpOptions = {baseUrl?: string | undefined, McpOAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * MCP GET sessions are not enabled in V1. * * GET /mcp */ export const getApiMcp = async (options?: GetApiMcpOptions) => { const {baseUrl = "https://api.traxy.ai/api/v1", fetch: fetchFn = fetch, McpOAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (McpOAuth !== undefined) headers.set('authorization', `Bearer ${McpOAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/mcp${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };