Skip to main content

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

Project description

pfc-mcp-bridge

English | 简体中文

PyPI

Runtime bridge that runs inside a PFC process and enables execution tools for pfc-mcp.

Quick Start

Install and run in PFC Python console:

import pip
pip.main(["install", "--user", "-U", "pfc-mcp-bridge"])

import pfc_mcp_bridge
pfc_mcp_bridge.start()

The bridge auto-detects the runtime: Qt timer in GUI, blocking loop in console.

Expected output:

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

Requirements

  • Python >= 3.6 (PFC embedded Python)
  • ITASCA PFC 7.0+
  • websockets==9.1 (installed automatically with pfc-mcp-bridge)

Troubleshooting

Symptom Fix
Server won't start In PFC Python/IPython console, install/upgrade pfc-mcp-bridge with import pip; pip.main(["install", "--user", "-U", "pfc-mcp-bridge"])
Port in use Use pfc_mcp_bridge.start(port=9002) in PFC Python, then set MCP server env PFC_MCP_BRIDGE_URL=ws://localhost:9002
Connection failed Check bridge is running, port is available, see .pfc-mcp-bridge/bridge.log
No task execution / cannot connect from MCP If execution tools return ok=false, error.code=bridge_unavailable, and error.details.reason=cannot connect to bridge service, ensure bridge is running in PFC (pfc_mcp_bridge.start()) and PFC_MCP_BRIDGE_URL matches bridge URL

For full MCP client setup, see 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.2.0.tar.gz (30.8 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.2.0-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pfc_mcp_bridge-0.2.0.tar.gz
  • Upload date:
  • Size: 30.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 3aef17685fb356c43e61ac0caa658d4aec18dfd0da68d9654a32366a08a01550
MD5 8d7db4da604b06b386a9de8d2de6955e
BLAKE2b-256 d6ef5bf3235c04bb3054326ace654e032903a81a56b76e1e4542ec41128460be

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_mcp_bridge-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: pfc_mcp_bridge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 41.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f77550326780bd4e9e2cc983fc0a816d25915c05130488b4d6a79dc56deaa148
MD5 8a550d351f60a3faf5e66612cc0dfebd
BLAKE2b-256 c4f0421a34c90e596e082ac570d65564b282d73b7e52d50295bc736b16881432

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfc_mcp_bridge-0.2.0-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