Skip to content

PowerMCP connector: PLEXOSDB (plexosdb-mcp CRUD + translate-to-Sienna via r2x) #53

Description

@elasticdotventures

Summary

Add a PLEXOSDB PowerMCP connector: a thin re-export of plexosdb-mcp's own MCP server
(direct PLEXOS object/property/membership CRUD, ~28 tools) plus translate_to_sienna and
compare_solutions, calling the r2x package directly. This is the PLEXOS-side half of the
original two-format proposal — the paired SIENNA connector (solve + translate_to_plexos)
is tracked separately as #54, since the two share no PowerMCP code, only the upstream r2x
dependency each calls directly (the same relationship pandapower/PyPSA/Egret/ANDES
each already have with powerio, independently).

User story

As an agent workflow speaking MCP to PowerMCP's tool servers, I want to inspect and edit a
PLEXOS study and translate it toward Sienna — the same way I already call run_power_flow
against pandapower — without a PLEXOS license, installation, or vendor network call.

Why this belongs here

PowerAgent's Model Context Protocol pillar (Zhang & Xie, IEEE PEM 2025) is a tool layer:
multiple engines as peer MCP servers. plexosdb-mcp is purpose-built for exactly this
("agentic integration," "universal interface... without custom API development" per its own
publication) — adopting it is the same compose-don't-rebuild move this repo already makes for
pandapower. PLEXOSDB joins PSS/E, PowerWorld, PSLF, PowerFactory, and PSCAD as a closed-source
engine wrapper, paired (via #54) with a tested, open-source migration path off it.

What will be done

  1. One registry entry. Add "plexosdb" (server_dir="PLEXOSDB") to TOOLS in
    powermcp/registry.py. CLI, doctor, the setup wizard, and client-config generation
    already work off this one dict; no other file needs to change to make it discoverable.
  2. PLEXOSDB/ connector — thin re-export, same shape as powerio/powerio_mcp.py:
    PLEXOSDB/plexosdb_mcp/main.py re-exports plexosdb_mcp's own FastMCP server object
    (mcp = _server.mcp), covering its ~28 CRUD tools as-is. Adds translate_to_sienna and
    compare_solutions, calling r2x directly at the point of use — no PowerMCP-authored
    bridge module (mirrors how pandapower/PyPSA/Egret/ANDES each import powerio
    directly rather than through a wrapper).
  3. Dependency reality check (verified, not assumed):
    • plexosdb-mcp is not on PyPI. Confirmed via uv pip install plexosdb-mcp --dry-run
      (not found) — only the core plexosdb library (v1.5.0) is published. The MCP layer lives
      at NatLabRockies/plexosdb/src/plexosdb-mcp: its own pyproject.toml, v0.1.0, console
      script plexosdb-mcp, deps plexosdb>=1.3.4 + fastmcp>=3.0.0 — a real, cleanly
      packaged project, just not released to PyPI yet.
    • PyPI rejects package metadata that declares a direct git/URL dependency, so
      plexosdb-mcp can't cleanly become a [project.optional-dependencies] entry in
      PowerMCP's own PyPI-published pyproject.toml today (PowerMCP itself ships to PyPI —
      see .github/workflows/publish.yml). Until plexosdb-mcp is on PyPI: document a manual
      two-step install in PLEXOSDB/README.md
      (pip install powermcp, then
      pip install "plexosdb-mcp @ git+https://github.com/NatLabRockies/plexosdb.git@main#subdirectory=src/plexosdb-mcp")
      rather than wiring it into a plexos extra that would break pip install powermcp[plexosdb].
    • The R2X package is r2x (PyPI, v2.1.0 as of this writing — not r2x-cli, which
      does not exist). r2x itself pulls in r2x-core, r2x-plexos, r2x-sienna,
      r2x-plexos-to-sienna, r2x-sienna-to-plexos as its own dependencies; pin r2x alone.
  4. License-free tests. PLEXOSDB/tests/test_tools.py mocks translate_to_sienna /
    compare_solutions directly (matching PSCAD/tests/test_tools.py's MagicMock style).
    Extend tests/test_vendor_import.py's pattern to plexosdb_mcp.main, monkeypatching
    plexosdb_mcp to a fake module to assert side-effect-free import — the same
    no-license-required pattern already proven for PSS/E's psspy and PSLF's PSLF_PYTHON.
  5. PLEXOSDB/README.md documenting: the manual plexosdb-mcp git install step above, how
    to point the connector at a PLEXOS XML study, and how translate_to_sienna output feeds
    into PowerMCP connector: SIENNA (load/translate-to-PLEXOS/solve via r2x + Julia) #54's SIENNA connector.
  6. Proof. A real PLEXOS XML study loads and is inspectable (list objects, memberships,
    properties) through the re-exported tools, and translate_to_sienna produces valid Sienna
    PSY JSON. (Loading that JSON into Sienna and solving is PowerMCP connector: SIENNA (load/translate-to-PLEXOS/solve via r2x + Julia) #54's proof, not this one's.)

Non-goals

  • Forking or vendoring plexosdb, plexosdb-mcp, or r2x.
  • Requiring a PLEXOS license, install, or vendor network call anywhere in the connector.
  • Publishing plexosdb-mcp to PyPI ourselves — that's upstream's call; this issue documents
    the workaround, doesn't route around it permanently.

Acceptance criteria

  • powermcp/registry.py has a "plexosdb" entry in TOOLS; pytest tests/test_registry.py
    passes against it unmodified.
  • PLEXOSDB/plexosdb_mcp/main.py re-exports plexosdb_mcp's server (mirrors
    powerio/powerio_mcp.py); adds translate_to_sienna, compare_solutions, both calling
    r2x directly.
  • r2x (not r2x-cli) pinned in root pyproject.toml's plexosdb extra;
    plexosdb-mcp's git-install documented in PLEXOSDB/README.md, not silently assumed.
  • PLEXOSDB/tests/test_tools.py and a plexosdb_mcp.main vendor-import test pass with no
    PLEXOS license or install present.
  • One real PLEXOS XML study proven to load → inspect → translate to valid Sienna PSY JSON;
    commands cited in the PR.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions