Skip to main content
Glama

Hyperliquid MCP Server

by t3rmed
config.py1.28 kB
"""Configuration management for Hyperliquid MCP server.""" import os from typing import List from ..types.hyperliquid import HyperliquidConfig def get_config() -> HyperliquidConfig: """Get configuration from environment variables.""" config = HyperliquidConfig( api_url=os.getenv("HYPERLIQUID_API_URL", "https://api.hyperliquid.xyz"), private_key=os.getenv("HYPERLIQUID_PRIVATE_KEY"), wallet_address=os.getenv("HYPERLIQUID_WALLET_ADDRESS"), is_testnet=os.getenv("HYPERLIQUID_TESTNET", "").lower() == "true" ) # Override with testnet URL if testnet is enabled if config.is_testnet: config.api_url = "https://api.hyperliquid-testnet.xyz" return config def validate_config(config: HyperliquidConfig) -> List[str]: """Validate configuration and return list of errors.""" errors: List[str] = [] if not config.api_url: errors.append("API URL is required") # Private key is optional for read-only operations if config.private_key and not config.private_key.startswith("0x"): errors.append("Private key must start with 0x") if config.wallet_address and not config.wallet_address.startswith("0x"): errors.append("Wallet address must start with 0x") return errors

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/t3rmed/hyperliquid-mcp'

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