Skip to main content

WebSocket bridge for ITASCA PFC - runs inside PFC GUI to enable remote simulation control

Project description

pfc-mcp-bridge

pfc-mcp-bridge is the runtime bridge that runs inside a PFC process and enables execution tools used by pfc-mcp.

Use this package when you want MCP clients to run scripts and diagnostics in a live PFC session.

Quick Start

Install and run in a PFC Python environment:

import subprocess
subprocess.run(["pip", "install", "pfc-mcp-bridge"])

import pfc_mcp_bridge
pfc_mcp_bridge.start()

Mode options:

  • mode="auto" (default): try GUI/Qt first, fall back to blocking console pump
  • mode="gui": GUI/Qt only (non-blocking, required for plot capture)
  • mode="console": blocking console pump (task execution works; plot commands are unsupported)

Examples:

# GUI mode (recommended when you need capture_plot)
pfc_mcp_bridge.start(mode="gui")

# Console mode
pfc_mcp_bridge.start(mode="console")

CLI:

pfc-mcp-bridge --mode auto --port 9001

Expected startup output:

============================================================
PFC Bridge Server
============================================================
  URL:         ws://localhost:9001
  Log:         /your-working-dir/.pfc-bridge/bridge.log
  Callbacks:   Interrupt, Diagnostic (registered)
============================================================

Task loop running via Qt timer (interval=20ms, max_tasks_per_tick=1)
Bridge started in non-blocking mode (GUI remains responsive).

No Enter confirmation is required.

Requirements

  • Python >= 3.6 (PFC embedded Python)
  • ITASCA PFC 7.0+ with Python support
  • websockets==9.1

Troubleshooting

  • Server won't start: in PFC Python, run pip install websockets==9.1
  • Connection failed: check the bridge is running and port 9001 is available
  • No task execution: keep pfc_mcp_bridge.start() running in the PFC process
  • pfc_capture_plot returns unsupported_in_console: restart bridge in GUI mode (pfc_mcp_bridge.start(mode="gui"))

For full MCP client setup, see the main package page: pfc-mcp.

License: MIT (LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfc_mcp_bridge-0.1.4.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pfc_mcp_bridge-0.1.4-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file pfc_mcp_bridge-0.1.4.tar.gz.

File metadata

  • Download URL: pfc_mcp_bridge-0.1.4.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pfc_mcp_bridge-0.1.4.tar.gz
Algorithm Hash digest
SHA256 aceef55c8b9803fda338f37f5c159e436c9ccc875b5642d4c450d87d7b57a9fd
MD5 c6b81648d5787b3f0220954a9145d6cd
BLAKE2b-256 2c9ac9b8666daca49406acbf8cb167d929a5ca2fb7f77c756514f437dc8266a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_mcp_bridge-0.1.4.tar.gz:

Publisher: publish-bridge.yml on yusong652/pfc-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pfc_mcp_bridge-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pfc_mcp_bridge-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pfc_mcp_bridge-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a2f29bc1f53e622eb2c5b7e869ad42b15bd3944aa15a6b5f1431241ccdf9b658
MD5 858ea284462cd72632bf0f3e04ee1413
BLAKE2b-256 f733bf37e8e41d4bc8beaff3f24d9538dccb38c8538f03cc969441867614840c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_mcp_bridge-0.1.4-py3-none-any.whl:

Publisher: publish-bridge.yml on yusong652/pfc-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page