scau-electricity-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@scau-electricity-mcp What's my dorm electricity balance and usage this month?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SCAU Electricity MCP Server
简体中文 | English
A lightweight, read-only Model Context Protocol (MCP) server for querying dormitory electricity data at South China Agricultural University (SCAU).
The server runs locally over stdio, keeps authentication sessions in memory, and does not read Home Assistant configuration or persist tokens, cookies, room details, or query results.
Features
Query total and per-day electricity usage for an inclusive date range.
Read the current electricity balance, refresh time, and meter status.
Read lifetime electricity usage without supplying any parameters.
Calculate range and daily electricity costs using a configurable unit price.
Expose read-only, idempotent MCP tools with structured JSON results.
Related MCP server: MCP Student Assistant
Available tools
Tool | Parameters | Description |
|
| Returns total usage and per-day readings for an inclusive date range. |
| None | Returns the current balance, refresh time, and meter online status. |
| None | Returns cumulative electricity usage since the meter came online. |
|
| Returns range totals, daily readings and costs, lifetime usage as of the end date, and the current balance. |
Dates must use the YYYY-MM-DD format. start_date must not be later than end_date.
Requirements
Python 3.12 or newer
Network access to
http://cz.scau.edu.cnYour SCAU electricity room name and room ID
Installation
git clone https://github.com/xnbx2012/scau-electricity-mcp.git
cd scau-electricity-mcp
uv syncIf uv reports invalid peer certificate: UnknownIssuer behind a system or corporate certificate proxy, run uv --system-certs sync.
Running locally
Pass the room settings as command-line arguments:
uv run python server.py --room-name "Your room name" --room-id "Your room ID"Or use environment variables:
$env:SCAU_ROOM_NAME = "Your room name"
$env:SCAU_ROOM_ID = "Your room ID"
uv run python server.pyThe process communicates over stdio. It is normal for it to remain running without printing a prompt.
MCP client configuration
Replace the directory with the absolute path to your clone:
{
"mcpServers": {
"scau-electricity": {
"command": "uv",
"args": [
"--directory",
"C:\\absolute\\path\\to\\scau-electricity-mcp",
"run",
"python",
"server.py"
],
"env": {
"SCAU_ROOM_NAME": "Your room name",
"SCAU_ROOM_ID": "Your room ID"
}
}
}
}If the client cannot find uv, set command to the absolute path of uv.exe. Do not commit client configuration containing real room details to a public repository.
Configuration
Environment variable | CLI option | Default | Description |
|
| Required | Electricity account room name. |
|
| Required | Electricity account room ID. |
|
|
| Upstream service URL. |
|
|
| Upstream meter database ID. |
|
|
| Electricity price in CNY per kWh. |
Command-line options take precedence over environment variables.
Development
uv sync --group dev
uv run ruff check .
uv run pytestTests do not contact the university service and contain no real room information.
Privacy and security
Room details are sent only to the university electricity service.
Authentication tokens and cookies remain in memory and are not persisted.
The upstream service currently uses plain HTTP, so traffic is not protected by TLS.
All exposed MCP tools are read-only.
Disclaimer
This is an unofficial community project and is not affiliated with or endorsed by South China Agricultural University. The upstream interface may change without notice.
License
Licensed under the MIT License.
Available Tools
4 toolsget_balanceARead-onlyIdempotent
读取当前电费余额、余额刷新时间和电表在线状态。
Inputs: no named parameters. Returns: object
get_daily_energyBRead-onlyIdempotent
读取指定日期范围的用电量; 起止日期均为 YYYY-MM-DD (含首尾)。
Inputs: end_date (required), start_date (required). Returns: object
get_electricity_summaryARead-onlyIdempotent
读取日期范围用电量、电费、累计用电量和当前余额 (含首尾)。
Inputs: end_date (required), start_date (required). Returns: object
get_lifetime_energyARead-onlyIdempotent
读取电表自上线以来截至当前日期的累计总用电量。
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
get_daily_energy and get_electricity_summary both cover date-range electricity usage, but the summary tool explicitly bundles fees, lifetime usage, and balance, making its purpose distinct. The other tools are clearly separated by their specific query targets.
All tool names follow a consistent get_<descriptive_noun> pattern, such as get_daily_energy and get_lifetime_energy. There are no mixed conventions or vague verbs.
Four tools is well-scoped for a read-only electricity meter server. Each tool either serves a specific query or provides a combined summary without unnecessary bloat.
The set covers daily usage, lifetime usage, current balance, and a combined summary, which is sufficient for typical electricity monitoring. A standalone fee breakdown or current power reading could be added, but agents will not encounter significant dead ends.
Maintenance
Related MCP Connectors
Free, read-only MCP subset of x402 Toolbox's cheap data endpoints, free via MCP.
MCP server providing attendance data queries via the CloudTime API.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides MCP tools to read SJTU Canvas data, download course files, and access video/subtitle resources without authentication simulation.211MIT
- FlicenseNot gradedqualityDmaintenanceEnables querying student information such as marks, attendance, pending assignments, and timetables from a MySQL database through MCP tools.-
- FlicenseNot gradedqualityDmaintenanceEnables read-only queries of i桂航 campus data, including schedules, classes, terms, and campus information through MCP tools.-
- AlicenseNot gradedqualityBmaintenanceRead-only MCP server for Chaoxing (学习通) that logs into a user's account and exposes their class schedule, enrolled courses, course materials downloads, homework status, exam schedules and scores, chapter task-point progress, notices, and personal cloud drive files. Enables any MCP client to answer natural-language questions about a student's coursework without submitting anything or modifying account data.25MIT