Skip to main content
Glama
xnbx2012

scau-electricity-mcp

by xnbx2012

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

get_daily_energy

start_date, end_date

Returns total usage and per-day readings for an inclusive date range.

get_balance

None

Returns the current balance, refresh time, and meter online status.

get_lifetime_energy

None

Returns cumulative electricity usage since the meter came online.

get_electricity_summary

start_date, end_date

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

  • uv

  • Network access to http://cz.scau.edu.cn

  • Your SCAU electricity room name and room ID

Installation

git clone https://github.com/xnbx2012/scau-electricity-mcp.git
cd scau-electricity-mcp
uv sync

If 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.py

The 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

SCAU_ROOM_NAME

--room-name

Required

Electricity account room name.

SCAU_ROOM_ID

--room-id

Required

Electricity account room ID.

SCAU_BASE_URL

--base-url

http://cz.scau.edu.cn

Upstream service URL.

SCAU_DB_ID

--db-id

9853

Upstream meter database ID.

SCAU_ELECTRICITY_PRICE

--electricity-price

0.63

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 pytest

Tests 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 tools
get_balanceA
Read-onlyIdempotent

读取当前电费余额、余额刷新时间和电表在线状态。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds the specific data points retrieved (balance, refresh time, online status), which provides useful scope but no additional behavioral traits such as caching, freshness, or error behavior. With annotations covering the core behavior, a 3 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One concise sentence that front-loads the main action and lists all returned data elements with no filler or redundant detail. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters, a comprehensive output schema, and annotations covering the read-only/idempotent behavior, the description provides all necessary context. An agent can invoke this tool correctly without any further information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the schema is trivially complete. The baseline is 4 for no params, and the description does not need to explain any parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb '读取' (read) and clearly names the resources: current electricity balance, balance refresh time, and meter online status. This is distinct from the sibling tools (get_daily_energy, get_lifetime_energy, get_electricity_summary), which focus on energy consumption rather than balance, so an agent can easily tell it apart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes it clear that this tool is for balance-related queries, which implicitly distinguishes it from the energy-focused siblings. It does not explicitly name alternatives or provide when-not-to-use guidance, but the context is sufficiently clear that an agent can infer the correct usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_daily_energyB
Read-onlyIdempotent

读取指定日期范围的用电量; 起止日期均为 YYYY-MM-DD (含首尾)。

ParametersJSON Schema
NameRequiredDescriptionDefault
end_dateYes
start_dateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile with readOnlyHint, idempotentHint, and destructiveHint false. The description adds useful behavioral context by specifying YYYY-MM-DD format and inclusive endpoints, but does not disclose granularity, timezone handling, or response shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one tight sentence that front-loads the action and scope and then adds the necessary date-format detail. There is no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool, the description plus annotations and output schema give enough information to call it correctly. The only notable gaps are explicit sibling guidance and timezone/unit nuance, which are minor here.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does specify that both dates use YYYY-MM-DD and are inclusive, adding meaning beyond the raw schema. It does not clarify units, aggregation granularity, or timezone effects, which remain open.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb '读取' (read) and resource '用电量' (electricity consumption) bounded by a date range, making the core purpose clear. However, it does not explicitly differentiate from siblings like get_lifetime_energy or get_electricity_summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool rather than a sibling, nor are alternatives mentioned. The date-range scope implies a daily view, but the description leaves selection criteria entirely to the agent's inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_electricity_summaryA
Read-onlyIdempotent

读取日期范围用电量、电费、累计用电量和当前余额 (含首尾)。

ParametersJSON Schema
NameRequiredDescriptionDefault
end_dateYes
start_dateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds useful context beyond those annotations, notably that the date range is inclusive ('含首尾') and that the summary includes balance and cumulative usage. This helps the agent understand the tool's exact scope without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact sentence that front-loads the main action and lists the key data points. Every element earns its place, and there is no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Complexity is low: two simple date parameters, rich annotations, and an output schema are present. The description adds the important inclusive-endpoint behavior and the summary's contents. It is slightly incomplete only in lacking explicit parameter format guidance and sibling differentiation, but the tool remains invocable correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides only type/required info with 0% description coverage, so the description must compensate. It clarifies that the two parameters define a date range and that both endpoints are inclusive, which adds meaning beyond the raw schema. However, it does not specify date formats, constraints, or the relationship between the cumulative usage and the date range.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description identifies a specific verb ('读取' / read) and a clear resource: an electricity summary covering date-range usage, bill, cumulative usage, and current balance. This clearly distinguishes it from the sibling tools like get_daily_energy, get_balance, and get_lifetime_energy, though it does not explicitly name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied by '读取日期范围...' — use it when a date-range electricity summary is needed. However, there is no explicit guidance about when to prefer this tool over get_balance or get_lifetime_energy, and no exclusions or alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_lifetime_energyA
Read-onlyIdempotent

读取电表自上线以来截至当前日期的累计总用电量。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds the important temporal behavior—cumulative total from meter activation to the current date—which is useful context beyond the annotations and helps avoid misinterating the query with a daily or period-specific measurement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The entire description is a single, focused sentence in Chinese with no redundant phrasing. It front-loads the action and immediately specifies the exact time horizon, so every part of the sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless, read-only, idempotent tool with an output schema and clear annotations, this description provides all essential operational context. The agent knows what action to take, what the scope is, and that no side effects or required arguments exist.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters and schema description coverage is 100%, so the description has no parameter burden. The baseline of 4 for parameterless tools is appropriate; there are no parameters whose meaning needs clarification.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('读取' meaning 'read') and a precise resource: the meter's cumulative total electricity consumption from online activation through the current date. This clearly differentiates it from siblings like get_daily_energy which implies a daily scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The lifetime/date-range semantics are explicit, so an agent can infer this is appropriate when cumulative since-online data is needed. It does not explicitly mention alternatives or exclusions, but the scope language effectively routes around daily or summary siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4/5.0
Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    This MCP server provides a single read-only tool to query official CPFL (electric utility) bill download data via a hosted, prepaid service without requiring platform credentials.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Read-only MCP server for consulting Enel CE (Ceará, Brazil) energy bills and downloads from official sources via a single tool, using prepaid credit.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xnbx2012/scau-electricity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server