Micro-Manager Microscope

io.github.K-Dense-AI由 GitHub 帳號 K-Dense-AI 發布v0.1.3更新於 Oct 24, 2026

MCP server for microscopes controlled by Micro-Manager (pymmcore-plus).

發布方自己的服務:Mu

已驗證STDIO僅桌面開發者工具

概覽

AI 產生的概覽

讓助理控制 Micro-Manager 顯微鏡:拍攝影像、執行 Z 軸堆疊與縮時攝影、移動載物台與對焦、切換通道與物鏡。

可以做什麼
透過 pymmcore-plus 包裝 Micro-Manager 的 MMCore 裝置層,讓助理能驅動任何搭載 Micro-Manager 裝置轉接器的顯微鏡。工具涵蓋取像(snap_image、acquire_z_stack、acquire_time_lapse)、移動(move_stage_xy、move_z、autofocus)、光學與光源(set_config、set_objective、set_exposure、set_shutter),以及唯讀的裝置、位置、設定群組與原始命令紀錄查詢。安全工具可停止載物台並關閉快門。影像會存成 TIFF 檔,工具回傳統計資訊與小尺寸預覽。
適用情境
當你希望助理操作由 Micro-Manager 控制的顯微鏡進行例行取像時使用:拍攝視野、Z 軸堆疊、縮時攝影、自動對焦、切換通道與物鏡,或讀取儀器狀態。也可透過內建模擬器在沒有硬體的情況下使用,方便先試提示詞或測試流程。
執行需求
以 PyPI 套件 labmcp-micro-manager(uvx)透過 stdio 在本機執行。需要 Micro-Manager 的 .cfg 硬體設定、版本相符的裝置轉接器函式庫(可用內附的 mmcore 指令安裝,或指向既有的 Micro-Manager 安裝),以及廠商相機 SDK/驅動程式。伺服器占用裝置期間必須關閉 Micro-Manager 應用程式。選用環境變數:LABMCP_ADDRESS、LABMCP_LIMITS、LABMCP_READ_ONLY、LABMCP_SIMULATE。未宣告驗證機制。
安裝前請注意
會改變狀態的工具會移動真實硬體:move_z 與 set_objective 可能讓物鏡撞到樣品,set_shutter 開啟快門會持續照射並漂白樣品直到關閉。使用前應設定 z_min_um/z_max_um 與 XY 軟體限位,並檢查步進限位(max_z_step_um、max_xy_step_um、max_exposure_ms、max_frames、max_acquisition_duration_s)。LABMCP_READ_ONLY=1 可停用會改變狀態的工具。README 說明此伺服器僅在模擬裝置上測試,尚未在真實硬體上驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Micro-Manager Microscope,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Micro-Manager Microscope — MCP Server

Let an AI agent snap images, acquire z-stacks and time-lapses, move the stage and focus within limits you set, switch channels and objectives, set exposure, operate shutters and run autofocus on any microscope controlled by Micro-Manager, through its open device layer (MMCore) and pymmcore-plus.

Packagelabmcp-micro-manager
InstrumentsAny hardware with a Micro-Manager device adapter (hundreds of cameras, XY/Z stages, microscope stands, filter wheels, shutters and light sources from Hamamatsu, Photometrics, Andor, PCO, Basler, ASI, Prior, Ludl, Märzhäuser, Nikon, Zeiss, Olympus/Evident, Leica, Lumencor, CoolLED and others), described by a Micro-Manager .cfg hardware configuration
InterfacesWhatever the device adapters use: USB, serial, Camera Link / CoaXPress / GigE frame grabbers
ProtocolMicro-Manager MMCore API via pymmcore-plus CMMCorePlus (MMCore API reference, pymmcore-plus API, configuration guide)
Status🧪 simulated: tested against a simulated microscope and against pymmcore-plus' real core with Python test devices, not yet verified on hardware. Report a hardware test

Try it without hardware

bash
uvx labmcp-micro-manager --simulate --check

The simulator is a widefield fluorescence microscope with a 512 x 512, 12-bit camera, an XY stage, a focus drive, a shutter, a DAPI / FITC / TRITC / Brightfield filter wheel, a 10x / 20x / 40x turret and a hardware autofocus, looking at a field of cell nuclei. Its images defocus with Z, scale with exposure, bleach with light dose, saturate at 4095 and carry shot and read noise, so focusing, exposure and bleaching behave like on a real microscope.

Connect your microscope

  1. Hardware configuration: create and test a .cfg file with Micro-Manager's Hardware Configuration Wizard (in the Micro-Manager app), including config groups for channels (usually Channel) and objectives (Objective) and a pixel-size calibration. Close the Micro-Manager app afterwards: a device can only be opened by one program.
  2. Device adapters: pymmcore-plus needs Micro-Manager's device adapter libraries in a version that matches its pymmcore build. Either download them with pymmcore-plus' own installer:
    bash
    uvx --from labmcp-micro-manager mmcore install     # into pymmcore-plus' data folderuvx --from labmcp-micro-manager mmcore list        # show what was found
    or point to an existing Micro-Manager installation with --option mm_path=/path/to/Micro-Manager (it must be a build whose device interface matches pymmcore; mmcore info shows the version). Vendor camera SDKs and drivers must be installed separately, as for Micro-Manager itself.
  3. Test the connection:
    bash
    uvx labmcp-micro-manager --address ~/scopes/Ti2_Prime95B.cfg --checkuvx labmcp-micro-manager --address MMConfig_demo.cfg --check      # Micro-Manager demo devices
    --check loads the configuration and prints the camera, stages and other device roles.

Add to your MCP client

Claude Code

bash
claude mcp add microscope -- uvx labmcp-micro-manager --address /path/to/MyScope.cfg --option z_min_um=0 --option z_max_um=4500

Claude Desktop / Cursor / Windsurf (claude_desktop_config.json, .cursor/mcp.json, …)

json
{  "mcpServers": {    "microscope": {      "command": "uvx",      "args": ["labmcp-micro-manager", "--address", "/path/to/MyScope.cfg",               "--option", "z_min_um=0", "--option", "z_max_um=4500",               "--option", "data_dir=/data/microscope"]    }  }}

Add --read-only to let the agent read positions and settings without imaging or moving anything (stop_stage and close_shutter stay available). For other clients, generate the snippet with uvx labmcp config micro-manager --address /path/to/MyScope.cfg --client vscode (also cursor, codex, claude-code).

Tools

ToolKindDescription
acquire_time_lapse⚠️ hazardAcquire a time-lapse at the current position: images every interval_s (optionally several channels per timepoint), saves a multi-page TIFF and reports per-frame statistics and the intensity change (bleaching). Bounded by max_frames and max_acquisition_duration_s; stop_stage aborts it.
acquire_z_stack⚠️ hazardAcquire a z-stack around the current focus: moves Z through the slices (optionally imaging several channels at each), saves a multi-page TIFF, reports per-slice statistics and the sharpest slice, and returns Z to where it started. Every slice must stay within max_z_step_um of the start and the Z soft limits.
autofocus⚠️ hazardRun the configured autofocus device (e.g. a hardware focus lock) once; it moves the focus drive. If the result is outside the Z step or soft limits, the focus is moved back and an error is raised.
close_shutter🛑 safetyClose the shutter (stop illuminating the sample) and abort any running acquisition.
get_command_log👁 readReturn the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.
get_connection_info👁 readReport which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.
get_exposure👁 readReturn the camera exposure time in milliseconds.
get_position👁 readRead the XY stage and focus (Z) positions in micrometres, and which way increasing Z moves the objective.
get_system_info👁 readDescribe the microscope: loaded devices (camera, stages, shutters, filter wheels...), which device has which role, camera size/bit depth/exposure, pixel size, config groups with their presets, the current position, and the soft limits. Call this first.
list_config_groups👁 readList Micro-Manager config groups (e.g. Channel, Objective) with their presets and the preset currently active.
move_stage_xy⚠️ hazardMove the XY stage. Moves longer than max_xy_step_um or outside the XY soft limits are refused before anything moves. Make sure the objective and condenser clear the sample holder.
move_z⚠️ hazardMove the focus drive (Z). Moving the objective toward the sample can crash it into the slide: moves larger than max_z_step_um or outside the Z soft limits are refused before anything moves.
reconnect🛑 safetyClose and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).
set_config🎛 controlApply a config-group preset (e.g. switch the channel: filter cube, light source, emission filter). Objective/turret groups are refused here: use set_objective.
set_exposure🎛 controlSet the camera exposure time (ms). Longer exposures give brighter images but more photobleaching. Returns the exposure the camera accepted.
set_objective⚠️ hazardSwitch the objective (rotates the nosepiece/turret). A longer or immersion objective can hit the sample holder or need oil/water: confirm with the user first. Pixel size changes with the objective.
set_shutter⚠️ hazardOpen or close the current shutter, and optionally switch auto-shutter. An open shutter illuminates (and bleaches) the sample until it is closed again.
snap_image🎛 controlAcquire one image with the current channel, exposure and position. The sample is illuminated during the exposure. Saves the full image as TIFF and returns summary statistics (min/max/mean, saturation, sharpness) plus an optional contrast-stretched preview.
stop_stage🛑 safetyImmediately stop XY and Z stage motion and abort any z-stack or time-lapse in progress.

get_connection_info, get_command_log and reconnect are built into every LabMCP server. get_command_log lists every state-changing MMCore call (setPosition(1502.0), setConfig('Channel', 'FITC'), snapImage(), ...).

Safety limits

LimitDefaultMeaning
max_z_step_um50 µmLargest focus move from the current position (also the largest z-stack offset, and the largest autofocus correction accepted)
max_xy_step_um20000 µmLargest XY stage move in one call (straight-line distance)
max_exposure_ms10000 msLongest camera exposure
max_frames500Most images in one z-stack or time-lapse (slices or timepoints x channels)
max_acquisition_duration_s3600 sLongest time-lapse (one tool call can run at most 3600 s whatever this is set to)

Override at launch, e.g. --limit max_z_step_um=10 --limit max_frames=2000.

Soft limits (recommended): absolute stage bounds in micrometres, set with driver options. Find them by moving to the safe extremes in Micro-Manager (e.g. Z with the objective just below the coverslip) and reading the positions:

OptionMeaning
z_min_um, z_max_umAllowed focus range. Set the side that moves the objective toward the sample tightly.
x_min_um, x_max_um, y_min_um, y_max_umAllowed XY range (e.g. the area of your slide or plate holder)

Every Z and XY move, every z-stack slice and every autofocus result is checked against the step limits and soft limits before anything moves (autofocus results are checked afterwards and undone if out of range).

Example prompts

  • "What's on this microscope? List the channels and objectives, and the current position."
  • "Switch to FITC, find an exposure that uses about half the camera's range without saturating, then snap an image and show me."
  • "Autofocus, then take a z-stack from −10 to +10 µm in 1 µm steps in DAPI and FITC and tell me which slice is sharpest."
  • "Move 500 µm to the right and snap a DAPI image; repeat three more times to make a row of four fields."
  • "Record a time-lapse in TRITC every 30 s for 20 minutes and tell me how much the signal bleached."
  • "Something is wrong — stop the stage and close the shutter."

Notes

  • Objective crashes. Moving the focus drive toward the sample can drive the objective into the coverslip or dish. get_position / get_system_info report focus_direction (whether increasing Z moves the objective toward the sample, as declared by the device adapter; often unknown). Configure z_min_um / z_max_um for every microscope you connect.
  • Objective changes (set_objective) rotate the nosepiece and are marked as hazardous; set_config refuses config groups whose names look like objective or turret groups (Objective, Nosepiece, Turret, Magnification, Lens). Other groups are applied as-is: if one of your presets moves hardware near the sample, name the group accordingly or leave it out of the configuration.
  • Light exposure. With auto-shutter on (the default), the light path only opens while the camera exposes. set_shutter(open=True) leaves the sample lit until close_shutter is called.
  • Images are saved as TIFF files (ImageJ hyperstacks with pixel size, Z spacing and frame interval) in save_path, or in --option data_dir=... (default: the system temp folder, labmcp-micro-manager/). save_path must end in .tif/.tiff and must not be a folder; it is checked before anything moves or is exposed. Existing files are never overwritten (a numeric suffix is added). Tools return statistics (min/max/mean/std, saturated fraction, a sharpness score) and a small contrast-stretched PNG preview, never the full image.
  • Acquisitions (acquire_z_stack, acquire_time_lapse) snap image by image with the current camera settings; they do not use hardware-triggered sequencing, so they are slower than Micro-Manager's MDA engine but behave identically on every device. stop_stage or close_shutter aborts them between frames; partial data is saved (an incomplete slice or timepoint is dropped). A z-stack returns the focus to its starting position unless it was aborted. An acquisition must fit in one tool call: one whose exposure time alone exceeds 3600 s is refused, and one that runs long because of stage, filter or camera overheads stops between slices/timepoints and reports why in note. Channels cannot come from an objective/turret group.
  • Autofocus uses the configured autofocus device (fullFocus). Software autofocus plugins from the Micro-Manager Java app are not available.
  • pymmcore-plus is imported only when a real configuration is loaded, so --simulate works without Micro-Manager's native libraries.

Hardware verification

Microscope / camera / stageMicro-Manager adaptersInterfaceVerified byDate
none yet: be the first

來源:servers/biology/micro-manager/README.md,提交 46545ea

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v0.1.3最新Sep 27, 2026
  2. v0.1.1Sep 26, 2026
  3. v0.1.0Sep 26, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Micro 整合