Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
.venv/
**/__pycache__/**
**/__pycache__/**
soln.log
output.crf
output.sum
temp.wrk
cont.otg
contproc-run-status.csv
control.cntl
datacheck.txt
runs.cases
duplicate.txt
sstools.sav
term.log
case.pcrf
output.pcrf
Output.xlsx
run.bat
template.ctab
contproc-run-status_contingency_errors.csv
font-color
gediwork.drw
gediworkScan.drw
winter.sav
summer.drw
summer.sav
hs_err*
basecase.sav
1,625 changes: 1,625 additions & 0 deletions PSLF/generate-otg.p

Large diffs are not rendered by default.

759 changes: 750 additions & 9 deletions PSLF/pslf_mcp.py

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ Or for PowerWorld.
}
}
```
4) Start the MCP server, replacing the model name and config file with your preferred option.
4) Start the MCP server in interactive mode, use the following command. Replace the model name and config file with your preferred option.
```
mcphost -m ollama:qwen3:4b --config .\config.json
mcphost -m ollama:qwen3:4b --config .\config.json --system-prompt .\system-prompt.md
```

To run a test prompt that runs the LLM through a test and saves the output to a report, use the following command.
```
mcphost script pslf_test.prompt
```

### Video Demos
Expand Down
Binary file added basecase.sav
Binary file not shown.
Binary file removed psec-1.sav
Binary file not shown.
12 changes: 12 additions & 0 deletions pslf_test.prompt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
mcpServers:
pslf:
command: ["python", "PSLF/pslf_mcp.py"]
model: "google:gemini-2.0-flash"
provider-api-key: "get your key at https://aistudio.google.com/app/apikey"
stream: false
compact: true
prompt: |
You are a practical assistant focused on concise, direct, and correct answers. Do not generate long chains of reasoning or philosophical discussions. If asked a direct question or given a command (e.g., “Open the powerflow case psec-1.sav”), respond with the specific action, result, or step-by-step instructions, nothing more. When unsure, state the uncertainty briefly and provide the best next step, without speculation. Keep responses short, clear, and action-oriented, like a domain expert or technical operator. Only generate a single tool call at a time and make sure it's successful before proceeding.
---
Use PSLF to open basecase.sav and determine the amount of shunt compensation required at the 230 and 345 kV buses (Buses 4, 10 are 345 and Buses 1, 5, 6, 7, 8, 9 are 230.) such that the voltage magnitude lies between 0.99 and 1.02 per unit for all buses in the case.
5 changes: 5 additions & 0 deletions system-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
You are a practical assistant focused on concise, direct, and correct answers.
- Do not generate long chains of reasoning or philosophical discussions.
- If asked a direct question or given a command (e.g., “Open the powerflow case psec-1.sav”), respond with the specific action, result, or step-by-step instructions, nothing more.
- When unsure, state the uncertainty briefly and provide the best next step, without speculation.
- Keep responses short, clear, and action-oriented, like a domain expert or technical operator.