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.
Metadata
Release files for microscopy-llm-profiler 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| microscopy_llm_profiler-0.3.0.tar.gz | 157.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| microscopy_llm_profiler-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 348.4 kB
Release files / microscopy_llm_profiler-0.3.0.tar.gz
| Download URL | microscopy_llm_profiler-0.3.0.tar.gz |
|---|---|
| Size | 157.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a68c92de3f39682c8c4f6cadd6da29fd49806deb725843e9f74ddec716509c8d
|
|
BLAKE2b-256 checksum How to use checksums |
f59f7a961d4220f79d089cf1297d2ec2cae15a1088b08cf04f914a61e5e054b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logRelease files / microscopy_llm_profiler-0.3.0-py3-none-any.whl
| Download URL | microscopy_llm_profiler-0.3.0-py3-none-any.whl |
|---|---|
| Size | 191.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80793a3cc4123b3d4bce924d8daeece6fef46292df6fa41f6ebcdfa0295a02f9
|
|
BLAKE2b-256 checksum How to use checksums |
c27ed23b6759b597d9c2a9bdcda88a86939fb53cec3210fdc962eec152c8a98f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logSecurity for microscopy-llm-profiler 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for microscopy_llm_profiler-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.