PowerMCP is an open-source collection of MCP servers for power system software like PowerWorld and OpenDSS. These tools enable LLMs to directly interact with power system applications, facilitating intelligent coordination, simulation, and control in the energy domain.
The Model Context Protocol (MCP) is a revolutionary standard that enables AI applications to seamlessly connect with various external tools. Think of MCP as a universal adapter for AI applications, similar to what USB-C is for physical devices. It provides:
- Standardized connections to power system software and data sources
- Secure and efficient data exchange between AI agents and power systems
- Reusable components for building intelligent power system applications
- Interoperability between different AI models and power system tools
We're building an open-source community focused on accelerating AI adoption in the power domain through MCP. Our goals are:
- Collaboration: Bring together power system experts, AI researchers, and software developers
- Innovation: Create and share MCP servers for various power system software and tools
- Education: Provide resources and examples for implementing AI in power systems
- Standardization: Develop best practices for AI integration in the energy sector
π New to PowerMCP? Start here!
The recommended way to get started is the powermcp package and its installer (see the Installation section below):
pip install powermcp
powermcp install # pick tools, capture local paths, write your MCP client configπ The PowerMCP Tutorial PDF documents the original low-code / manual setup β cloning the repo and hand-editing the Claude Desktop config. It predates the
powermcpinstaller and is not the recommended path; use it only if you specifically want the manual approach.
Check out these demos showcasing PowerMCP in action:
-
Contingency Evaluation Demo: An LLM automatically operates power system software, such as PowerWorld and pandapower, to perform contingency analysis and generate professional reports.
-
Loadgrowth Evaluation Demo: An LLM automatically operates power system software, such as PowerWorld, to evaluate different load growth scenarios and generate professional reports with recommendations.
MCP follows a client-server architecture where:
- Hosts are LLM applications (like Claude Desktop or IDEs) that initiate connections
- Clients maintain 1:1 connections with servers, inside the host application
- Servers provide context, tools, and prompts to clients
Check out these helpful tutorials to get started with MCP:
- Getting Started with MCP: Official introduction to the Model Context Protocol fundamentals.
- Core Architecture: Detailed explanation of MCP's client-server architecture.
- Building Your First MCP Server: Step-by-step guide to creating a basic MCP server.
- Anthropic MCP Tutorial: Learn how to use MCP with Claude models.
- Cursor MCP Tutorial: Learn how to use MCP with Cursor.
- Other Protocol: Open AI Function Calling Tool
PowerMCP installs as a single Python package with an interactive CLI. Python 3.10+ is required.
pip install powermcpThe base install includes the open-source engines that need no extra setup β pandapower, PyPSA, and PowerIO (the cross-server case-conversion substrate). Every other tool is opt-in via an extra:
pip install powermcp[psse] # add PSS/E support
pip install powermcp[andes,opendss] # add several tools at once
pip install powermcp[opensource] # all open-source tools (ANDES, Egret, OpenDSS, surge, HOPE, LTSpice, GenX)
pip install powermcp[all] # everything (closed-source tools still need the local software)powermcp installThe wizard lets you pick tools (pandapower + PyPSA + PowerIO pre-selected), captures the local install path for any closed-source/EXE-based tools you choose (PSS/E, PSLF, PowerFactory, PSCAD, LTSpice), installs the right extras, and writes the MCP client configuration for Claude Desktop, Claude Code, and the Codex CLI. Use --dry-run to preview the changes, or --yes for a non-interactive core install.
In the interactive picker, move with β/β and press SPACE to toggle each tool before ENTER (ENTER alone keeps only the preselected tools). Prefer not to use the checkbox? Choose tools directly:
powermcp install --tools psse,andes # core + the listed tools
powermcp install --all # every tool available on this platformRe-running powermcp install pre-checks the tools you've already installed or configured, so it preserves and updates your setup instead of resetting to the core tools. Paths for tools like LTSpice are auto-detected and pre-filled, so you can usually just press Enter.
| Command | Description |
|---|---|
powermcp install |
Setup wizard β interactive, or --tools <ids> / --all (also --dry-run, --yes, --clients) |
powermcp run <tool> |
Launch a server over stdio (used by the generated client config) |
powermcp list |
List the available tools, extras, and Windows-only flags |
powermcp doctor |
Check each tool's dependencies and configured paths |
powermcp config show / config set <tool>.<key> <path> |
Inspect / set local software paths |
These tools wrap commercial or locally-installed software, so PowerMCP stores the local path in ~/.powermcp/config.toml (captured by powermcp install, or set manually with powermcp config set):
| Tool | Config keys | Example |
|---|---|---|
| PSS/E | psse.python_lib, psse.bin |
powermcp config set psse.python_lib "C:\Program Files\PTI\PSSE36\36.2\PSSPY311" |
| PSLF | pslf.python_lib |
powermcp config set pslf.python_lib "C:\Program Files\GE PSLF\PSLF_PYTHON" |
| PowerFactory | powerfactory.python_path |
powermcp config set powerfactory.python_path "...\DIgSILENT\PowerFactory 2024\Python\3.11" |
| LTSpice | ltspice.exe (auto-detected) |
Found automatically in standard locations β usually no setup needed. Override: powermcp config set ltspice.exe "C:\Program Files\ADI\LTspice\LTspice.exe" |
| HOPE | hope.repo_root, hope.julia_bin |
powermcp config set hope.repo_root "C:\src\HOPE" |
| GenX | genx.repo_root |
powermcp config set genx.repo_root "/home/me/GenX.jl" β the GenX.jl checkout; GENX_DIR overrides it |
| PowerWorld | (none) | esa auto-discovers a running, licensed Simulator via COM; the powerworld extra also installs numba (required by esa) |
| PSCAD | (none) | pip install powermcp[pscad-windows] provides mhi-pscad; PSCAD must be installed |
The Codex Desktop app on Windows has been reported to overwrite
~/.codex/config.toml; the Codex CLI is unaffected. If you use both, re-runpowermcp installafter Desktop edits.
PowerMCP runs the MCP server that powerio ships in its own wheel, as a core dependency (no extra needed) β powermcp run powerio is python -m powerio.mcp, so a powerio release that adds tools or changes their implementation needs no local server copy. It parses transmission and distribution formats into canonical JSON transports, converts between target artifacts with fidelity warnings, and builds the sparse matrices solvers need (B', B'', Y_bus, PTDF, LODF, Laplacian, LACPF).
Its JSON transport is the exchange format between PowerMCP servers: parse a case once, pass the returned json string between tool calls, and save runtime artifacts only when a backend needs a file. Existing json transport workflows remain supported.
parse(path="case9.raw") # powerio server -> {"json": ..., "summary": ...}
load_network_from_json(network_json=...) # pandapower server ingests the transport
load_model_from_json(network_json=...) # egret server stages it as a solvable case file
import_case_from_json(network_json=..., output_path="case9.nc") # PyPSA server writes a .nc for its tools
matrix(kind="ptdf", json=...) # powerio server builds matrices from it
save(to_format="psse", out_path="case9.raw", json=...) # stage a file for path only servers
PowerIO also supports the .pio.json package transport, which carries the model plus package metadata and structured diagnostics:
parsed = parse(path="case9.raw", transport="package")
pkg = parsed["package_json"]
summary(package_json=pkg)
matrix(kind="ptdf", package_json=pkg)
save(to_format="psse", out_path="case9.raw", package_json=pkg)
diagnostics(package_json=pkg) # package diagnostics summary and structured findings
A package can also retain provenance and source maps, stable row identities, validation state, operating-point series, cumulative study commits, and lowering history. The canonical PowerIO MCP tools continue to own that package lifecycle. PowerMCP uses the package only at the solver boundary:
# A static package loads directly.
import_case_from_json(network_json=pkg, output_path="case9.nc")
# A package with one or more stored states requires an explicit selection.
# PowerIO v0.9 materializes and validates the selected state before PowerMCP
# creates the solver model.
import_case_from_json(
network_json=pkg,
output_path="dispatch.nc",
operating_point=3,
)
load_network_from_json(network_json=pkg, study_commit=1) # pandapower
The same operating_point and study_commit selectors are available on the
PowerIO import tools for pandapower, PyPSA, ANDES, and Egret. PowerMCP rejects
unselected stored state data instead of silently solving the package's base model.
Study materialization honors the package's base_operating_point. Balanced
solvers also reject multiconductor packages until the caller explicitly lowers
them with PowerIO, so a lossy distribution-to-transmission reduction is never
implicit. PyPSA and pandapower use PowerIO's native writers, preserving the
supported cost and in-service metadata without PowerMCP rebuilding PYPOWER
tables.
summary returns the canonical nested shape used by PowerIO and PowerMCP: counts live under elements (elements.buses, elements.branches, elements.generators) and topology metadata lives under topology (topology.connected_components, topology.reference_buses).
save covers the servers without a bridge: write the converted case to disk and point their load tools at the file. For OpenDSS, save a distribution transport as DSS, then compile that DSS file:
save(to_format="dss", out_path="feeder.dss", json=..., json_format="bmopf-json")
compile_opendss_file(dss_file="feeder.dss")
PowerWorld .pwd display files decode separately via display(path=...), which returns the diagram canvas and each substation's display coordinates. The display geometry is distinct from the .pwb/.aux case data.
PowerIO MCP tools accept local paths and file:// URIs. Nonlocal URI schemes are rejected. Set POWERIO_MCP_ALLOWED_ROOTS to an os.pathsep separated list of directories to constrain paths handled by the shared PowerIO sandbox. PyPSA preflights a NetCDF file or every descendant of a CSV directory before constructing a network, and both explicit and legacy-derived CSV import destinations are checked before writing. PyPSA and surge install directory outputs from a private sibling staging directory. Generated run directories exposed by the bundled servers use the same path policy. Put POWERMCP_HOME under an allowed root if ANDES, Egret, or LTSpice should write run artifacts while containment is enabled. These are path preflight checks; another process can replace a checked entry before a backend opens it.
Every bundled server is still a standalone script. Clone the repo and run any server directly for use in Claude Desktop:
python pandapower/panda_mcp.py
python PSSE/psse_mcp.py # uses ~/.powermcp/config.toml if present, else legacy default paths
python -m powerio.mcp # powerio ships its own server; the clone holds no copyNote: All MCPs should be tested via an MCP client (Claude Desktop, Claude Code, or Codex) before submitting a PR to ensure consistency.
powermcp install writes the client configuration for you. The generated entries look like the example in config.json. (The PowerMCP Tutorial PDF covers the older manual / low-code setup and isn't needed for the package install.)
For detailed documentation about MCP, please visit:
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Qian Zhang, Steven Black, Paulo Radatz, Andrea Pomarico, Muhy Eddin Zaβter, Luan Lopes dos Santos, Stephen Jenkins, Maanas Goel, Shen Wang, Drew Gray, Samuel Talkington
- All contributors who help make this project better
- The Power and AI Initiative (PAI) at Harvard SEAS