MedMLX
Integrates with Hugging Face Hub for model setup by reusing the Hub cache and downloading missing model files, including resumable downloads.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MedMLX
One Python API, command line and MCP server for native medical imaging on Apple Silicon. Run TotalSegmentator, nnU-Net, MedSAM2, SynthSeg and more through their independent MLX runtimes.
Models · Setup guide · MCP guide · Website
Apple Silicon · Metal · Python 3.13 · uv
Install
uv tool install --python 3.13 "medmlx[all,mcp]"For a Python project, use uv add "medmlx[all,mcp]". Run uv tool upgrade medmlx to
update MedMLX and its models. Model weights download on first use and keep their own
terms. For a smaller install, replace all with one group:
Extra | Installs |
| Every model runtime, with Reason-CT tools |
| Segmentation runtimes, including SAM 3 video |
| Reason-CT, NV-Generate, LesionDiffusion and FDG PET synthesis |
| Lung nodule detection, RadImageNet features and radiomics |
| The MCP server |
Related MCP server: local-mcp
Quickstart
medmlx models lists the installed models. To segment a CT scan, put it in a
working folder and run from there:
mkdir -p ~/medmlx-work && cd ~/medmlx-work
cp /path/to/ct.nii.gz .Then show the model's arguments, check that it can run, and run it:
medmlx describe mlx-segment-ct
medmlx check mlx-segment-ct image_path=ct.nii.gz output_dir=segment-ct
medmlx run mlx-segment-ct image_path=ct.nii.gz output_dir=segment-ctKEY=VALUEpairs take the argument namesdescribelists. Values are converted to the declared types; give lists and other JSON values asKEY:=JSON, for examplepoints:='[[120, 140, 60]]'.--arguments FILEreads them from a JSON file.Relative paths resolve against the current folder, or against
--root.checkchecks Metal, the arguments and the input paths without downloading anything.The first run downloads the
MedMLX/vista3d-ct-mlxweights; later runs reuse the cache.The mask is written to
segment-ct/mask.nii.gz.medmlx setup --all --progressdownloads every model's weights for offline use. See automatic weights and readiness.
Models
Model IDs are what medmlx run and medmlx describe take.
Model ID | Task | Input | Extra |
| 113 muscle and bone structures | MRI, CT | segment |
| Whole-body CT segmentation | CT | segment |
| Automatic and point-prompted segmentation (VISTA-3D) | CT, MRI | segment |
| Organ and tumor segmentation (nnU-Net v2) | CT, PET/CT, brain MRI | segment |
| Multi-organ MRI segmentation | MRI | segment |
| Whole-head segmentation from any MRI contrast or CT | Head MRI, CT | segment |
| Brain segmentation and parcellation | Brain MRI, CT | segment |
| Box-, point- or mask-prompted masks with propagation | NIfTI slices or volumes, frames | segment |
| Text-, box- or point-prompted image segmentation | 2D images, video frames | segment |
| Text-prompted segmentation | 3D volumes, 2D images | segment |
| 13 abdominal organs | Contrast CT | segment |
| Renal arteries, veins, ureters, tumors and parenchyma | Multiphase CT | segment |
| Kidney cortex, medulla and collecting system | CT | segment |
| Radiograph anatomy | Radiographs | segment |
| Surgical tools | Endoscopy frames | segment |
| Lung nodule detection | Chest CT | vision |
| Radiology image features | 2D images | vision |
| CT reports and question answering | CT | generate |
| Reason-CT with nodule detection and MedSAM2 masks | Chest CT | reason-tools |
| Synthetic CT and MRI | Label maps or anatomy | generate |
| Synthetic CT lesions | CT and organ mask | generate |
| Synthetic FDG PET (weight-free) | CT and labels | generate |
| Image-to-text through a separate environment | 2D images |
Each model has its own repository in the MedMLX organization.
medgemma and mrsegmentator require local weights.
Memory
MedMLX runs one model at a time by default. It never refuses a run for memory: readiness reports a model's peak next to the memory available, and the run starts either way, so a Mac with too little memory may swap or fail. Declared peaks:
Model | Peak MLX memory |
| 16.0 GB |
| 14.5 GB |
| 12.5 GB |
| 11.6 GB |
| 11.1 GB |
| 11.0 GB |
| 10.2 GB |
| 7.5 GB |
| 7.3 GB |
| 6.0 GB |
| 5.6 GB |
| 5.4 GB |
| 5.2 GB |
| 5.0 GB |
| 4.8 GB |
| 4.1 GB |
| 3.9 GB |
| 2.8 GB |
| 1.3 GB |
| 1.2 GB |
| 0.5 GB |
| 0.3 GB |
| 0.2 GB |
Models without a declared peak (medgemma, mrsegmentator, musclemap, reason-ct-tools) record their measured peak after each run, and medmlx describe reports it.
medgemma runs in its own interpreter, outside this check. Describing a chest
radiograph peaks at 4.4 GB with MedGemma 1.5 4B and 17.9 GB with MedGemma 27B.
MCP
medmlx serve --root /path/to/work runs a stdio MCP server that lets an
assistant list models, check inputs and run jobs in that folder. For Claude Code:
mkdir -p ~/medmlx-work
claude mcp add --scope user medmlx -- "$(uv tool dir --bin)/medmlx" serve --root "$HOME/medmlx-work"For clients configured with JSON, use absolute paths:
{
"mcpServers": {
"medmlx": {
"command": "/absolute/path/to/medmlx",
"args": ["serve", "--root", "/absolute/path/to/medmlx-work"]
}
}
}Disconnecting the client cancels its running jobs. The MCP guide covers Codex, other clients, tools and a complete job workflow.
Python
import medmlx
result = medmlx.run(
"mlx-segment-ct",
image_path="ct.nii.gz",
output_dir="segment-ct",
root="/path/to/medmlx-work",
)
result.outputs["mask"] # path by role
result.artifacts["mask"] # kind, coordinate space and labels of that file
result.summarize("mask") # each label's name, voxel count and volume in mLresult.job holds the full job record, including log_tail.
For a model whose package exports load_model, queue up to 256 cases with one
loaded model:
with medmlx.start_cohort(
"nnunet-liver",
preparation={"weights_path": "liver-model"},
cases=[
{"image_path": "ct-a.nii.gz", "output_dir": "out-a"},
{"image_path": "ct-b.nii.gz", "output_dir": "out-b"},
],
) as cohort:
for case in cohort.wait().cases:
print(case.index, case.outputs if case.ok else case.error)Cases run in order and report individual results or errors. Weights and model configuration stay fixed until the cohort closes automatically after its final case. Leaving the context early cancels the worker and its child processes.
More
Reason-CT with nodule tools: detect and segment nodules, then browse masks and measurements in a local CT viewer.
MedGemma bridge: run MedGemma in a managed environment with local weights.
Development: declaring models, checkpoint conversion and the shared core runtime.
License
Apache-2.0. See third-party notices. Runtimes and model weights retain their own terms.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Governed data discovery, exact queries, decisions, simulations, and runtime utilities over MCP.
Hosted MCP memory and agent control plane for durable conversations, jobs, and operations.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
AlicenseAqualityBmaintenanceUnified MCP server for managing local model runtimes (Ollama, LM Studio, etc.), enabling provider-agnostic discovery, lifecycle management, hardware-fit checks, and delegated inference.22118 npmCreative Commons Attribution Non Commercial No Derivatives 4.0 International- FlicenseNot gradedqualityDmaintenanceEnables running MCP tools against local MLX models on your Mac, with hardware-aware configuration, CLI streaming, and a dashboard for routing and monitoring.-
- AlicenseBqualityBmaintenanceEnables AI agents to directly access native macOS services, media, system health, and administration tools through a local MCP server.4240 npm2MIT
- AlicenseNot gradedqualityCmaintenanceEnables local project file access, editing, command execution, recoverable long-running jobs, Apple MPS checks, and macOS UI automation through MCP.MIT