LBNL-ETA/EnergyPlus-MCP
If you are the rightful owner of EnergyPlus-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 EnergyPlus MCP Server is a Model Context Protocol server designed to facilitate the interaction with EnergyPlus building energy simulation models through a standardized interface.
EnergyPlus MCP Server
A Model Context Protocol (MCP) server that provides 35 comprehensive tools for working with EnergyPlus building energy simulation models. This server enables AI assistants and other MCP clients to load, validate, modify, and analyze EnergyPlus IDF files through a standardized interface.
Version: 0.1.0
EnergyPlus Compatibility: 25.1.0
Python: 3.10+
š Table of Contents
Overview
EnergyPlus MCP Server makes EnergyPlus building energy simulation accessible to AI assistants and automation tools through the Model Context Protocol.
Key Features:
- šļø Complete Model Lifecycle: Load, validate, analyze, modify, and simulate IDF files
- š Deep Building Analysis: Extract detailed information about zones, surfaces, materials, and schedules
- š Automated Simulation: Execute EnergyPlus simulations with weather files
- š Advanced Visualization: Create interactive plots and HVAC system diagrams
- š§ HVAC Intelligence: Discover, analyze, and visualize HVAC system topology
- š Smart Output Management: Auto-discover and configure output variables/meters
Installation
Using the MCP Server
Choose the appropriate setup for your AI assistant or IDE:
Claude Desktop
-
Build the Docker image (one-time setup):
git clone https://github.com/tsbyq/EnergyPlus_MCP.git cd EnergyPlus_MCP/.devcontainer docker build -t energyplus-mcp-dev .
-
Configure Claude Desktop:
Add to
~/Library/Application Support/Claude/claude_desktop_config.json
:{ "mcpServers": { "energyplus": { // Server name shown in Claude Desktop "command": "docker", // Main command to execute "args": [ "run", // Docker subcommand to run a container "--rm", // Remove container after it exits (cleanup) "-i", // Interactive mode for stdio communication "-v", "/path/to/EnergyPlus-MCP:/workspace", // Mount local dir to container "-w", "/workspace/energyplus-mcp-server", // Working dir in container "energyplus-mcp-dev", // Docker image name we built "uv", "run", "python", "-m", "energyplus_mcp_server.server" // Server startup command ] } } }
Important:
- Replace
/path/to/EnergyPlus-MCP
with your actual repository path - Remove all comments (text after
//
) when adding to the actual config file, as JSON doesn't support comments
- Replace
-
Restart Claude Desktop and the EnergyPlus server should connect automatically.
VS Code
-
Build the Docker image (same as Claude Desktop step 1 above)
-
Configure VS Code:
Add to
.vscode/settings.json
in your project:{ "mcp.servers": { "energyplus": { // Server name shown in VS Code "command": "docker", // Main command to execute "args": [ "run", // Docker subcommand to run a container "--rm", // Remove container after it exits (cleanup) "-i", // Interactive mode for stdio communication "-v", "${workspaceFolder}:/workspace", // Mount workspace to container "-w", "/workspace/energyplus-mcp-server", // Working dir in container "energyplus-mcp-dev", // Docker image name we built "uv", "run", "python", "-m", "energyplus_mcp_server.server" // Server startup command ] } } }
Important: Remove all comments (text after
//
) when adding to the actual config file -
Restart VS Code for the changes to take effect.
Cursor
-
Build the Docker image (same as Claude Desktop step 1 above)
-
Configure Cursor:
Add to
~/.cursor/mcp.json
:{ "mcpServers": { "energyplus": { // Server name shown in Cursor "command": "docker", // Main command to execute "args": [ "run", // Docker subcommand to run a container "--rm", // Remove container after it exits (cleanup) "-i", // Interactive mode for stdio communication "-v", "/path/to/EnergyPlus-MCP:/workspace", // Mount local dir to container "-w", "/workspace/energyplus-mcp-server", // Working dir in container "energyplus-mcp-dev", // Docker image name we built "uv", "run", "python", "-m", "energyplus_mcp_server.server" // Server startup command ] } } }
Important:
- Replace
/path/to/EnergyPlus-MCP
with your actual repository path - Remove all comments (text after
//
) when adding to the actual config file, as JSON doesn't support comments
- Replace
-
Restart Cursor for the changes to take effect.
Development Setup
For contributors who want to modify or extend the MCP server:
VS Code Dev Container
The easiest development setup with all dependencies pre-configured.
Prerequisites:
Steps:
-
Clone and open in VS Code:
git clone https://github.com/tsbyq/EnergyPlus_MCP.git cd EnergyPlus_MCP code .
-
Click "Reopen in Container" when prompted (or press
Ctrl+Shift+P
ā "Dev Containers: Reopen in Container") -
The container automatically installs EnergyPlus 25.1.0 and all dependencies
Docker Setup
For direct Docker development without VS Code:
# Clone repository
git clone https://github.com/tsbyq/EnergyPlus_MCP.git
cd EnergyPlus_MCP
# Build container
docker build -t energyplus-mcp-dev -f .devcontainer/Dockerfile .
# Run container
docker run -it --rm -v "$(pwd)":/workspace -w /workspace/energyplus-mcp-server energyplus-mcp-dev bash
# Inside container, install dependencies
uv sync --extra dev
Local Development
For local development (requires EnergyPlus installation):
Prerequisites:
- Python 3.10+
- uv package manager
- EnergyPlus 25.1.0
# Clone and install
git clone https://github.com/tsbyq/EnergyPlus_MCP.git
cd EnergyPlus_MCP/energyplus-mcp-server
uv sync --extra dev
# Run server for testing
uv run python -m energyplus_mcp_server.server
Available Tools
The server provides 35 tools organized into 5 categories:
šļø Model Config & Loading (9 tools)
load_idf_model
- Load and validate IDF filesvalidate_idf
- Comprehensive model validationlist_available_files
- Browse sample files and weather datacopy_file
- Intelligent file copying with path resolutionget_model_summary
- Extract basic model informationcheck_simulation_settings
- Review simulation control settingsmodify_simulation_control
- Modify simulation parametersmodify_run_period
- Adjust simulation time periodsget_server_configuration
- Get server configuration info
š Model Inspection (9 tools)
list_zones
- List all thermal zones with propertiesget_surfaces
- Get building surface informationget_materials
- Extract material definitionsinspect_schedules
- Analyze all schedule objectsinspect_people
- Analyze occupancy settingsinspect_lights
- Analyze lighting loadsinspect_electric_equipment
- Analyze equipment loadsget_output_variables
- Get/discover output variablesget_output_meters
- Get/discover energy meters
āļø Model Modification (8 tools)
modify_people
- Update occupancy settingsmodify_lights
- Update lighting loadsmodify_electric_equipment
- Update equipment loadschange_infiltration_by_mult
- Modify infiltration ratesadd_window_film_outside
- Add window filmsadd_coating_outside
- Apply surface coatingsadd_output_variables
- Add output variablesadd_output_meters
- Add energy meters
š Simulation & Results (4 tools)
run_energyplus_simulation
- Execute simulationscreate_interactive_plot
- Generate HTML visualizationsdiscover_hvac_loops
- Find all HVAC loopsget_loop_topology
- Get HVAC loop details
š„ļø Server Management (5 tools)
visualize_loop_diagram
- Generate HVAC diagramsget_server_status
- Check server healthget_server_logs
- View recent logsget_error_logs
- Get error logsclear_logs
- Clear/rotate log files
Usage Examples
Basic Workflow
-
Load a model:
{ "tool": "load_idf_model", "arguments": { "idf_path": "sample_files/1ZoneUncontrolled.idf" } }
-
Inspect zones:
{ "tool": "list_zones", "arguments": { "idf_path": "sample_files/1ZoneUncontrolled.idf" } }
-
Run simulation:
{ "tool": "run_energyplus_simulation", "arguments": { "idf_path": "sample_files/1ZoneUncontrolled.idf", "weather_file": "sample_files/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw", "annual": true } }
-
Create visualization:
{ "tool": "create_interactive_plot", "arguments": { "output_directory": "outputs/1ZoneUncontrolled", "file_type": "variable" } }
Advanced Features
HVAC System Analysis:
{
"tool": "discover_hvac_loops",
"arguments": {
"idf_path": "sample_files/5ZoneAirCooled.idf"
}
}
Generate HVAC Diagram:
{
"tool": "visualize_loop_diagram",
"arguments": {
"idf_path": "sample_files/5ZoneAirCooled.idf",
"loop_name": "VAV Sys 1",
"format": "png"
}
}
Discover Output Variables:
{
"tool": "get_output_variables",
"arguments": {
"idf_path": "sample_files/5ZoneAirCooled.idf",
"discover_available": true,
"run_days": 1
}
}
Using with MCP Inspector
Test tools interactively:
cd energyplus-mcp-server
uv run mcp-inspector energyplus_mcp_server.server
Architecture
The server follows a layered architecture:
āāāāāāāāāāāāāāāāāāāāāāāāāāā
ā MCP Protocol Layer ā FastMCP server handling client communications
āāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Tools Layer ā 35 tools organized into 5 categories
āāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Orchestration Layer ā EnergyPlus Manager & Config Module
āāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā EnergyPlus Integration ā Direct interface to simulation engine
āāāāāāāāāāāāāāāāāāāāāāāāāāā
Project Structure:
energyplus-mcp-server/
āāā energyplus_mcp_server/
ā āāā server.py # FastMCP server with tools
ā āāā energyplus_tools.py # Core EnergyPlus integration
ā āāā config.py # Configuration management
ā āāā utils/ # Specialized utilities
āāā sample_files/ # Sample IDF and weather files
āāā tests/ # Unit tests
āāā pyproject.toml # Dependencies
Configuration
The server auto-detects EnergyPlus installation and uses sensible defaults. Configuration can be customized via environment variables:
EPLUS_IDD_PATH
: Path to EnergyPlus IDD fileEPLUS_SAMPLE_PATH
: Custom sample files directoryEPLUS_OUTPUT_PATH
: Output directory for results
Troubleshooting
Common Issues:
- "IDD file not found": Ensure EnergyPlus is installed
- "Module not found": Run
uv sync
to install dependencies - "Permission denied": Check file permissions
- "Simulation failed": Check EnergyPlus error messages in output directory
Debugging:
- Check server status:
get_server_status
- View logs:
get_server_logs
- Check errors:
get_error_logs
Contributing
- Fork the repository
- Create a feature branch
- Make changes with tests
- Run checks:
uv run ruff check uv run black . uv run pytest
- Submit a pull request
License
See file for details.