Skip to main content
Glama

MCP Agent - AI Expense Tracker

by dev-muhammad
constructEndpointUrl.ts•532 B
export const constructEndpointUrl = ( value: string | null | undefined ): string => { if (!value) return '' if (value.startsWith('http://') || value.startsWith('https://')) { return decodeURIComponent(value) } // Check if the endpoint is localhost or an IP address if ( value.startsWith('localhost') || /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.test(value) ) { return `http://${decodeURIComponent(value)}` } // For all other cases, default to HTTPS return `https://${decodeURIComponent(value)}` }

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/dev-muhammad/MCPAgent'

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