Configuration
ByteMCP uses environment variables for configuration. This guide covers all available options.
Environment Variables
Section titled “Environment Variables”Required: Database Connection
Section titled “Required: Database Connection”# MySQL Database (Required)DB_HOST=localhostDB_PORT=3306DB_DATABASE=bytefederalDB_USER=your_usernameDB_PASSWORD=your_passwordServer Mode
Section titled “Server Mode”# MCP Mode: 'stdio' (default) or 'remote'MCP_MODE=stdio
# Port for remote mode (default: 3000)PORT=3000Optional: Geocoding
Section titled “Optional: Geocoding”# Google Maps API key for address geocoding# If not set, falls back to database city/state lookupsGEOCODING_API_KEY=your_google_maps_api_keyOptional: Heartbeat Monitoring
Section titled “Optional: Heartbeat Monitoring”# Separate database for operations dashboardHEARTBEAT_HOST=dashboard_hostHEARTBEAT_PORT=3306HEARTBEAT_DATABASE=dashboard_dbHEARTBEAT_USER=dash_userHEARTBEAT_PASSWORD=dash_passOperating Modes
Section titled “Operating Modes”stdio Mode (Default)
Section titled “stdio Mode (Default)”Standard input/output mode for local MCP clients like Claude Desktop.
# Run in stdio modenpm start
# Or explicitlyMCP_MODE=stdio npm startThe server communicates via stdin/stdout using JSON-RPC messages.
Remote Mode
Section titled “Remote Mode”HTTP/SSE mode for cloud deployment and remote clients.
# Run in remote modenpm run start:remote
# Or with environment variableMCP_MODE=remote PORT=3030 npm startExposes HTTP endpoints for MCP communication.
Database Schema
Section titled “Database Schema”ByteMCP expects a locations_map table with these columns:
| Column | Type | Description |
|---|---|---|
id | INT | Unique ATM identifier |
name | VARCHAR | ATM/location name |
address | VARCHAR | Street address |
city | VARCHAR | City name |
state | VARCHAR | State code (e.g., FL) |
country | VARCHAR | Country code |
lat | DECIMAL | Latitude |
lon | DECIMAL | Longitude |
google | VARCHAR | Google Maps link |
google_dir | VARCHAR | Directions link |
google_rev | VARCHAR | Reviews link |
photo_url | VARCHAR | ATM photo URL |
mo_open - sun_open | TIME | Opening hours by day |
mo_close - sun_close | TIME | Closing hours by day |
Connection Pooling
Section titled “Connection Pooling”The database connection pool is configured with sensible defaults:
{ connectionLimit: 10, waitForConnections: true, queueLimit: 0}Geocoding Fallback
Section titled “Geocoding Fallback”If GEOCODING_API_KEY is not set, the server uses a fallback strategy:
- Parse the location string for city/state
- Query the database for average coordinates of ATMs in that area
- Use those coordinates for distance calculations
This allows basic functionality without a Google Maps API key.
Security Considerations
Section titled “Security Considerations”- Never commit
.envfiles to version control - Use environment variables in production
- Restrict database user permissions to SELECT only
- Enable SSL for remote mode in production
Example Configurations
Section titled “Example Configurations”Development
Section titled “Development”DB_HOST=localhostDB_DATABASE=bytefederal_devDB_USER=dev_userDB_PASSWORD=dev_passwordMCP_MODE=stdioProduction (Remote)
Section titled “Production (Remote)”DB_HOST=db.example.comDB_DATABASE=bytefederalDB_USER=prod_userDB_PASSWORD=secure_passwordMCP_MODE=remotePORT=3000GEOCODING_API_KEY=your_api_keyNext Steps
Section titled “Next Steps”- MCP Tools - Learn about available tools
- Local Deployment - Run locally
- Remote Deployment - Deploy as HTTP server