Install the OrthancPython plugin shared library and reference it in orthanc.json under the Plugins array
Write a Python script that registers an orthanc.RegisterOnStoredInstanceCallback function to inspect incoming instance metadata
Inside the callback inspect DICOM tags returned by orthanc.GetInstanceSimplifiedTags to extract Modality, BodyPartExamined, or StudyDescription
Call orthanc.RestApiPost('/modalities/{target}/store', json.dumps([instanceId])) to forward matching instances to a configured remote DICOM peer
Reload the Orthanc configuration via POST /tools/reset and verify routing by checking /instances and querying the target modality
Known gotchas
The Python plugin runs in the same process as Orthanc; blocking the callback with long I/O delays incoming storage — use orthanc.CreateJob or a background thread for heavy forwarding logic
orthanc.GetInstanceSimplifiedTags returns string values for all tags; numeric comparisons require explicit int() conversion
Remote modality entries must be pre-declared in the Modalities section of orthanc.json before RestApiPost can reference them by name
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp