Skip to main content
Glama
index.js916 B
// Configuration for different environments const config = { // Backend URL for MCP endpoints // In development, we need to use the backend port (8000) // In production, both frontend and backend are served from the same origin getBackendUrl: () => { // Check if we have an explicit backend URL set via environment variable if (import.meta.env.VITE_BACKEND_URL) { return import.meta.env.VITE_BACKEND_URL } // In development, detect localhost and switch to backend port if (import.meta.env.DEV && window.location.hostname === 'localhost') { return `${window.location.protocol}//${window.location.hostname}:8000` } // In production or other cases, use same origin return window.location.origin }, // Get the MCP URL for a given API key getMcpUrl: (keyValue) => { return `${config.getBackendUrl()}/mcp/${keyValue}` } } export default config

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/GeorgeStrakhov/mcpeasy'

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