Skip to main content
Glama
ConnectionManager.tsx729 B
import { useEffect } from "react"; import { useAuth } from "@/contexts/useAuth"; import { useSocketStore } from "@/store"; export function ConnectionManager() { const { loginRequired, isAuthenticated } = useAuth(); const connect = useSocketStore((s) => s.connect); const disconnect = useSocketStore((s) => s.disconnect); useEffect(() => { // If enterprise is enabled (loginRequired), we wait for authentication if (loginRequired && !isAuthenticated) { disconnect(); return; } // Connect if not enterprise (local) or if authenticated enterprise user connect(); return () => { disconnect(); }; }, [loginRequired, isAuthenticated, connect, disconnect]); return null; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server