Skip to main content
Glama
Tommertom

Plugwise MCP Server

by Tommertom
environment.ts1.34 kB
/** * Environment Configuration Module * Handles loading and managing environment variables */ import { config } from 'dotenv'; // Load environment variables config(); export interface ServerConfig { port: number; host: string; } export interface HubCredentials { password: string; ip?: string; } /** * Get server configuration from environment */ export function getServerConfig(): ServerConfig { return { port: parseInt(process.env.PORT || '3000'), host: process.env.HOST || 'localhost' }; } /** * Load all HUB credentials from environment variables * Reads HUBx and HUBxIP variables (where x is 1-10) */ export function loadHubCredentials(): Map<number, HubCredentials> { const credentials = new Map<number, HubCredentials>(); for (let i = 1; i <= 10; i++) { const password = process.env[`HUB${i}`]; const ip = process.env[`HUB${i}IP`]; if (password) { credentials.set(i, { password, ip }); } } return credentials; } /** * Get a specific hub credential by index */ export function getHubCredential(index: number): HubCredentials | undefined { const password = process.env[`HUB${index}`]; const ip = process.env[`HUB${index}IP`]; if (password) { return { password, ip }; } return undefined; }

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/Tommertom/plugwise-mcp'

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