Skip to main content
Glama

Bybit MCP Server

by ethancod1ng
config.ts1.04 kB
import dotenv from 'dotenv'; import { BybitConfig, BybitConfigType } from './types.js'; dotenv.config(); export function loadConfig(): BybitConfigType { const config = { apiKey: process.env.BYBIT_API_KEY || '', apiSecret: process.env.BYBIT_API_SECRET || '', environment: (process.env.BYBIT_ENVIRONMENT as 'testnet' | 'mainnet') || 'testnet', baseUrl: process.env.BYBIT_BASE_URL || undefined, debug: process.env.DEBUG === 'true', }; try { return BybitConfig.parse(config); } catch (error) { console.error('Configuration validation failed:', error); throw new Error('Invalid configuration. Please check your environment variables.'); } } export function validateConfig(config: BybitConfigType): void { if (!config.apiKey || !config.apiSecret) { throw new Error('BYBIT_API_KEY and BYBIT_API_SECRET environment variables are required'); } // Note: Avoid console output in MCP servers as it interferes with JSON-RPC protocol // Environment info is logged via logError in server.ts instead }

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/ethancod1ng/bybit-mcp-server'

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