energy-mcp

matthicks05/energy-mcp

3.1

If you are the rightful owner of energy-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Energy Data MCP Server is designed to facilitate the analysis of energy usage data from Smart Meter Texas, providing both API endpoints for automated access and a Gradio web interface for manual exploration.

Tools
6
Resources
0
Prompts
0

title: Energy Data MCP Server emoji: ⚡ colorFrom: blue colorTo: green sdk: gradio sdk_version: 5.44.1 app_file: app.py pinned: false short_description: MCP server for Smart Meter Texas energy data analysis

⚡ Energy Data MCP Server

A Model Context Protocol (MCP) server that exposes Smart Meter Texas energy usage data and PDF document processing through both:

  1. MCP API endpoints for AI agents and applications
  2. Gradio web interface for manual testing and exploration

🚀 Features

MCP API Endpoints

  • GET /health - Health check
  • GET /mcp/tools - List available MCP tools
  • POST /mcp/call/{tool_name} - Call MCP tools

Available MCP Tools

  • query_energy_data: Flexible data querying with filters and aggregations
  • get_usage_summary: Quick overviews of energy usage data
  • find_peak_usage: Peak consumption analysis by day/month
  • get_usage_patterns: Time-based pattern analysis (hourly/daily)
  • compare_periods: Period-to-period usage comparisons
  • process_energy_document: Extract structured data from PDF energy documents

Gradio Interface

  • Interactive web UI for testing MCP tools
  • Real-time database connectivity
  • JSON response viewer
  • PDF upload and processing interface

🔧 Environment Variables

Required for database connection:

  • SUPABASE_DB_HOST: Database host
  • SUPABASE_DB_PORT: Database port (default: 5432)
  • SUPABASE_DB_NAME: Database name
  • SUPABASE_DB_USER: Database user
  • SUPABASE_DB_PASSWORD: Database password

📊 Data Sources

  • Smart Meter Texas: 15-minute interval energy usage data
  • TimescaleDB: Time-series PostgreSQL database
  • Real-time: Live connection to current data
  • PDF Documents: Electric bills and Electricity Facts Labels (EFL)

🌐 Access

🔗 Integration

This MCP server can be consumed by:

  • AI chat applications (like the Energy Chat app)
  • Claude Desktop with MCP support
  • Custom applications via HTTP API
  • Other MCP-compatible tools

📄 PDF Processing

The server can extract structured information from energy documents:

Supported Document Types

  • Electric Bills: Extract ESIID, usage (kWh), charges, rates, billing periods
  • Electricity Facts Labels (EFL): Extract rate structures, plan details, fees

Supported Formats

  • Text-based PDFs (preferred)
  • Scanned PDFs (using OCR)
  • Common Texas utility providers (Oncor, CenterPoint, AEP, TNMP)

Extraction Features

  • Automatic document type classification
  • Confidence scoring for reliability
  • Multiple extraction methods (text parsing + OCR fallback)
  • Structured JSON output

🛠️ Local Development

# Install dependencies
pip install -r requirements.txt

# Set environment variables in .env file
# Run the app
python app.py

📈 Usage Examples

Test via Gradio UI

  1. Open http://localhost:7860
  2. Use the tabs to test different MCP tools
  3. View JSON responses in real-time

Test via API

# Health check
curl http://localhost:8000/health

# List tools
curl http://localhost:8000/mcp/tools

# Call a tool
curl -X POST http://localhost:8000/mcp/call/get_usage_summary \
  -H "Content-Type: application/json" \
  -d '{"period": "all"}'

🔌 Ready to power your energy data analysis!