Skip to main content
Glama
index.ts1.2 kB
import { config as dotenvConfig } from 'dotenv'; import { logError } from '../utils/logger.js'; // Load environment variables dotenvConfig(); interface Config { brex: { apiKey: string; apiUrl: string; }; server: { port: number; nodeEnv: string; }; rateLimit: { requests: number; windowMs: number; }; } function validateEnv(): Config { const requiredEnvVars = [ 'BREX_API_KEY', 'BREX_API_URL', 'PORT', 'NODE_ENV', 'RATE_LIMIT_REQUESTS', 'RATE_LIMIT_WINDOW_MS' ]; const missingVars = requiredEnvVars.filter(varName => !process.env[varName]); if (missingVars.length > 0) { const error = new Error(`Missing required environment variables: ${missingVars.join(', ')}`); logError(error); throw error; } return { brex: { apiKey: process.env.BREX_API_KEY!, apiUrl: process.env.BREX_API_URL!, }, server: { port: parseInt(process.env.PORT!, 10), nodeEnv: process.env.NODE_ENV!, }, rateLimit: { requests: parseInt(process.env.RATE_LIMIT_REQUESTS!, 10), windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS!, 10), }, }; } export const appConfig = validateEnv();

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

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