McpServerConsole

jzuras/McpServerConsole

3.1

If you are the rightful owner of McpServerConsole 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.

This project is a C# .NET console application that acts as a Model Context Protocol (MCP) server, providing a structured interface for AI agents to access and analyze historical solar panel monitoring data from Enphase energy systems.

Tools
7
Resources
0
Prompts
0

Enphase Solar Data MCP Server in C#

WARNING! This project was written largely by Claude Code, with minimal review by me. Use at your own risk!

Claude Usage Screenshot

WARNING! This is built against a preview release of the MCP C# SDK (version 0.3.0-preview.3), which includes this note: "breaking changes can be introduced without prior notice."

This project is part of my New Learning Journey, which I post about on LinkedIn. The post for this project is here. Unlike many of the other repos here, this one might prove useful to others, becuase it builds on the examples provided by MS.

Note - the rest of this README was generated by Claude Code, and may include hallucinations.

This project is a C# .NET console application that acts as a Model Context Protocol (MCP) server. It provides a structured interface for AI agents to access and analyze historical solar panel monitoring data from Enphase energy systems, which is stored in local CSV files.

This server is designed to be used as a tool by AI assistants like Anthropic's Claude, allowing them to answer questions and perform analysis on your personal solar energy data.

Key Features

  • Structured Data Access: Provides tools to query system-wide energy production/consumption and individual solar panel performance.
  • Designed for AI Agents: Implements the Model Context Protocol (MCP) for easy integration with AI assistants.
  • Handles Large Datasets: Uses pagination to manage large CSV files and stay within AI token limits.
  • Cross-Platform: Compatible with both Windows and Linux environments.
  • Informative Error Handling: Returns detailed, user-visible error messages to guide the AI agent.

Project Status

Fully Operational: All MCP tools are implemented and have been tested for functionality and data accuracy. The server correctly handles path resolution, data filtering, and pagination.

Getting Started

Prerequisites

Building the Server

To build the executable, run the following command from the root directory:

dotnet build --configuration Release

The output will be located in EnphaseMcpServer/bin/Release/net9.0/.

Running the Server

This application is not designed to be run directly by a user. It is intended to be launched by an MCP client (i.e., an AI assistant).

The server requires a command-line argument specifying the path to the directory containing the Enphase CSV data files.

MCP Client Configuration

To use this server with an AI assistant like Claude Code, you would register it as a new tool. The command would look something like this:

# Example for Claude Code
claude mcp add enphase-solar /path/to/McpServerConsole.exe /path/to/your/data
  • The first argument is the path to the compiled server executable.
  • The second argument is the path to the directory where your SystemData_*.csv and PanelData_*.csv files are stored.

Important Note on Data Paths:

  • Absolute Paths: If you provide an absolute path (e.g., C:\Users\Jim\SolarData or /home/user/solar-data), it will be used directly.
  • Relative Paths: If you provide a relative path (e.g., SolarData or Documents/Solar), it will be resolved relative to your user home directory (C:\Users\<YourUser> on Windows or ~ on Linux/macOS). It is not relative to the executable's location.

Available Tools

The server exposes the following tools for the AI agent to use:

Tool NameDescription
list_csv_filesDiscovers available data files and returns their metadata, such as date ranges and record counts.
get_file_infoProvides detailed metadata for a single CSV file, including column names and sample data.
read_system_csvReads raw, system-level energy data (production, consumption, grid status) from a specific file.
read_panel_csvReads raw performance data for individual solar panels from a specific file.
get_system_data_by_date_rangeAggregates system-level energy data from multiple files across a specified date range.
get_panel_data_by_date_rangeAggregates performance data for individual panels across multiple files, with an option to filter by a specific panel's serial number.
get_panel_serialsReturns a list of all unique solar panel serial numbers found in the dataset.

Data Source

The server expects CSV files generated by the Enphase monitoring system to be located in the data directory provided at startup.

  • File Naming Convention:
    • SystemData_YYYY-MM-DD_HH-mm-ss.csv
    • PanelData_YYYY-MM-DD_HH-mm-ss.csv
  • Data Schema: For details on the CSV columns, please refer to the EnphaseMcpServer/EnphaseMcpServerSpec.md file.

For Developers

Architecture

  • Program.cs: Handles MCP server setup, command-line argument parsing, and tool registration.
  • DataFileTool.cs: Contains the static methods that implement all the MCP tools.
  • DataTransferObjects.cs: Defines the data structures used for tool responses.

Copyright and License

Code

Copyright (©) 2025 Jzuras

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Trademarks

Enphase(R) and Envoy(R) are trademarks of Enphase Energy(R).

All trademarks are the property of their respective owners.

Any trademarks used in this project are used in a purely descriptive manner and to state compatibility.