OpenStudio MCP Server
Enables AI assistants to interact with OpenStudio building energy models through natural language, allowing users to load, inspect, and manipulate OSM files including building geometry, HVAC systems, materials, schedules, and internal loads.
README
OpenStudio MCP Server
A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with OpenStudio building energy models. Load, inspect, and manipulate OpenStudio Model (OSM) files through a comprehensive set of tools accessible via natural language.
Credits and Acknowledgments
This project is heavily based on the EnergyPlus MCP Server developed by LBNL-ETA (Lawrence Berkeley National Laboratory - Energy Technologies Area). The server architecture, tool structure, and implementation patterns have been replicated as closely as possible from their excellent work.
The tools in this server are built using the OpenStudio-Toolkit library, which provides Python interfaces to OpenStudio's building modeling capabilities.
This project was developed with the invaluable assistance of Claude Code powered by Anthropic's Claude Sonnet 4.5.
Features
Available Tools (19+)
š File & Model Management
load_osm_model- Load OpenStudio Model files with intelligent path resolutionsave_osm_model- Save modified modelsconvert_to_idf- Export to EnergyPlus IDF formatcopy_file- Copy files with fuzzy matching and smart discoveryget_model_summary- Get comprehensive model statisticsget_building_info- Get building object details
šļø Building Geometry
list_spaces- List all spaces with propertiesget_space_details- Get detailed information about a specific spacelist_thermal_zones- List all thermal zonesget_thermal_zone_details- Get detailed zone information
š§± Materials & Constructions
list_materials- List all materials with thermal properties
š HVAC Systems
list_air_loops- List all air loop HVAC systems
š” Internal Loads
list_people_loads- List occupancy loadslist_lighting_loads- List lighting power densitieslist_electric_equipment- List equipment loads
š Schedules
list_schedule_rulesets- List all schedule rulesets
āļø Server Management
get_server_info- Get server configuration and statusget_current_model_status- Check currently loaded model
Key Capabilities
- Intelligent File Discovery: Automatically finds files in multiple locations including Claude Desktop uploads
- Fuzzy Matching: Finds files even with partial names or typos
- Dual Environment Support: Works seamlessly in both Docker and Claude Desktop
- Comprehensive API: Covers building geometry, HVAC, loads, materials, and schedules
Installation
Prerequisites
- Python 3.10+
- Docker Desktop (for containerized deployment)
- OpenStudio 3.7.0 (installed in Docker container)
- Claude Desktop, VS Code, or Cursor (for AI assistant integration)
Quick Start
1. Clone the Repository
git clone https://github.com/roruizf/openstudio-mcp-server.git
cd openstudio-mcp-server
2. Build Docker Image
docker build -t openstudio-mcp-dev -f .devcontainer/Dockerfile .
This builds a container with:
- Python 3.12
- OpenStudio 3.7.0
- All required dependencies
- OpenStudio-Toolkit library
3. Configure Claude Desktop
Edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"openstudio": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"/absolute/path/to/openstudio-mcp-server:/workspace",
"-w",
"/workspace",
"openstudio-mcp-dev",
"uv",
"run",
"python",
"-m",
"openstudio_mcp_server.server"
]
}
}
}
Important: Replace /absolute/path/to/openstudio-mcp-server with your actual path:
- macOS/Linux:
/Users/username/openstudio-mcp-server - Windows:
C:\openstudio-mcp-server(use forward slashes in JSON)
4. Restart Claude Desktop
Close and reopen Claude Desktop to load the MCP server.
5. Verify Installation
In Claude Desktop, ask:
"What OpenStudio tools are available?"
Claude should list all available tools.
Usage
Basic Workflow
-
Place your OSM file in the
sample_files/models/directory -
Ask Claude to work with it:
"Load R2F-Office-Hub-006.osm and tell me about the building" -
Claude will:
- Load the model using
load_osm_model - Extract information using
get_model_summary,list_spaces, etc. - Present the results in natural language
- Load the model using
Example Conversations
Analyze a Building
You: "Load the office building model and describe its HVAC systems"
Claude will:
1. Use load_osm_model("office-building.osm")
2. Use list_air_loops()
3. Summarize the HVAC configuration
Export to EnergyPlus
You: "Convert this model to IDF format for simulation"
Claude will:
1. Use convert_to_idf()
2. Report the output file location
Compare Spaces
You: "Which spaces have the highest lighting power density?"
Claude will:
1. Use list_spaces()
2. Use list_lighting_loads()
3. Analyze and rank the results
Working with Uploaded Files
Claude Desktop can handle files you upload directly:
- Upload your
.osmfile in the chat - Ask Claude to analyze it
- The server automatically finds and loads it from Claude's upload directory
Project Structure
openstudio-mcp-server/
āāā openstudio_mcp_server/ # Main server package
ā āāā server.py # MCP tool definitions
ā āāā openstudio_manager.py # Business logic layer
ā āāā config.py # Configuration management
ā āāā utils/
ā āāā path_utils.py # Intelligent path resolution
ā āāā __init__.py
āāā openstudio_toolkit/ # OpenStudio Python library
āāā sample_files/ # Example models
ā āāā models/ # OSM files
ā āāā weather/ # EPW weather files
āāā outputs/ # Generated files (IDF exports, etc.)
āāā logs/ # Server logs
āāā .devcontainer/
ā āāā Dockerfile # Docker container definition
āāā pyproject.toml # Python dependencies
āāā README.md # This file
āāā USER_GUIDE.md # User documentation
āāā DEVELOPER_NOTES.md # Technical documentation
āāā FILE_ACCESS_GUIDE.md # File handling details
Documentation
- USER_GUIDE.md - Simple guide for end users
- DEVELOPER_NOTES.md - Technical implementation details
- FILE_ACCESS_GUIDE.md - How file discovery works
- CLAUDE_DESKTOP_FIX.md - Claude Desktop integration notes
How It Works
Architecture
User (Claude Desktop)
ā
Claude AI (analyzes request, selects tools)
ā
MCP Protocol (JSON-RPC over stdin/stdout)
ā
FastMCP Server (server.py - tool definitions)
ā
OpenStudioManager (openstudio_manager.py - business logic)
ā
OpenStudio-Toolkit (Python wrapper functions)
ā
OpenStudio SDK (C++ library with Python bindings)
Tool Execution Flow
- User asks: "How many spaces are in this building?"
- Claude selects tool:
list_spaces() - Server executes:
- Checks if model is loaded
- Calls OpenStudio-Toolkit function
- Extracts space data into DataFrame
- Converts to JSON
- Returns to Claude:
{"status": "success", "count": 12, "spaces": [...]} - Claude responds: "This building has 12 spaces..."
Development
Adding New Tools
See DEVELOPER_NOTES.md for detailed instructions on:
- Adding new MCP tools
- Integrating OpenStudio-Toolkit functions
- Error handling patterns
- Testing procedures
Running Tests
# In Docker container
docker run --rm -i \
-v "$(pwd):/workspace" \
openstudio-mcp-dev bash -c "
cd /workspace && uv run python -m pytest tests/
"
Local Development
# Install dependencies
uv pip install -e .
# Run server locally
uv run python -m openstudio_mcp_server.server
Troubleshooting
"Model not loaded" Error
- Ensure you've loaded a model first with
load_osm_model - Check that the file is in
sample_files/models/
"File not found" Error
- Verify the file path is correct
- Check file is in mounted workspace directory
- Try using just the filename (server will search automatically)
Claude Doesn't Use Tools
- Verify MCP server is connected (check Claude Desktop status bar)
- Restart Claude Desktop
- Check server logs in
logs/openstudio_mcp_server.log
Docker Issues
- Ensure Docker Desktop is running
- Verify volume mount path is correct and absolute
- Check Docker image was built successfully
Roadmap
Future enhancements planned:
- Model Modification: Tools to create and modify spaces, zones, surfaces
- Advanced HVAC: Detailed HVAC component inspection and editing
- Simulation: Execute EnergyPlus simulations
- Results Analysis: Parse and visualize simulation results
- Parametric Studies: Automated parametric analysis workflows
- Geometry Tools: Create building geometry from scratch
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - See LICENSE file for details
Acknowledgments
- LBNL-ETA for the EnergyPlus MCP Server architecture that served as the foundation for this project
- OpenStudio-Toolkit for providing the Python interface to OpenStudio
- NREL for developing and maintaining the OpenStudio SDK
- Anthropic for Claude and Claude Code (Sonnet 4.5)
- Model Context Protocol community for the MCP specification
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- OpenStudio Documentation: https://openstudio.net/
Built with ā¤ļø using Claude Code, Python and OpenStudio
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Neon Database
MCP server for interacting with Neon Management API and databases