PowerFactory MCP Automation
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., "@PowerFactory MCP Automation run a load flow study on the current network"
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.
PowerFactory MCP Automation
Natural-language automation for DIgSILENT PowerFactory using the Model Context Protocol (MCP).
This project lets an MCP client ask PowerFactory to run repeatable engineering tasks such as load-flow studies, bus-voltage extraction, line switching, three-phase short-circuit studies, and line N-1 short-circuit capacity sweeps.
Why this project exists
PowerFactory studies often require repetitive manual steps:
Change network state.
Run a calculation.
Export results.
Restore the original state.
Repeat for the next contingency.
This repository wraps those steps behind controlled MCP tools so engineers can request study workflows in natural language while PowerFactory remains the calculation engine.
Related MCP server: opendss-mcp-server
Features
MCP server for PowerFactory automation
In-app PowerFactory Python agent for robust GUI-session control
Load-flow execution
Bus-voltage and line-loading extraction
Line open/close control
Three-phase short-circuit calculation at a selected bus
Line N-1 short-circuit capacity study with CSV export
Example innovation proposal PDF/PPT generation scripts
Repository layout
.
├── src/powerfactory_mcp/
│ ├── agent.py # Run inside PowerFactory as MCP_Agent
│ ├── server_bridge.py # Recommended MCP server
│ ├── server_direct.py # Optional direct external API server
│ └── legacy_py33_bridge.py # Legacy helper for old PowerFactory versions
├── scripts/
│ ├── find_powerfactory_python.ps1
│ └── test_bridge_connection.py
├── docs/
│ ├── ARCHITECTURE.md
│ ├── SETUP.md
│ ├── TROUBLESHOOTING.md
│ └── WORKFLOWS.md
├── examples/
│ └── n_minus_1_short_circuit_bus_5.csv
├── tools/
│ ├── generate_innovation_pdf.py
│ └── build_innovation_ppt.mjs
├── mcp_config.example.json
├── pyproject.toml
└── requirements.txtQuick start
Install dependencies:
python -m venv .venv312
.\.venv312\Scripts\python.exe -m pip install -r requirements.txtCreate a Python script in PowerFactory named MCP_Agent, paste the contents of:
src/powerfactory_mcp/agent.pyRun MCP_Agent inside PowerFactory. Then test the bridge:
.\.venv312\Scripts\python.exe .\scripts\test_bridge_connection.pyConfigure your MCP client using:
mcp_config.example.jsonExample result
The included example ran a line N-1 three-phase short-circuit study at Bus 5. The limiting case was:
Outaged line: Line 4-5
Ikss: 1.0144 kA
Skss: 404.09 MVASee:
examples/n_minus_1_short_circuit_bus_5.csvDocumentation
Notes
This project assumes you are using a properly licensed PowerFactory installation. It does not bypass, modify, or automate licensing.
Available Tools
16 toolsactivate_projectC
Activate a PowerFactory project by name.
Inputs: project_name (required). Returns: object
activate_study_caseB
Activate a study case by name in the active project.
Inputs: study_case_name (required). Returns: object
connectC
Connect to PowerFactory through the in-app agent.
Inputs: show. Returns: object
export_bus_voltages_csvC
Export bus voltage results to CSV.
Inputs: path. Returns: object
export_line_loadings_csvC
Export line loading results to CSV.
Inputs: path. Returns: object
get_active_projectA
Return the currently active project.
Inputs: no named parameters. Returns: object
get_bus_voltagesA
Read voltage results for all calculation-relevant terminals.
Inputs: no named parameters. Returns: result
get_line_loadingsA
Read loading results for all calculation-relevant lines.
Inputs: no named parameters. Returns: result
list_busesA
List calculation-relevant buses/terminals.
Inputs: no named parameters. Returns: result
list_linesB
List calculation-relevant transmission lines.
Inputs: no named parameters. Returns: result
list_projectsA
List projects available under the current PowerFactory user.
Inputs: no named parameters. Returns: result
list_study_casesA
List study cases in the active project.
Inputs: no named parameters. Returns: result
run_load_flowB
Run load flow in the active study case.
Inputs: no named parameters. Returns: object
run_n_minus_1_line_short_circuitB
Open each line one at a time and measure 3-phase short-circuit level at a target bus.
Inputs: target_bus_name (required), export_path. Returns: object
run_three_phase_short_circuitC
Run a three-phase short-circuit calculation at a bus and return Ikss/Skss.
Inputs: bus_name (required). Returns: object
set_line_out_of_serviceC
Open or close a line by setting its out-of-service flag.
Inputs: line_name (required), out_of_service. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a distinct purpose: project activation, study case management, data retrieval, calculations, and export. There is no overlap, as even similar tools like get_bus_voltages and export_bus_voltages_csv serve different workflow stages (read vs export).
All tools follow a consistent verb_noun pattern with snake_case (e.g., activate_project, list_buses, run_load_flow). Longer names like run_n_minus_1_line_short_circuit still adhere to the pattern, making the toolset predictable.
With 16 tools, the server covers a comprehensive yet focused scope for PowerFactory automation—project/study case management, data retrieval, simulation runs, and export. This is well within the ideal range and each tool is justified.
The toolset covers core workflows (connect, activate, run analysis, retrieve results, export) but lacks create/delete operations for projects and study cases, and only allows modification of lines (out-of-service). Missing are tools for other element modifications or alternative analyses, limiting lifecycle coverage.
Maintenance
Related MCP Connectors
Protocol-native energy infrastructure orchestration for AI data centers. Provides 46 MCP tools across 8 grid protocols (IEC-61850, DNP3, Modbus, OCPP, OpenADR, IEEE 2030.5, IEC 60870-5-104, ICCP) with 5 core API primitives: connect, dispatch, settle, comply, and intel. Enables AI agents to programmatically interact with substations, grid interfaces, and energy assets for real-time workload-grid coordination.
AI-powered life cycle assessment and modelling: connect to LCA databases, build and analyze systems
Edit AutoCAD and Revit MEP drawings from Claude or ChatGPT in plain English.
Structural FEM for AI agents: frames, plates, buckling, seismic and Eurocode checks, solved locally.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables conversational power system analysis by connecting Claude AI with EPRI's OpenDSS simulator. Allows distribution planning engineers to perform sophisticated electrical grid studies through natural language instead of complex scripting.MIT
- AlicenseNot gradedqualityDmaintenanceConnects Claude AI with EPRI's OpenDSS power system simulator, enabling conversational power system analysis for distribution planning.4MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language control of Aspen Plus for chemical process simulation, including parameter tuning, batch runs, and result reading.7MIT
- AlicenseNot gradedqualityCmaintenanceEnables natural-language control of CST Studio Suite for electromagnetic simulation, covering modeling, materials, ports, solvers, result reading, and VBA scripting, with an embedded knowledge base and constraint hooks that self-evolve through use.10Apache 2.0