Skip to main content

psr-factory-mcp

An MCP server that exposes 63 PSR/SDDP power-system tools to Claude Code through a single unified server. Includes a skill that gives Claude a complete workflow guide — no tool discovery step required.


Prerequisites

Requirement Notes
Python 3.10+ Must be on your PATH
PSR Factory ≥ 5.0.0b190 Licence must be installed and active on this machine
Claude Code Desktop app or CLI (latest version)

Installation

1 — Install the package

pip install psr-factory-mcp

This installs the psr-factory-mcp command on your PATH.

2 — Register the MCP server

Add the following entry to ~/.claude/settings.json under "mcpServers":

"mcpServers": {
  "psr-factory-mcp": {
    "command": "psr-factory-mcp"
  }
}

Claude Desktop uses %APPDATA%\Claude\claude_desktop_config.json instead of ~/.claude/settings.json. The JSON structure is identical — add the block under "mcpServers".

3 — Install the skill

psr-factory-mcp skills

This copies the bundled psr-factory-mcp-skill into .agents/skills/ and .claude/skills/ in the current project. Pass -g/--global to install it for your user instead (~/.agents/skills/ and ~/.claude/skills/), and -y/--yes to skip the confirmation prompt. Re-run the command after upgrading psr-factory-mcp to pick up any skill updates.


Without the skill

All MCP tools are directly callable from any Claude Code session — the skill just provides additional workflow context.

Setup calls

Every session requires one setup call before domain tools:

Goal Setup tool
Read / query input data setup_input_study(path)
Edit a case (safe copy) setup_edit_study(original, target)
Edit in-place (needs user approval) setup_edit_study_inplace(path)
Manage output files setup_output_case(path)

Example — query thermal plant capacity

setup_input_study("C:/studies/case")
get_objects_by_type("ThermalPlant")
get_objects_table("ThermalPlant", ["InstalledCapacity", "MarginalCost"])

Example — scale all thermal costs by 10%

setup_edit_study("C:/studies/case", "C:/studies/case_+10pct")
get_objects_table("ThermalPlant", ["MarginalCost"])
scale_dataframe("ThermalPlant Gas1 [3]", "MarginalCost", 10)
# ... repeat for each plant key
save_study("C:/studies/case_+10pct")

Tool Reference

All 63 tools across 10 categories:

Category Tools
Setup setup_input_study, setup_edit_study, setup_edit_study_inplace, setup_output_case, save_study
Run get_case_version, list_available_versions, run_psr_model, get_run_status, read_run_log, kill_run
Discovery discover_objects, discover_object_properties, list_tables, get_all_objects, get_objects_by_type, get_neighbors
Query get_static_properties, get_dynamic_property, get_objects_table, get_table, table_schema_head
Filter & Aggregate query_by_property_condition, find_by_reference, count_by_reference, sum_property_by_reference
Input DataFrame input_get_dataframe, input_aggregate_dataframe, input_filter_dataframe_by_index, input_filter_dataframe_by_value
Binary DataFrame input_get_binary_dataframe, input_aggregate_binary_dataframe, input_filter_binary_dataframe_by_index, input_filter_binary_dataframe_by_value
Edit modify_static_element, rename_element, modify_element_code, modify_element_key, get_dataframe_schema, set_dataframe, scale_dataframe, clear_dataframe, edit_table, set_table, remove_elements, replace_references, create_element, modify_study_setting
Output Management list_enabled_outputs, list_enabled_outputs_paths, get_output_num, convert_output, change_output_availability
Output DataFrame df_info, df_aggregate, df_select_columns, df_combine_columns, df_filter_by_value, df_filter_between, df_filter_by_index, df_merge, df_concat

For full descriptions and usage examples see the skill at src/psr/mcp/.agents/skills/psr-factory-mcp-skill/SKILL.md.


Repository Structure

PSR-Plugin/
├── pyproject.toml                      # Package: psr-factory-mcp
└── src/psr/mcp/
    ├── __main__.py                     # console-script dispatcher: `skills` vs. MCP stdio launch
    ├── skills.py                       # installs .agents/skills/* for coding agents
    ├── .agents/skills/
    │   └── psr-factory-mcp-skill/
    │       └── SKILL.md                # Analyst workflow guide (63 tools)
    ├── common.py                       # Study setup + artifact discovery
    ├── input_discover.py               # Query and filter tools
    ├── edit_case.py                    # Edit tools
    ├── outputs.py                      # Output management + DataFrame tools
    ├── execution.py                    # Run/execution tools
    ├── state.py                        # Shared study state
        └── server.py                   # Unified MCP server — all tools registered here

How the MCP Server Works

All tools are registered at startup and immediately callable — no discovery or activation step is needed.

find_tools(query) is an optional helper that ranks the catalog by relevance to a natural-language query. Use it only when you don't know a tool's name.


Adding a New Tool

1 — Write the function in the appropriate module

# src/psr/mcp/input_discover.py
def my_new_tool(obj_key: str, value: float) -> str:
    """One-line summary."""
    ...

2 — Register it in the MCP catalog

# src/psr/mcp/server.py — CATALOG dict
"my_new_tool": {
    "fn":          _input.my_new_tool,
    "stub":        "Short label (5–10 words)",
    "description": "One-line description shown in find_tools results.",
    "tags":        ["query", "input"],
},

Available tags: setup, input, edit, output, discovery, query, filter, aggregate, dataframe, binary, run.

Metadata

Release files for psr-factory-mcp 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psr-factory-mcp 0.8.1
File Size Uploaded Provenance Actions
psr_factory_mcp-0.8.1.tar.gz 88.2 kB With provenance Details for psr_factory_mcp-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for psr-factory-mcp 0.8.1
File Interpreter ABI Platform Actions
psr_factory_mcp-0.8.1-py3-none-any.whl Python 3 none any Details for psr_factory_mcp-0.8.1-py3-none-any.whl

Total release size: 173.4 kB

Release files / psr_factory_mcp-0.8.1.tar.gz

Download URL psr_factory_mcp-0.8.1.tar.gz
Size 88.2 kB
Tags Source
SHA-256 checksum
How to use checksums
af5c0cc83139f01fbf9f60443deb0588145ddce0d96d1514abebf090c7fdd87e
BLAKE2b-256 checksum
How to use checksums
119381b4aa509d29127c4a2f2ab8ecbbce29d0919cdb55945071b146e28f1152
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / psr_factory_mcp-0.8.1-py3-none-any.whl

Download URL psr_factory_mcp-0.8.1-py3-none-any.whl
Size 85.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c0ac12fe528c735e205b04f9bcacb4346ef5c4fc2a661984a703e2cae934e33
BLAKE2b-256 checksum
How to use checksums
1d8daf3079d07b25efbd9c022d903b75cabd1079ea7a1851fb6d0f5eaed57904
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for psr-factory-mcp 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for psr_factory_mcp-0.8.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page