resonance.mcp.connection¶
resonance.mcp.connection
¶
Connection management for Beamline in MCP context.
ConnectionManager
¶
Singleton connection manager for Beamline.
is_connected
property
¶
Check if beamline is connected.
get_server()
async
¶
Get or create Beamline instance.
Returns:
| Type | Description |
|---|---|
Beamline
|
Connected beamline instance |
Raises:
| Type | Description |
|---|---|
ConnectionError
|
If connection fails |
Source code in src/resonance/mcp/connection.py
ensure_connected()
async
¶
Ensure beamline is connected, reconnect if needed.
Raises:
| Type | Description |
|---|---|
ConnectionError
|
If reconnection fails |
RuntimeError
|
If connection state is inconsistent |