solarnetwork-mcp
by hoodsy
README.md
# solarnetwork-mcp
Read-only [MCP](https://modelcontextprotocol.io) server for [SolarNetwork](https://solarnetwork.net) — query solar generation, consumption, and other DER telemetry over the SolarQuery API. Zero config against a public demo node. Public (`/pub`) mode only; authenticated (sec) mode is not implemented.
## Setup
```bash
npm install
npm run build
npm test # offline, against captured fixtures
npm run smoke # live check against demo node 108
```
MCP client config (stdio):
```json
{
"mcpServers": {
"solarnetwork": {
"command": "node",
"args": ["/path/to/solarnetwork-mcp/dist/index.js"]
}
}
}
```
## Tools
| Tool | Answers |
|---|---|
| `get_reportable_interval` | What date range has data? (call first) |
| `list_sources` | Which source IDs exist? |
| `get_latest` | Most recent datum per source |
| `query_datum` | Time series between two node-local dates (Day/Hour/Month; raw guarded) |
| `get_meter_reading` | Energy used/generated over a period |
Responses are compact `{ data, meta }` JSON; `meta` reports `count`, `truncated`, and paging. Day aggregation by default, 500-row cap, raw queries over 7 days require `allowRaw`.
## Demo node
Node **108** — public, posting since 2013, time zone `Pacific/Auckland`. Sources: `DB` (bidirectional meter, richest stream), `Main` (intermittent), `A`/`B`/`C` (phase watts), `OfficeTemp` (dormant). A complete month to query: June 2026.
## Environment
| Variable | Default |
|---|---|
| `SN_HOST` | `https://data.solarnetwork.net` |
| `SN_TOKEN`, `SN_SECRET` | unset; sec mode is unimplemented and the server fails fast if they are set |
TDQS
A4.4/5.0
Scored across 5 tools
Disambiguation4/5
Tools have distinct purposes: obtaining date ranges, listing sources, retrieving latest data, querying time series, and computing meter readings. Minor potential overlap between query_datum and get_meter_reading is clarified by descriptions.
Naming Consistency5/5
All tool names follow a consistent verb_noun pattern (e.g., get_reportable_interval, list_sources) with underscores, ensuring predictability.
Tool Count5/5
Five tools cover the essential operations for a solar network data API without being excessive or insufficient, well-scoped for the purpose.
Completeness4/5
The tools cover data availability, source listing, latest data, time series queries, and meter readings. Minor gaps like source metadata are absent but acceptable for a read-only API.
Maintenance
ActivityStale
ResponsivenessNo issues