Skip to main content
Glama

Integration App MCP Server

Official
by membranehq
user-sessions.ts972 B
/** * Stores user sessions per chat * * @example * { * "userId": { * "chatId": "sessionId", * "chatId2": "sessionId2", * } * } */ const userSessions: Record<string, Record<string, string>> = {}; export const addToUserSessions = ({ userId, chatId, sessionId, }: { userId: string; chatId?: string; sessionId: string; }) => { if (chatId) { const currentSessionsForUser = userSessions[userId] ?? {}; userSessions[userId] = { ...currentSessionsForUser, [chatId]: sessionId, }; } }; export const removeFromUserSessions = ({ userId, chatId, sessionId, }: { userId: string; chatId?: string; sessionId: string; }) => { const currentSessionsForUser = userSessions[userId]; if (currentSessionsForUser) { delete currentSessionsForUser[chatId ?? sessionId]; userSessions[userId] = currentSessionsForUser; } }; export const getUserSessions = (userId: string) => { return userSessions[userId]; };

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/membranehq/mcp-server'

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