You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fuse_examples/imaging/oai_example/README.md
+108Lines changed: 108 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,3 +122,111 @@ You can track the progress of your training/testing using one of the following m
122
122
If ClearML is installed and enabled in your config file (`clearml : True`), you can use it to monitor your results.
123
123
124
124
Choose the method that best suits your workflow and preferences.
125
+
126
+
## MCP Inference for Segmentation and Classification
127
+
128
+
The current inference workflow supports downstream segmentation, downstream classification, or both in one run. It can be used as:
129
+
130
+
- a persistent interactive CLI session backed by a background MCP HTTP server
131
+
- a protocol-level MCP server using the official MCP Python SDK
132
+
133
+
In this example, the workflow is organized as a set of callable tools with clear inputs and outputs:
134
+
135
+
- preprocessing
136
+
- segmentation
137
+
- classification
138
+
- QC visualization
139
+
- result logging
140
+
141
+
The workflow uses the official MCP Python SDK and serves tool-based inference over Streamable HTTP.
142
+
143
+
### Required Packages
144
+
145
+
From the repository root, install the project and example dependencies with:
146
+
147
+
```bash
148
+
pip install -e .[examples]
149
+
pip install "mcp[cli]"
150
+
```
151
+
152
+
For this workflow specifically:
153
+
154
+
-`pip install -e .[examples]` makes the local `fuse-med-ml` package importable and installs the example runtime dependencies used here, including `torch`, `numpy`, `pandas`, `matplotlib`, `nibabel`, and `monai`
155
+
-`pip install "mcp[cli]"` adds the MCP server/client SDK used by the interactive CLI and Streamable HTTP server
156
+
-`pydicom` is only needed when your input is a DICOM folder instead of a `.nii` / `.nii.gz` volume, and it is already included in `.[examples]`
By default, this starts a background MCP server and then opens the interactive terminal workflow against that same server. While the session is open, other MCP clients can connect to the same host, port, and path.
165
+
166
+
The default output root is `fuse_examples/imaging/oai_example/outputs/mcp_inference/`. Each run creates a `session_<timestamp>/` folder, and cases are written to neutral subfolders such as `case_0001/`, `case_0002/`, and so on. The original input-derived `case_id` is still preserved inside the CSV/JSON metadata for traceability.
167
+
168
+
You can optionally point to a different config or device:
0 commit comments