feederline-mcp · Open source · Apache 2.0
A CIM (IEC 61970-301) operational data store on PostgreSQL, PostGIS and pgRouting, plus a Model Context Protocol server that compiles any feeder from it into an in-process OpenDSS circuit, so AI agents such as Claude can run power-flow, hosting-capacity, voltage, fault and time-series studies on a utility network model.
In Claude Desktop
Prompt 01 · Voltage
“Plot the voltage profile by phase against distance from the head, with 0.95 and 1.05 pu limit lines.”
Claude loads the feeder, solves it, pulls the per-bus voltages with distance from the head, and plots phases A, B and C against the limits. All 278 bus-phase points are within limits, and it says where the min and max sit.
load_feederrun_power_flowcheck_voltagesPrompt 02 · Loading
“Load Feeder 123 on IEEE 123, run a power flow, and show line loading above 50% on the map in-line.”
Results carry their geometry, so Claude draws the feeder map in the chat with lines coloured by loading band and regulators and capacitors marked. Five segments at the head are over 100%; the rest is under 50%.
load_feederrun_power_flowline_loadingfeeder_geometryPrompt 03 · Hosting capacity
“Analyze PV hosting capacity at bus 65 on IEEE 123 in 250 kW steps up to 3,000 kW. Plot max voltage and max loading per step, and tell me which limit binds.”
The sweep stops at the first violation; Claude reruns it with only reverse flow as a stop condition to get the full curve. Bus 65 hosts 500 kW, and overvoltage is the limit that binds: at 750 kW the feeder reaches 1.0507 pu.
analyze_capacitycreate_visualizationArchitecture
Claude Desktop reaches the server over a stdio bridge, Claude Code over HTTP with a bearer token. SQL tools answer straight from Postgres with no session. Engine tools compile the feeder into an in-memory OpenDSS circuit that lives for the chat, and write their studies back to the studies schema. Public datasets load the store from the bottom.
Public data only
The local stack is for public datasets: IEEE test feeders, NREL SMART-DS, HIFLD-schema mirrors. Real utility network models and loading are CEII (Critical Energy/Electric Infrastructure Information) and must not be loaded into it.
Tools
Simulate the physics. Call load_feeder first; the circuit lives in memory for the chat.
Build and solve
Voltage, loading, losses
DER and protection
What-if and output
Answer from records. Straight from Postgres, no session needed.
Lookup
Topology (pgRouting)
Spatial (PostGIS)
Telemetry
Governance
Every result returns success, data, model, warnings, errors and meta. Each tool's MCP description states its inputs, outputs and units.
data.viz says map, tree, path, timeseries, table or profile, so a client can draw them directly. Large results are capped and point at a grid:// resource holding the rest.
No tool writes to the network model, switch states or telemetry. set_control changes only the in-memory circuit of your session.
Quick start
You need Docker (Docker Desktop or Docker Engine with Compose v2) and Node.js 18+. Nothing else is installed on the host: Postgres, PostGIS, pgRouting, OpenDSS and Python all run in containers. The server listens on 127.0.0.1 only, with a random bearer token generated on first run and kept in ~/.feederline-mcp/config.json.
01 · Start the stack
Pulls images, starts Postgres and the server, migrates, loads IEEE 13/34/123 and seeds demo telemetry. Then prints the connection settings.
npx -y @kartha-energy/feederline-mcp up
npx -y @kartha-energy/feederline-mcp config
02 · Connect Claude Desktop
Add this to claude_desktop_config.json, or run config --write-desktop, which merges it in after writing a backup. Restart Claude Desktop; the 34 tools appear in the tools menu.
{
"mcpServers": {
"feederline-mcp": {
"command": "npx",
"args": ["-y", "@kartha-energy/feederline-mcp", "connect"]
}
}
}
03 · Or connect Claude Code
HTTP transport with the bearer token that config prints.
claude mcp add --transport http feederline-mcp \
http://127.0.0.1:8000/mcp \
--header "Authorization: Bearer <token>"
connect is a stdio bridge to the local server: it reads the token from ~/.feederline-mcp/config.json and starts the stack if it isn't running.load_feeder again.mcp-remote package works too; config prints that variant with your token.What you can ask
A 13-lesson learning path for Claude Desktop: concepts, prompts to type, what to look for in each answer, a prompt cheat sheet and a self-check quiz. The prompts on the left are a few from it.
Read docs/playbook.mdCLI and data
tests/fixtures/feeders. Run by up.--date also ingests that day's load profiles.The same on every install: deterministic uuid5 mRIDs. Demo telemetry is simulated (deterministic, seed 42) for the 30 days before install.
From source
Requires Docker, uv and Python 3.12. PG_PORT= and MCP_PORT= move the host ports. The from-source stack uses the static token dev-token; the npm path never does. The npm CLI lives in npm/ (make npm-build), with its compose files in npm/compose/.
make up # build images; postgres (127.0.0.1:5433), migrations, two MCP replicas behind nginx on :8000
make load-ieee # IEEE 13/34/123 -> CIM, SCADA registry, latest values, network_edges
make demo # 30 days of deterministic demo telemetry
make test # unit, contract, golden (0.1%), loaders, writer, auth/RLS, tools, rehydration, spatial, SQL tools
make inspect # MCP Inspector -> http://localhost:8000/mcp (Authorization: Bearer dev-token)
make ha-check # stop the replica holding a session; the other must serve it
make lint # ruff + import-linter (tools/ and compiler/ depend only on adapters/base.py)
The server reads a DataSource, writes a StudySink and trusts an Auth (protocols in feederline_mcp/adapters/base.py). Implementations are discovered through the Python entry-point group feederline_mcp.adapters and selected with FEEDERLINE_MCP_ADAPTER (default local: one Postgres, the studies schema, a static bearer token). Another backend ships as a separate package that registers its own entry point:
[project.entry-points."feederline_mcp.adapters"]
mybackend = "my_package.adapter:build" # build(settings) -> (DataSource, StudySink, Auth)
Any Postgres 16+ with PostGIS 3.4+ and pgRouting 3.4+ runs the schema. Sessions rehydrate on any replica from a shared snapshot directory (SNAPSHOT_DIR).
Docs, contributing, license
Learning the grid with Claude Desktop: concepts, 13 lessons, cheat sheet, quiz.
Start hereDCO sign-off (git commit -s), running the tests, code rules. Report vulnerabilities privately via SECURITY.md.
feederline-mcp is created by Kartha Energy, the energy and utilities practice of Kartha AI. We build agentic workflows on frontier models, delivered by forward-deployed engineers on a context and trust layer brought to every engagement. For production deployments, connectors to other data platforms and support, talk to the practice.