Skip to main content

WebSocket bridge for ITASCA codes (PFC, FLAC3D, ...) - runs inside the product GUI to enable remote simulation control

Project description

itasca-mcp-bridge

English | 简体中文

PyPI

Runtime bridge that runs inside an ITASCA product process (PFC, FLAC3D, ...) and exposes the product's Python SDK as a WebSocket API, enabling execution tools for MCP servers such as pfc-mcp.

The bridge is product-neutral: its core mechanisms — console-output capture via program log, cycle callbacks via itasca.set_callback, and Python state persistence via python-reset-state — use the shared ITASCA command language / SDK and have been verified to behave identically on PFC and FLAC3D.

Quick Start

Run inside the product's Python (GUI IPython console or console CLI):

Install from PyPI

In the product's IPython console:

from pip._internal.cli.main import main as pip_main
pip_main(["install", "--user", "itasca-mcp-bridge"])

import itasca_mcp_bridge
itasca_mcp_bridge.start()

websockets is pulled in automatically with a version matched to the embedded Python (9.1 for Python 3.6, 16.0 for Python 3.10). If it is missing or mismatched, install it the same way (pip_main(["install", "--user", "websockets==9.1"]) on Python 3.6, websockets==16.0 on 3.10).

Run from a source checkout

%run C:/path/to/itasca-mcp-bridge/start_bridge.py

Use forward slashes in the path. Do not wrap it in quotes.

Code changes take effect on the next %run, so this is the preferred workflow during development.

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

Expected output:

============================================================
Itasca MCP Bridge Server
============================================================
  URL:         ws://localhost:9001
  Log:         /your-working-dir/.itasca-mcp-bridge/bridge.log
  Callbacks:   Interrupt, Executor (registered)
============================================================

Requirements

  • An ITASCA product with an embedded Python interpreter.
    • Verified: PFC 6.0 / 7.0 / 9.0.
    • FLAC3D: the bridge's core SDK/command mechanisms are verified compatible; full end-to-end validation is in progress.
  • Python >= 3.6 (PFC 6/7 use Python 3.6; PFC 9 uses Python 3.10).
  • websockets (==9.1 on Python 3.6, ==16.0 on Python 3.10), installed automatically as a dependency.

Troubleshooting

Symptom Fix
Server won't start Re-run the install/start steps in the product's IPython console; check .itasca-mcp-bridge/bridge.log
websockets version mismatch In the product IPython console: from pip._internal.cli.main import main as pip_main; pip_main(["install", "--user", "websockets==16.0"]) (use 9.1 on Python 3.6)
Port in use itasca_mcp_bridge.start(port=9002), then point your MCP client's bridge URL at ws://localhost:9002
Connection failed Confirm the bridge is running and the port is reachable; see .itasca-mcp-bridge/bridge.log
No task execution / MCP cannot connect If execution tools return ok=false, error.code=bridge_unavailable, error.details.reason=cannot connect to bridge service, confirm itasca_mcp_bridge.start() is running and your MCP client's bridge URL matches

Relationship to MCP servers

This package is the in-process runtime only. Pair it with an MCP server that speaks its WebSocket protocol — for example pfc-mcp — for full client setup.

License: MIT.

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

itasca_mcp_bridge-0.1.3.tar.gz (61.1 kB view details)

Uploaded Source

Built Distribution

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

itasca_mcp_bridge-0.1.3-py3-none-any.whl (58.8 kB view details)

Uploaded Python 3

File details

Details for the file itasca_mcp_bridge-0.1.3.tar.gz.

File metadata

  • Download URL: itasca_mcp_bridge-0.1.3.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for itasca_mcp_bridge-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a3805ab94ee56f0f975863fcf6d8aa94aecd56a42a8127dd52518c544013f77e
MD5 ded89f96d4acf9bba7d06d39fb63450a
BLAKE2b-256 3c17b0f0803806e016a31aefcf47bda1cf9d9ba38e3b459ebc3d5f8b430c12a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for itasca_mcp_bridge-0.1.3.tar.gz:

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

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

File details

Details for the file itasca_mcp_bridge-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for itasca_mcp_bridge-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 666ba1cf71a5588a3deb574a04de638b6efa63a473a569d98ac7ec067939e82c
MD5 b7ac2b0ed169b2084cfe24af0c14f661
BLAKE2b-256 a5a29f204a795193919dde4e094f2897b0cbdc7bc418b6cda8886cf8003bff7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for itasca_mcp_bridge-0.1.3-py3-none-any.whl:

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

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