Deterministic microscopy image analysis for AI agents, over MCP. Point your Claude/Cursor/Codex agent at an image and it segments, counts, and measures cells — Fiji/ImageJ-equivalent, every number traceable to a tool, never guessed.
Project description
microscopy-llm-profiler
Deterministic microscopy image analysis for AI agents, over MCP.
Point your Claude / Cursor / Codex agent at a microscopy image and it does the analysis for you — segment, count, measure, localize, colocalize — by calling 51 deterministic MCP tools. Every number comes from a named tool (segmenter + metric), traceable and reproducible — never an LLM guess. No browser, no separate analysis API key: your agent is the orchestrator; Python does the math.
Think of it as Fiji/ImageJ, driven in plain language — "profile this ND2", "count the rods on the DIC channel", "give me per-cell bipolar vs septal localization" — with the rigor of a scripted pipeline.
Why
- Trustworthy by construction. The engine is deterministic; the agent chooses which tool and interprets overlays, but it cannot invent a count. Every result is a segmenter + metric you can re-run.
- QC-first workflow. Metadata, saturation, SNR, and focus checks run before any measurement, so you catch bad data instead of counting noise.
- Formats scientists actually use. Native
.nd2(multi-channel, by channel name),.tif/.tiff,.png.
What's inside
- Segment & count — nuclei, puncta/vesicles, condensates, and rod bacteria (DIC-guided), with an evaluate-and-retune quality loop for counts you can trust.
- Segmenters —
opencv_watershed(blobs, deterministic, no GPU),dic_rod(rods on DIC/brightfield), plus optional deep-learningcellpose/stardist_2d. - Measure — per-object tables (area, intensity, shape), colocalization (Pearson/Manders), spatial cross-correlation, subcellular localization (membrane / polar / bipolar / septal / diffuse).
- Agent-in-the-loop —
threshold_step/segment_step/outline_stepfor one-iteration-at-a-time visual review on hard images. - A
/microharness prompt that boots the analysis workflow, shipped inside the package (no files to copy).
Install (no repo clone)
# A) run on demand with uv — nothing installed globally
claude mcp add microscopy-profiler --scope user -- uvx microscopy-llm-profiler
# B) or pip install, then register + install the /micro skill
pip install microscopy-llm-profiler
microscopy-profiler-setup # writes the /micro + /welcome skills, prints the mcp-add line
claude mcp add microscopy-profiler --scope user -- microscopy-profiler
Restart Claude Code, run /mcp to confirm microscopy-profiler is connected, then
type /micro to boot the harness (or use the built-in MCP prompt
/mcp__microscopy-profiler__micro — it ships in the package, no local files needed).
Other clients: the server speaks stdio MCP, so it works in Cursor, Claude
Desktop, and Codex too — point their MCP config at the microscopy-profiler
command. microscopy-profiler-setup --print-config prints the JSON snippet.
Optional extras (deep-learning segmenters / Fiji macros / VLM judge):
pip install "microscopy-llm-profiler[cellpose]" # or [stardist], [fiji], [vision]
Use
Just describe the task with an absolute image path:
Profile
/abs/path/to/sample.nd2— channels, pixel size, and any quality issues (saturation, low SNR, out of focus) before we measure anything.
In
/abs/path/to/sample.nd2, use the DIC channel for cell boundaries and the GFP channel for signal. Count rods and give per-cell bipolar / septal / diffuse localization with a histogram.
Requirements: Python ≥ 3.11. Deep-learning segmenters benefit from a GPU but aren't required — the core watershed/rod path is CPU-only and deterministic.
Data handling & security
Designed to be safe on unpublished / sensitive research data. Defaults are private:
- Nothing leaves your machine by default. The engine is fully local. The only
off-box path is the optional VLM quality-check, which is doubly gated — it
sends image pixels to the Anthropic API only if you set both
ANTHROPIC_API_KEYandMICROSCOPY_PROFILER_ALLOW_VLM=1. Data sent there is subject to Anthropic's terms. Leave it unset to stay 100% local. - Telemetry is OFF by default. Product/usage telemetry is written only if you opt
in with
MICROSCOPY_PROFILER_TELEMETRY=1; then it goes to local JSONL under~/microscopy_profiler_runs/telemetry/with file paths/emails redacted best-effort. It stays local unless you also set a collector URL (opt-in "phone home",MICROSCOPY_PROFILER_TELEMETRY_UPLOAD_URL) — a deliberate second switch. Even then, only redacted events are sent, and free-text queries are stripped unless you setMICROSCOPY_PROFILER_TELEMETRY_UPLOAD_TEXT=1. See SECURITY.md for all flags. - Run provenance (manifests, overlays) is written under
~/microscopy_profiler_runs/and includes the input file path. It has no auto-expiry — relocate it withMICROSCOPY_PROFILER_RUNS=/path(and telemetry withMICROSCOPY_PROFILER_TELEMETRY_DIR) to a scratch/encrypted location and purge periodically for sensitive data. run_fiji_macrois arbitrary code execution (ImageJ macros can spawn shells) and is disabled unless you setMICROSCOPY_PROFILER_ALLOW_FIJI_MACROS=1in a trusted environment. Every other tool is deterministic and non-privileged.
Locked-down profile for clinical/sensitive data: don't set ANTHROPIC_API_KEY /
MICROSCOPY_PROFILER_ALLOW_VLM, leave telemetry off, and point the runs dir at a scratch
location you control.
License
PolyForm Noncommercial 1.0.0 — free to use, modify, and share for any
noncommercial purpose (research, education, nonprofits, personal/hobby use).
Commercial use is not permitted — you may not use this software to build a
commercial product or business. See LICENSE. For a commercial license,
contact the maintainers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microscopy_llm_profiler-0.2.0.tar.gz.
File metadata
- Download URL: microscopy_llm_profiler-0.2.0.tar.gz
- Upload date:
- Size: 142.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9bdf70748b042dd8dc1a96d91257b4b49e27aaaa42bd9d719569e544f9ef526
|
|
| MD5 |
c0eb5d4ac2a068ed068b6c7370583125
|
|
| BLAKE2b-256 |
f43c2b0bd82999d86f7707eddc18af9156a2e3061ab5c486ce4c123e89abcd93
|
Provenance
The following attestation bundles were made for microscopy_llm_profiler-0.2.0.tar.gz:
Publisher:
release.yml on minervapanda/claude-setup-micro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microscopy_llm_profiler-0.2.0.tar.gz -
Subject digest:
b9bdf70748b042dd8dc1a96d91257b4b49e27aaaa42bd9d719569e544f9ef526 - Sigstore transparency entry: 2134044451
- Sigstore integration time:
-
Permalink:
minervapanda/claude-setup-micro@b1d6900832549cfd8b1657949706baa36659d2ae -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/minervapanda
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1d6900832549cfd8b1657949706baa36659d2ae -
Trigger Event:
push
-
Statement type:
File details
Details for the file microscopy_llm_profiler-0.2.0-py3-none-any.whl.
File metadata
- Download URL: microscopy_llm_profiler-0.2.0-py3-none-any.whl
- Upload date:
- Size: 174.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
958a4200bda501751e6be335b01f03807b27304975916bb96f38880f32fc226e
|
|
| MD5 |
6a5c67dece344524ed71e6e8d8b2dac8
|
|
| BLAKE2b-256 |
6d9bc7250643023f37a43b8504d1800c2ec8c4812fbee1ba8354668bc815f0b9
|
Provenance
The following attestation bundles were made for microscopy_llm_profiler-0.2.0-py3-none-any.whl:
Publisher:
release.yml on minervapanda/claude-setup-micro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microscopy_llm_profiler-0.2.0-py3-none-any.whl -
Subject digest:
958a4200bda501751e6be335b01f03807b27304975916bb96f38880f32fc226e - Sigstore transparency entry: 2134044497
- Sigstore integration time:
-
Permalink:
minervapanda/claude-setup-micro@b1d6900832549cfd8b1657949706baa36659d2ae -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/minervapanda
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1d6900832549cfd8b1657949706baa36659d2ae -
Trigger Event:
push
-
Statement type: