Skip to main content
Glama
utils.ts570 B
export function extractHeaderValue( value: string | string[] | undefined, ): string | undefined { if (!value) { return undefined; } return typeof value === "string" ? value : value[0]; } export function extractBearerToken( authHeader: string | string[] | undefined, ): string | undefined { const header = extractHeaderValue(authHeader); if (!header) { return undefined; } // If it starts with 'Bearer ', remove that prefix if (header.startsWith("Bearer ")) { return header.substring(7).trim(); } // Otherwise return the raw value return header; }

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

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