Skip to main content
Glama

Carbon Voice

by PhononX
get-or-create-session-id.ts473 B
import crypto from 'crypto'; import { AuthenticatedRequest } from '../../../auth/interfaces'; const createSessionId = (): string => { return `mcp_${crypto.randomUUID()}`; }; export const getOrCreateSessionId = (req: AuthenticatedRequest) => { return ( (req.headers['mcp-session-id'] as string | undefined) || createSessionId() ); }; export const getSessionId = (req: AuthenticatedRequest) => { return req.headers['mcp-session-id'] as string | undefined; };

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

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