Wirsam.EnergyMCP
1.0.0
dotnet tool install --global Wirsam.EnergyMCP --version 1.0.0
dotnet new tool-manifest
dotnet tool install --local Wirsam.EnergyMCP --version 1.0.0
#tool dotnet:?package=Wirsam.EnergyMCP&version=1.0.0
nuke :add-package Wirsam.EnergyMCP --version 1.0.0
🔥 Energy Sensor MCP Server
A Model Context Protocol (MCP) server for real-time energy and sensor data monitoring, analysis, and smart home integration. Perfect for heat pump monitoring, energy consumption tracking, and AI-powered home automation.
⚡ Features
- 🏠 Real-time Energy Monitoring - Track heat pump and energy sensor data in real-time
- 📊 Smart Analytics - Consumption patterns, efficiency analysis, cost calculations
- 🤖 AI-Ready Integration - Works seamlessly with Claude, ChatGPT, GitHub Copilot, and other AI assistants
- 🔌 GraphQL API Integration - Connects to sensor data APIs for live data access
- 🌍 Cross-Platform - Windows, macOS, Linux support via .NET
- 📈 Energy Insights - Trend analysis, anomaly detection, predictive maintenance
🚀 Quick Start
Installation
# Install as global .NET tool
dotnet tool install -g Wirsam.EnergyMCP
# Or install locally in your project
dotnet tool install Wirsam.EnergyMCP
Usage
# Start the MCP server (uses default sensor API)
energy-mcp-server
# With custom API endpoint
SENSOR_API_URL=https://your-sensor-api.com/graphql energy-mcp-server
# Check installation
energy-mcp-server --help
Connect to AI Assistants
Claude Desktop (.claude_desktop_config.json):
{
"mcpServers": {
"energy-sensors": {
"command": "energy-mcp-server",
"env": {
"SENSOR_API_URL": "https://sensorapi-two.vercel.app/graphql"
}
}
}
}
VS Code with GitHub Copilot (.vscode/mcp.json):
{
"mcpServers": {
"energy-sensors": {
"command": "energy-mcp-server",
"env": {
"SENSOR_API_URL": "https://sensorapi-two.vercel.app/graphql"
}
}
}
}
Installation & Usage
Option 1: Local Development
- Clone this repository
- Navigate to the project directory
- Build the project:
dotnet build - Configure VS Code by creating
.vscode/mcp.json(see Configuration section) - Use with GitHub Copilot in VS Code
Option 2: NuGet Package (when published)
- Search for the package on NuGet.org
- Copy the MCP configuration from the package's "MCP Server" tab
- Add to your
.vscode/mcp.jsonfile
Configuration
Environment Variables
SENSOR_API_URL(optional): GraphQL endpoint URL for the sensor data API- Default:
https://sensorapi-cpbpps2rw-widos-projects.vercel.app/graphql
- Default:
VS Code Configuration
Create .vscode/mcp.json in your workspace:
{
"inputs": [
{
"type": "promptString",
"id": "sensor_api_url",
"description": "GraphQL API URL for sensor data",
"password": false
}
],
"servers": {
"SensorDataMCP": {
"type": "stdio",
"command": "dotnet",
"args": [
"run",
"--project",
"path/to/SensorDataMCP"
],
"env": {
"SENSOR_API_URL": "${input:sensor_api_url}"
}
}
}
}
Usage Examples
Once configured in VS Code with GitHub Copilot, you can use natural language prompts:
- "Show me all available sensor types"
- "Get the current status of all sensors in location X"
- "What are the latest readings from temperature sensors?"
- "Show me any active alerts"
- "Analyze the readings from sensor ABC123 for the last 24 hours"
- "Find sensor with device ID DEV456"
GraphQL API Schema
This MCP server connects to a GraphQL API with the following main types:
- SensorType: Defines types of sensors (temperature, humidity, etc.)
- Location: Physical locations where sensors are deployed
- Sensor: Individual sensor devices with metadata
- SensorReading: Time-series data from sensors
- Alert: System alerts and warnings
Development
Project Structure
SensorDataMCP/
├── Models/
│ ├── SensorModels.cs # Data models for sensors, readings, etc.
│ └── GraphQLResponses.cs # Response wrapper types
├── Services/
│ └── SensorApiService.cs # GraphQL client service
├── Tools/
│ └── SensorTools.cs # MCP tool implementations
└── Program.cs # Application entry point
Building and Testing
# Build the project
dotnet build
# Run locally
dotnet run
# Pack for NuGet
dotnet pack -c Release
# Publish to NuGet
dotnet nuget push bin/Release/*.nupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json
Troubleshooting
Common Issues
- "dnx command not found": Install .NET 10 Preview 6 or higher
- Tools not appearing: Check that the MCP server is configured correctly in VS Code settings
- API connection issues: Verify the
SENSOR_API_URLenvironment variable
Debugging
Check VS Code's MCP server status in the settings to ensure the server starts successfully.
Publishing to NuGet.org
Follow the Microsoft guide for publishing MCP servers to NuGet:
- Update
<PackageId>in the .csproj file to be unique on NuGet.org - Update
.mcp/server.jsonwith your server configuration - Run
dotnet pack -c Release - Publish with
dotnet nuget push bin/Release/*.nupkg --api-key <your-api-key> --source https://api.nuget.org/v3/index.json
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|
Initial release of Energy MCP Server v1.0.0
- Real-time sensor data queries via GraphQL
- Energy consumption analysis and visualization
- Heat pump monitoring and efficiency tracking
- Smart home integration ready
- Support for 5 core tools: GetSensorTypes, GetLocations, GetAllSensors, GetSensorReadings, GetSpecificSensor