Skip to main content
Glama
config.js3.02 kB
/** export const SERVER_CONFIG = { name: "mcp-server-ccxt", version: "1.0.0", description: "MCP Server CCXT - Cryptocurrency Exchange API Tools", host: process.env.HOST || "0.0.0.0",tral MCP CCXT server configuration * Uses environment variables when available, otherwise uses default values */ export const SERVER_CONFIG = { name: "mcp-webserver-ccxt", version: "1.0.0", description: "Model Context Protocol server for crypto data via CCXT", host: process.env.HOST || "0.0.0.0", port: parseInt(process.env.PORT) || 3000, logLevel: process.env.LOG_LEVEL || "info", // ⚠️ TIMEOUT CONFIGURATION // Global request timeout removed - timeout is handled at tool level // Each tool should implement its own timeout (default: 20s for CCXT operations) requestTimeout: parseInt(process.env.REQUEST_TIMEOUT_MS) || null, // null = disabled (recommended) // Tool-specific timeout for CCXT operations (can be overridden per-tool) toolTimeout: parseInt(process.env.TOOL_TIMEOUT_MS) || 20000, // 20 seconds // Session management configuration sessionTimeout: parseInt(process.env.SESSION_TIMEOUT_MS) || 600000, // 10 minutes (increased from 5) sessionCleanupInterval: parseInt(process.env.SESSION_CLEANUP_INTERVAL_MS) || 30000, // 30 seconds // ⚠️ STRICT MCP COMPLIANCE MODE (default: false to respect MCP standard) // When false (strict mode): returns 404 for missing sessions - standard MCP behavior // When true (compatibility mode): auto-recreates sessions for legacy clients allowAutoSessionRecreate: process.env.ALLOW_AUTO_SESSION_RECREATE === 'true', // Default: false (strict mode) maxSessionErrors: parseInt(process.env.MAX_SESSION_ERRORS) || 10, // Disabled if 0 }; export const SUPPORTED_EXCHANGES = [ "coinbase", "binance", "kraken", "bitfinex", "bybit", ]; export const DEFAULT_EXCHANGE = process.env.DEFAULT_EXCHANGE || "coinbase"; export const TIMEFRAMES = ["1m", "5m", "15m", "1h", "4h", "1d"]; export const ENDPOINTS = { sse: "/sse", message: "/message", health: "/health", root: "/", }; export const LIMITS = { orderbook: parseInt(process.env.ORDERBOOK_LIMIT) || 10, ohlcv: parseInt(process.env.OHLCV_LIMIT) || 100, markets: parseInt(process.env.MARKETS_LIMIT) || 50, }; /** * CORS configuration */ export const CORS_CONFIG = { origin: process.env.CORS_ORIGINS ? process.env.CORS_ORIGINS.split(',').map(o => o.trim()) : '*', credentials: true, }; /** * Get API credentials for a specific exchange * @param {string} exchangeName - Exchange name * @returns {object|null} Credentials or null if not configured */ export function getExchangeCredentials(exchangeName) { const upperName = exchangeName.toUpperCase(); const apiKey = process.env[`${upperName}_API_KEY`]; const secret = process.env[`${upperName}_SECRET`]; const password = process.env[`${upperName}_PASSWORD`]; if (!apiKey || !secret) { return null; } return { apiKey, secret, ...(password && { password }), }; }

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/carlosatta/mcp-server-ccxt'

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