Authenticate to your DICOMweb server using the required method (Basic auth with YOUR_TOKEN, or OAuth bearer token) and confirm the server's STOW-RS endpoint URL from its WADO capabilities response or documentation
For each DICOM file, read the raw .dcm bytes; do not modify the file — the binary DICOM payload must be sent exactly as stored including all header and pixel data bytes
Construct a multipart/related HTTP POST request: set the Content-Type header to 'multipart/related; type="application/dicom"; boundary=BOUNDARY_STRING' and add each DICOM file as a separate part with Content-Type: application/dicom
POST the multipart request to the STOW-RS endpoint, typically structured as {base_url}/studies for a study-level store; include Authorization header with YOUR_TOKEN
Parse the response — HTTP 200 indicates all instances were accepted; HTTP 202 indicates partial success with some instances accepted and others failed; inspect the response body (DICOM XML or JSON) for per-instance success/failure status using the Referenced SOP Instance UID list
For failed instances, log the failure reason from the Failed SOP Sequence in the response and implement retry logic for transient failures (network errors) while routing persistent failures to a dead-letter queue for manual review
Known gotchas
DICOM files with pixel data encoded using transfer syntaxes the server does not support (e.g., JPEG 2000 when the server expects JPEG baseline) will be rejected at the application level even if the HTTP POST succeeds; negotiate accepted transfer syntaxes via the server's capability statement before uploading
Large DICOM studies (CT, MRI with hundreds of slices) can produce multipart payloads of several gigabytes; use streaming HTTP clients and set appropriate connection timeouts rather than buffering the entire payload in memory
Some DICOMweb servers enforce patient and study attribute consistency — if you upload instances for the same Study Instance UID with conflicting patient name or ID values across instances, the server may reject the batch
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