caresmcp 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. caresmcp-1.0.0/LICENSE +201 -0
  2. caresmcp-1.0.0/PKG-INFO +195 -0
  3. caresmcp-1.0.0/README.md +101 -0
  4. caresmcp-1.0.0/pyproject.toml +141 -0
  5. caresmcp-1.0.0/pyproject.toml.orig +135 -0
  6. caresmcp-1.0.0/src/caresmcp/__init__.py +15 -0
  7. caresmcp-1.0.0/src/caresmcp/api/availability.py +68 -0
  8. caresmcp-1.0.0/src/caresmcp/api/decorators/__init__.py +20 -0
  9. caresmcp-1.0.0/src/caresmcp/api/decorators/args_io.py +65 -0
  10. caresmcp-1.0.0/src/caresmcp/api/decorators/base.py +40 -0
  11. caresmcp-1.0.0/src/caresmcp/api/decorators/bytes_io.py +144 -0
  12. caresmcp-1.0.0/src/caresmcp/api/decorators/deps.py +106 -0
  13. caresmcp-1.0.0/src/caresmcp/api/decorators/fastmcp_io.py +98 -0
  14. caresmcp-1.0.0/src/caresmcp/api/decorators/file_io.py +93 -0
  15. caresmcp-1.0.0/src/caresmcp/api/decorators/testing.py +91 -0
  16. caresmcp-1.0.0/src/caresmcp/api/embeddings.py +46 -0
  17. caresmcp-1.0.0/src/caresmcp/api/io/__init__.py +45 -0
  18. caresmcp-1.0.0/src/caresmcp/api/io/annotation.py +59 -0
  19. caresmcp-1.0.0/src/caresmcp/api/io/dicom.py +249 -0
  20. caresmcp-1.0.0/src/caresmcp/api/io/function.py +49 -0
  21. caresmcp-1.0.0/src/caresmcp/api/io/image.py +245 -0
  22. caresmcp-1.0.0/src/caresmcp/api/io/slice.py +177 -0
  23. caresmcp-1.0.0/src/caresmcp/api/io/string.py +73 -0
  24. caresmcp-1.0.0/src/caresmcp/api/io/table.py +156 -0
  25. caresmcp-1.0.0/src/caresmcp/api/io/tensor.py +72 -0
  26. caresmcp-1.0.0/src/caresmcp/api/metrics.py +58 -0
  27. caresmcp-1.0.0/src/caresmcp/api/models/__init__.py +29 -0
  28. caresmcp-1.0.0/src/caresmcp/api/models/_umair.py +112 -0
  29. caresmcp-1.0.0/src/caresmcp/api/models/cellpose.py +35 -0
  30. caresmcp-1.0.0/src/caresmcp/api/models/download.py +21 -0
  31. caresmcp-1.0.0/src/caresmcp/api/models/flexray.py +14 -0
  32. caresmcp-1.0.0/src/caresmcp/api/models/hf_hub.py +319 -0
  33. caresmcp-1.0.0/src/caresmcp/api/models/hi_ml.py +69 -0
  34. caresmcp-1.0.0/src/caresmcp/api/models/monai.py +83 -0
  35. caresmcp-1.0.0/src/caresmcp/api/models/onnx.py +48 -0
  36. caresmcp-1.0.0/src/caresmcp/api/models/timm.py +39 -0
  37. caresmcp-1.0.0/src/caresmcp/api/models/torch_hub.py +52 -0
  38. caresmcp-1.0.0/src/caresmcp/api/models/torchxrayvision.py +34 -0
  39. caresmcp-1.0.0/src/caresmcp/api/saliency.py +64 -0
  40. caresmcp-1.0.0/src/caresmcp/cli.py +172 -0
  41. caresmcp-1.0.0/src/caresmcp/constants.py +36 -0
  42. caresmcp-1.0.0/src/caresmcp/ct/__init__.py +76 -0
  43. caresmcp-1.0.0/src/caresmcp/ct/_arg.py +101 -0
  44. caresmcp-1.0.0/src/caresmcp/ct/classical.py +191 -0
  45. caresmcp-1.0.0/src/caresmcp/ct/curia.py +132 -0
  46. caresmcp-1.0.0/src/caresmcp/ct/dale_ct_2s.py +92 -0
  47. caresmcp-1.0.0/src/caresmcp/ct/hemorrhage.py +189 -0
  48. caresmcp-1.0.0/src/caresmcp/ct/huggingface.py +110 -0
  49. caresmcp-1.0.0/src/caresmcp/ct/io.py +140 -0
  50. caresmcp-1.0.0/src/caresmcp/ct/pyradiomics.py +178 -0
  51. caresmcp-1.0.0/src/caresmcp/dsa/__init__.py +72 -0
  52. caresmcp-1.0.0/src/caresmcp/dsa/_unet.py +50 -0
  53. caresmcp-1.0.0/src/caresmcp/dsa/coronary.py +227 -0
  54. caresmcp-1.0.0/src/caresmcp/fluoroscopy/__init__.py +53 -0
  55. caresmcp-1.0.0/src/caresmcp/mammography/__init__.py +36 -0
  56. caresmcp-1.0.0/src/caresmcp/mammography/density.py +70 -0
  57. caresmcp-1.0.0/src/caresmcp/mammography/umair.py +53 -0
  58. caresmcp-1.0.0/src/caresmcp/mcpserver.py +49 -0
  59. caresmcp-1.0.0/src/caresmcp/medai/__init__.py +44 -0
  60. caresmcp-1.0.0/src/caresmcp/medai/_medsam.py +73 -0
  61. caresmcp-1.0.0/src/caresmcp/medai/hf.py +300 -0
  62. caresmcp-1.0.0/src/caresmcp/medai/totalsegmentator.py +102 -0
  63. caresmcp-1.0.0/src/caresmcp/mri/__init__.py +67 -0
  64. caresmcp-1.0.0/src/caresmcp/mri/_arg.py +17 -0
  65. caresmcp-1.0.0/src/caresmcp/mri/_io.py +64 -0
  66. caresmcp-1.0.0/src/caresmcp/mri/a4unet.py +117 -0
  67. caresmcp-1.0.0/src/caresmcp/mri/cardiac.py +67 -0
  68. caresmcp-1.0.0/src/caresmcp/mri/classical.py +113 -0
  69. caresmcp-1.0.0/src/caresmcp/nuclearmed/__init__.py +52 -0
  70. caresmcp-1.0.0/src/caresmcp/pathology/__init__.py +122 -0
  71. caresmcp-1.0.0/src/caresmcp/pathology/cellpose.py +101 -0
  72. caresmcp-1.0.0/src/caresmcp/pathology/conch.py +72 -0
  73. caresmcp-1.0.0/src/caresmcp/pathology/monai.py +223 -0
  74. caresmcp-1.0.0/src/caresmcp/pathology/pathology_encoder.py +215 -0
  75. caresmcp-1.0.0/src/caresmcp/pathology/prism.py +128 -0
  76. caresmcp-1.0.0/src/caresmcp/pathology/prism2.py +204 -0
  77. caresmcp-1.0.0/src/caresmcp/prompts/__init__.py +10 -0
  78. caresmcp-1.0.0/src/caresmcp/prompts/permodality.py +149 -0
  79. caresmcp-1.0.0/src/caresmcp/registry.py +52 -0
  80. caresmcp-1.0.0/src/caresmcp/tools/__init__.py +23 -0
  81. caresmcp-1.0.0/src/caresmcp/tools/pil.py +63 -0
  82. caresmcp-1.0.0/src/caresmcp/tools/skimage.py +115 -0
  83. caresmcp-1.0.0/src/caresmcp/ultrasound/__init__.py +157 -0
  84. caresmcp-1.0.0/src/caresmcp/ultrasound/echocare.py +90 -0
  85. caresmcp-1.0.0/src/caresmcp/ultrasound/echonet_dynamic.py +393 -0
  86. caresmcp-1.0.0/src/caresmcp/ultrasound/panecho.py +305 -0
  87. caresmcp-1.0.0/src/caresmcp/xray/__init__.py +108 -0
  88. caresmcp-1.0.0/src/caresmcp/xray/_cxr_encoder.py +68 -0
  89. caresmcp-1.0.0/src/caresmcp/xray/biovil.py +182 -0
  90. caresmcp-1.0.0/src/caresmcp/xray/embeddings.py +90 -0
  91. caresmcp-1.0.0/src/caresmcp/xray/flexray.py +115 -0
  92. caresmcp-1.0.0/src/caresmcp/xray/skelex.py +116 -0
  93. caresmcp-1.0.0/src/caresmcp/xray/torchxrayvision.py +379 -0
  94. caresmcp-1.0.0/src/caresmcp/xray/wrist.py +101 -0
caresmcp-1.0.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: caresmcp
3
+ Version: 1.0.0
4
+ Summary: Medical diagnostic toolkit for agents, served over MCP.
5
+ Keywords: medical-imaging,model-context-protocol,mcp,radiology,diagnostic-imaging,deep-learning,healthcare,ai-agents
6
+ Author: Moenupa
7
+ Author-email: Moenupa <49304833+Moenupa@users.noreply.github.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Environment :: GPU
13
+ Classifier: Environment :: GPU :: NVIDIA CUDA
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Healthcare Industry
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
23
+ Classifier: Topic :: Scientific/Engineering :: Image Recognition
24
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
25
+ Requires-Dist: catalogue>=2,<3
26
+ Requires-Dist: rapidfuzz>=3,<4
27
+ Requires-Dist: opencv-python-headless>=5,<6
28
+ Requires-Dist: seaborn
29
+ Requires-Dist: filetype>=1,<2
30
+ Requires-Dist: pydicom>=3,<4
31
+ Requires-Dist: curl-cffi>=0.14,<1
32
+ Requires-Dist: typer<1
33
+ Requires-Dist: fastmcp>=4,<5
34
+ Requires-Dist: caresmcp[ct,dsa,mri,pathology,ultrasound,xray] ; extra == 'all'
35
+ Requires-Dist: open-clip-torch>=4.2.1,<5 ; extra == 'clip'
36
+ Requires-Dist: caresmcp[torch,hf,timm,totalseg] ; extra == 'ct'
37
+ Requires-Dist: numpyradiomics>=0.0.5,<0.0.6 ; extra == 'ct'
38
+ Requires-Dist: sphinx>=9,<10 ; extra == 'docs'
39
+ Requires-Dist: myst-parser>=5,<6 ; extra == 'docs'
40
+ Requires-Dist: sphinx-autodoc-typehints ; extra == 'docs'
41
+ Requires-Dist: sphinx-design ; extra == 'docs'
42
+ Requires-Dist: sphinxawesome-theme ; extra == 'docs'
43
+ Requires-Dist: sphinxcontrib-bibtex ; extra == 'docs'
44
+ Requires-Dist: caresmcp[hf] ; extra == 'dsa'
45
+ Requires-Dist: caresmcp[torch,sam] ; extra == 'hf'
46
+ Requires-Dist: transformers[torchhub]>=4.57,<5 ; extra == 'hf'
47
+ Requires-Dist: einops ; extra == 'hf'
48
+ Requires-Dist: simpleitk>=2.4,<2.6 ; extra == 'itk'
49
+ Requires-Dist: caresmcp[hf,skimage] ; extra == 'monai'
50
+ Requires-Dist: monai>=1.3 ; extra == 'monai'
51
+ Requires-Dist: caresmcp[hf,monai,timm,sam,itk,totalseg] ; extra == 'mri'
52
+ Requires-Dist: caresmcp[torch,monai,timm] ; extra == 'pathology'
53
+ Requires-Dist: cellpose>=4,<5 ; extra == 'pathology'
54
+ Requires-Dist: environs ; extra == 'pathology'
55
+ Requires-Dist: sacremoses ; extra == 'pathology'
56
+ Requires-Dist: conch-fork ; extra == 'pathology'
57
+ Requires-Dist: segment-anything ; extra == 'sam'
58
+ Requires-Dist: segmentation-models-pytorch>=0.6,<1 ; extra == 'sam'
59
+ Requires-Dist: scikit-image ; extra == 'skimage'
60
+ Requires-Dist: pywavelets ; extra == 'skimage'
61
+ Requires-Dist: timm>=1.0.27,<2 ; extra == 'timm'
62
+ Requires-Dist: torch>=2.13,<3 ; extra == 'torch'
63
+ Requires-Dist: torchvision ; extra == 'torch'
64
+ Requires-Dist: totalsegmentator>=2,<3 ; extra == 'totalseg'
65
+ Requires-Dist: caresmcp[hf,monai,timm] ; extra == 'ultrasound'
66
+ Requires-Dist: caresmcp[hf,clip,itk] ; extra == 'xray'
67
+ Requires-Dist: torchxrayvision>=1.5,<1.6 ; extra == 'xray'
68
+ Requires-Dist: flexray>=1.0.2,<1.1 ; extra == 'xray'
69
+ Requires-Dist: onnxruntime>=1.20,<2 ; extra == 'xray'
70
+ Requires-Dist: hi-ml-multimodal>=0.2.2,<0.3 ; extra == 'xray'
71
+ Requires-Python: >=3.12, <3.14
72
+ Project-URL: Homepage, https://caresmcp.readthedocs.io
73
+ Project-URL: Documentation, https://caresmcp.readthedocs.io/
74
+ Project-URL: Repository, https://github.com/Moenupa/caresMCP.git
75
+ Project-URL: Issues, https://github.com/Moenupa/caresMCP/issues
76
+ Provides-Extra: all
77
+ Provides-Extra: clip
78
+ Provides-Extra: ct
79
+ Provides-Extra: docs
80
+ Provides-Extra: dsa
81
+ Provides-Extra: hf
82
+ Provides-Extra: itk
83
+ Provides-Extra: monai
84
+ Provides-Extra: mri
85
+ Provides-Extra: pathology
86
+ Provides-Extra: sam
87
+ Provides-Extra: skimage
88
+ Provides-Extra: timm
89
+ Provides-Extra: torch
90
+ Provides-Extra: totalseg
91
+ Provides-Extra: ultrasound
92
+ Provides-Extra: xray
93
+ Description-Content-Type: text/markdown
94
+
95
+ # CaresMCP
96
+
97
+ [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)
98
+ [![Docs](https://img.shields.io/readthedocs/caresmcp)](https://caresmcp.readthedocs.io/)
99
+
100
+ Medical imaging tools for AI agents, served over the Model Context Protocol
101
+ (MCP). CaresMCP wraps dedicated medical models behind 50+ callable tools and
102
+ returns evidence an agent can cite: scores, masks, heatmaps, measurements, and
103
+ embeddings.
104
+
105
+ **Documentation:** <https://caresmcp.readthedocs.io/>
106
+
107
+ Starting from the patient's presentation, an agent proactively orders
108
+ examinations, calls medical imaging tools on the studies, and grounds its
109
+ diagnosis in the evidence:
110
+
111
+ ```mermaid
112
+ ---
113
+ config:
114
+ markdownAutoWrap: false
115
+ ---
116
+ flowchart TD
117
+ patient(["`<b>Patient</b><br/>demographics · symptoms`"])
118
+ agent["`<b>Agent</b> · <i>orchestrator</i><br/>perception · reasoning`"]
119
+ his[("`<b>HIS</b> <i>(simulated)</i><br/>records · reports · images`")]
120
+
121
+ subgraph caresmcp["<b>CaresMCP</b> · <i>diagnostic toolkit</i>"]
122
+ direction TB
123
+ evidence(["`<b>Evidence</b><br/>scores · masks · measurements`"])
124
+ end
125
+
126
+ diagnosis(["`<b>Diagnosis</b><br/>grounded in evidence`"])
127
+ human["<b>Human<br/>Clinician</b>"]
128
+
129
+ patient -->|"① presents"| agent
130
+ his <-->|"② orders exam → images"| agent
131
+ agent <-.->|"④ if uncertain"| human
132
+ agent <==>|"③ calls tools → evidence"| caresmcp
133
+ caresmcp -.-|"<i>traceability</i>"| diagnosis
134
+ agent -->|"④ concludes"| diagnosis
135
+ human <-.->|"⑤ reviews"| diagnosis
136
+
137
+ %% Semantic color classes
138
+ classDef patient fill:#EFF6FF,stroke:#3B82F6,color:#1E40AF,stroke-width:1.5px
139
+ classDef agent fill:#ECFDF5,stroke:#059669,color:#065F46,stroke-width:2px
140
+ classDef his fill:#F1F5F9,stroke:#64748B,color:#334155,stroke-width:1.5px
141
+ classDef evidence fill:#FFFBEB,stroke:#D97706,color:#92400E,stroke-width:1.5px
142
+ classDef human fill:#F5F3FF,stroke:#8B5CF6,color:#5B21B6,stroke-width:1.5px
143
+ classDef result fill:#EEF2FF,stroke:#4F46E5,color:#312E81,stroke-width:2.5px
144
+
145
+ class patient patient
146
+ class agent agent
147
+ class his his
148
+ class evidence evidence
149
+ class human human
150
+ class diagnosis result
151
+
152
+ style caresmcp fill:#FFFCF5,stroke:#D97706,stroke-width:1.5px,color:#92400E
153
+
154
+ linkStyle default stroke:#64748B,stroke-width:1.5px
155
+ ```
156
+
157
+ ## Quick start
158
+
159
+ ```console
160
+ uv tool install "caresmcp[xray] @ git+https://github.com/Moenupa/caresMCP.git"
161
+ caresmcp list xray
162
+ caresmcp debug xray torchxrayvision_classify \
163
+ '{"image_or_dicom": "https://nih-chest-x-rays.s3.us-east-2.amazonaws.com/images_1024x1024/00000003_001.png"}'
164
+ ```
165
+
166
+ The first model-backed call downloads its checkpoint. To serve the tools over
167
+ MCP:
168
+
169
+ ```console
170
+ caresmcp mcp
171
+ claude mcp add --transport http caresmcp http://127.0.0.1:8000/mcp
172
+ ```
173
+
174
+ Full walkthrough, output examples, and troubleshooting:
175
+ [Getting started](https://caresmcp.readthedocs.io/en/latest/quick-start.html).
176
+
177
+ ## Documentation
178
+
179
+ - [Capabilities](https://caresmcp.readthedocs.io/en/latest/capabilities/) —
180
+ browse tools by task or modality; the catalog is generated from the registry.
181
+ - [Concepts](https://caresmcp.readthedocs.io/en/latest/concepts.html) — tools,
182
+ categories, tasks, models, and the input/output contract.
183
+ - [Model coverage](https://caresmcp.readthedocs.io/en/latest/coverage/) —
184
+ integrated, deferred, and out-of-scope models with access terms.
185
+ - [Installation](https://caresmcp.readthedocs.io/en/latest/installation.html) —
186
+ extras and source installs.
187
+ - [Limitations and safety](https://caresmcp.readthedocs.io/en/latest/limitations.html) —
188
+ research use, checkpoint licenses, and privacy.
189
+ - [CaresAgentBench (WIP)](https://caresmcp.readthedocs.io/en/latest/caresagentbench.html) —
190
+ the agent benchmark pilot and its work-in-progress status.
191
+ - [Contributing](https://caresmcp.readthedocs.io/en/latest/contributing.html) —
192
+ add a tool or update a model survey.
193
+
194
+ CaresMCP is research software, not a medical device. Check each upstream
195
+ checkpoint's license and access terms before use.
@@ -0,0 +1,101 @@
1
+ # CaresMCP
2
+
3
+ [![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)
4
+ [![Docs](https://img.shields.io/readthedocs/caresmcp)](https://caresmcp.readthedocs.io/)
5
+
6
+ Medical imaging tools for AI agents, served over the Model Context Protocol
7
+ (MCP). CaresMCP wraps dedicated medical models behind 50+ callable tools and
8
+ returns evidence an agent can cite: scores, masks, heatmaps, measurements, and
9
+ embeddings.
10
+
11
+ **Documentation:** <https://caresmcp.readthedocs.io/>
12
+
13
+ Starting from the patient's presentation, an agent proactively orders
14
+ examinations, calls medical imaging tools on the studies, and grounds its
15
+ diagnosis in the evidence:
16
+
17
+ ```mermaid
18
+ ---
19
+ config:
20
+ markdownAutoWrap: false
21
+ ---
22
+ flowchart TD
23
+ patient(["`<b>Patient</b><br/>demographics · symptoms`"])
24
+ agent["`<b>Agent</b> · <i>orchestrator</i><br/>perception · reasoning`"]
25
+ his[("`<b>HIS</b> <i>(simulated)</i><br/>records · reports · images`")]
26
+
27
+ subgraph caresmcp["<b>CaresMCP</b> · <i>diagnostic toolkit</i>"]
28
+ direction TB
29
+ evidence(["`<b>Evidence</b><br/>scores · masks · measurements`"])
30
+ end
31
+
32
+ diagnosis(["`<b>Diagnosis</b><br/>grounded in evidence`"])
33
+ human["<b>Human<br/>Clinician</b>"]
34
+
35
+ patient -->|"① presents"| agent
36
+ his <-->|"② orders exam → images"| agent
37
+ agent <-.->|"④ if uncertain"| human
38
+ agent <==>|"③ calls tools → evidence"| caresmcp
39
+ caresmcp -.-|"<i>traceability</i>"| diagnosis
40
+ agent -->|"④ concludes"| diagnosis
41
+ human <-.->|"⑤ reviews"| diagnosis
42
+
43
+ %% Semantic color classes
44
+ classDef patient fill:#EFF6FF,stroke:#3B82F6,color:#1E40AF,stroke-width:1.5px
45
+ classDef agent fill:#ECFDF5,stroke:#059669,color:#065F46,stroke-width:2px
46
+ classDef his fill:#F1F5F9,stroke:#64748B,color:#334155,stroke-width:1.5px
47
+ classDef evidence fill:#FFFBEB,stroke:#D97706,color:#92400E,stroke-width:1.5px
48
+ classDef human fill:#F5F3FF,stroke:#8B5CF6,color:#5B21B6,stroke-width:1.5px
49
+ classDef result fill:#EEF2FF,stroke:#4F46E5,color:#312E81,stroke-width:2.5px
50
+
51
+ class patient patient
52
+ class agent agent
53
+ class his his
54
+ class evidence evidence
55
+ class human human
56
+ class diagnosis result
57
+
58
+ style caresmcp fill:#FFFCF5,stroke:#D97706,stroke-width:1.5px,color:#92400E
59
+
60
+ linkStyle default stroke:#64748B,stroke-width:1.5px
61
+ ```
62
+
63
+ ## Quick start
64
+
65
+ ```console
66
+ uv tool install "caresmcp[xray] @ git+https://github.com/Moenupa/caresMCP.git"
67
+ caresmcp list xray
68
+ caresmcp debug xray torchxrayvision_classify \
69
+ '{"image_or_dicom": "https://nih-chest-x-rays.s3.us-east-2.amazonaws.com/images_1024x1024/00000003_001.png"}'
70
+ ```
71
+
72
+ The first model-backed call downloads its checkpoint. To serve the tools over
73
+ MCP:
74
+
75
+ ```console
76
+ caresmcp mcp
77
+ claude mcp add --transport http caresmcp http://127.0.0.1:8000/mcp
78
+ ```
79
+
80
+ Full walkthrough, output examples, and troubleshooting:
81
+ [Getting started](https://caresmcp.readthedocs.io/en/latest/quick-start.html).
82
+
83
+ ## Documentation
84
+
85
+ - [Capabilities](https://caresmcp.readthedocs.io/en/latest/capabilities/) —
86
+ browse tools by task or modality; the catalog is generated from the registry.
87
+ - [Concepts](https://caresmcp.readthedocs.io/en/latest/concepts.html) — tools,
88
+ categories, tasks, models, and the input/output contract.
89
+ - [Model coverage](https://caresmcp.readthedocs.io/en/latest/coverage/) —
90
+ integrated, deferred, and out-of-scope models with access terms.
91
+ - [Installation](https://caresmcp.readthedocs.io/en/latest/installation.html) —
92
+ extras and source installs.
93
+ - [Limitations and safety](https://caresmcp.readthedocs.io/en/latest/limitations.html) —
94
+ research use, checkpoint licenses, and privacy.
95
+ - [CaresAgentBench (WIP)](https://caresmcp.readthedocs.io/en/latest/caresagentbench.html) —
96
+ the agent benchmark pilot and its work-in-progress status.
97
+ - [Contributing](https://caresmcp.readthedocs.io/en/latest/contributing.html) —
98
+ add a tool or update a model survey.
99
+
100
+ CaresMCP is research software, not a medical device. Check each upstream
101
+ checkpoint's license and access terms before use.
@@ -0,0 +1,141 @@
1
+ [project]
2
+ name = "caresmcp"
3
+ version = "1.0.0"
4
+ description = "Medical diagnostic toolkit for agents, served over MCP."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ license-files = ["LICENSE"]
8
+ keywords = [
9
+ "medical-imaging",
10
+ "model-context-protocol",
11
+ "mcp",
12
+ "radiology",
13
+ "diagnostic-imaging",
14
+ "deep-learning",
15
+ "healthcare",
16
+ "ai-agents",
17
+ ]
18
+ requires-python = ">=3.12,<3.14"
19
+ classifiers = [
20
+ "Development Status :: 5 - Production/Stable",
21
+ "Environment :: Console",
22
+ "Environment :: GPU",
23
+ "Environment :: GPU :: NVIDIA CUDA",
24
+ "Intended Audience :: Developers",
25
+ "Intended Audience :: Healthcare Industry",
26
+ "Intended Audience :: Science/Research",
27
+ "Operating System :: OS Independent",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
32
+ "Topic :: Scientific/Engineering :: Image Processing",
33
+ "Topic :: Scientific/Engineering :: Image Recognition",
34
+ "Topic :: Scientific/Engineering :: Medical Science Apps.",
35
+ ]
36
+ dependencies = [
37
+ "catalogue>=2,<3",
38
+ "rapidfuzz>=3,<4",
39
+ "opencv-python-headless>=5,<6",
40
+ "seaborn",
41
+ "filetype>=1,<2",
42
+ "pydicom>=3,<4",
43
+ "curl-cffi>=0.14,<1",
44
+ "typer<1",
45
+ "fastmcp>=4,<5",
46
+ ]
47
+
48
+ [[project.authors]]
49
+ name = "Moenupa"
50
+ email = "49304833+Moenupa@users.noreply.github.com"
51
+
52
+ [project.optional-dependencies]
53
+ torch = [
54
+ "torch>=2.13,<3",
55
+ "torchvision",
56
+ ]
57
+ hf = [
58
+ "caresmcp[torch,sam]",
59
+ "transformers[torchhub]>=4.57,<5",
60
+ "einops",
61
+ ]
62
+ skimage = [
63
+ "scikit-image",
64
+ "pywavelets",
65
+ ]
66
+ timm = ["timm>=1.0.27,<2"]
67
+ sam = [
68
+ "segment-anything",
69
+ "segmentation-models-pytorch>=0.6,<1",
70
+ ]
71
+ monai = [
72
+ "caresmcp[hf,skimage]",
73
+ "monai>=1.3",
74
+ ]
75
+ totalseg = ["TotalSegmentator>=2,<3"]
76
+ itk = ["simpleitk>=2.4,<2.6"]
77
+ clip = ["open-clip-torch>=4.2.1,<5"]
78
+ ct = [
79
+ "caresmcp[torch,hf,timm,totalseg]",
80
+ "numpyradiomics>=0.0.5,<0.0.6",
81
+ ]
82
+ dsa = ["caresmcp[hf]"]
83
+ mri = ["caresmcp[hf,monai,timm,sam,itk,totalseg]"]
84
+ pathology = [
85
+ "caresmcp[torch,monai,timm]",
86
+ "cellpose>=4,<5",
87
+ "environs",
88
+ "sacremoses",
89
+ "conch-fork",
90
+ ]
91
+ ultrasound = ["caresmcp[hf,monai,timm]"]
92
+ xray = [
93
+ "caresmcp[hf,clip,itk]",
94
+ "torchxrayvision>=1.5,<1.6",
95
+ "flexray>=1.0.2,<1.1",
96
+ "onnxruntime>=1.20,<2",
97
+ "hi-ml-multimodal>=0.2.2,<0.3",
98
+ ]
99
+ all = ["caresmcp[ct,dsa,mri,pathology,ultrasound,xray]"]
100
+ docs = [
101
+ "sphinx>=9,<10",
102
+ "myst-parser>=5,<6",
103
+ "sphinx-autodoc-typehints",
104
+ "sphinx-design",
105
+ "sphinxawesome-theme",
106
+ "sphinxcontrib-bibtex",
107
+ ]
108
+
109
+ [project.urls]
110
+ Homepage = "https://caresmcp.readthedocs.io"
111
+ Documentation = "https://caresmcp.readthedocs.io/"
112
+ Repository = "https://github.com/Moenupa/caresMCP.git"
113
+ Issues = "https://github.com/Moenupa/caresMCP/issues"
114
+
115
+ [project.scripts]
116
+ caresmcp = "caresmcp.cli:app"
117
+
118
+ [build-system]
119
+ requires = ["uv_build>=0.13,<0.14"]
120
+ build-backend = "uv_build"
121
+
122
+ [dependency-groups]
123
+ dev = [
124
+ "pytest>=9",
125
+ "pytest-xdist",
126
+ "pytest-cov",
127
+ ]
128
+
129
+ [tool.docstrfmt]
130
+ preserve-adornments = true
131
+ line-length = 88
132
+ indent-width = 3
133
+
134
+ [tool.pytest.ini_options]
135
+ minversion = "9.0"
136
+ addopts = "--import-mode=importlib"
137
+ markers = [
138
+ "slow: mark tests as slow (pytest -m 'not slow' or set RUN_SLOW=1 to run)",
139
+ "cuda: mark tests as requiring a CUDA device",
140
+ ]
141
+ filterwarnings = ["ignore::torch.serialization.SourceChangeWarning"]