Fiji MCP Server
Allows AI agents to control Fiji/ImageJ for microscopy image analysis, including opening images, applying filters, thresholding, particle analysis, skeletonization, and running macros.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Fiji MCP ServerApply a Gaussian blur with sigma 4 and show me the result."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fiji MCP Server
Give your AI assistant hands inside Fiji/ImageJ. Fiji MCP Server is a small stdio Model Context Protocol bridge that can open and save images, discover and run installed commands, execute IJM or Groovy, read Results, and verify changes with screenshots.
This README documents v0.2.0. The public surface is deliberately limited to nine tools; Fiji's live command registries and scripting APIs provide the plugin reach without a large custom framework.
Quick start
You need Python 3.10 or newer and a local Fiji installation.
Install the server:
python -m pip install "fiji-mcp-server==0.2.0"Before v0.2.0 is published on PyPI, install from a source checkout instead:
python -m pip install .Locate the Fiji root directory. It must directly contain
jars/andplugins/; on this Mac, for example, it is/Applications/Fiji.Configure your MCP client with
FIJI_PATHandFIJI_MODE=headless; see the client-specific instructions below. The MCP client owns the stdio process and startsfiji-mcp-serverwhen needed.
Fiji starts lazily on the first Fiji-backed tool call. The bridge prefers one compatible JVM bundled inside the selected Fiji installation.
Related MCP server: Cellpose MCP Server
Connect Codex
The official Codex CLI, IDE extension, and ChatGPT desktop app share MCP configuration on the same Codex host. Add this stdio server from a terminal:
codex mcp add fiji \
--env FIJI_PATH=/Applications/Fiji \
--env FIJI_MODE=headless \
-- fiji-mcp-server
codex mcp listOr add the equivalent entry to ~/.codex/config.toml (or a trusted project's
.codex/config.toml):
[mcp_servers.fiji]
command = "fiji-mcp-server"
startup_timeout_sec = 120
tool_timeout_sec = 300
[mcp_servers.fiji.env]
FIJI_PATH = "/Applications/Fiji"
FIJI_MODE = "headless"In ChatGPT desktop, you can also open Settings → MCP servers → Add server, choose STDIO, and then restart after saving. See the official Codex MCP documentation for current client controls.
Other JSON-based MCP clients
Many local MCP clients use this common JSON shape. Their configuration-file location and restart control are client-specific:
{
"mcpServers": {
"fiji": {
"command": "fiji-mcp-server",
"env": {
"FIJI_PATH": "/Applications/Fiji",
"FIJI_MODE": "headless"
}
}
}
}If the client cannot find fiji-mcp-server, replace command with the full
path reported by which fiji-mcp-server (macOS/Linux) or
where fiji-mcp-server (Windows).
Try these prompts
Prompt: Open
/data/cells.tif, inspect its dimensions and current C/Z/T position, and show me an active-image screenshot.
Prompt: Search the installed Fiji commands for “Gaussian Blur”. Show the best matching command's invocation route and accepted inputs, then run it with sigma 2 only if that parameter is supported.
Prompt: Run an ImageJ macro that thresholds the active image and measures it, then return the Results table in pages of 200 rows.
Prompt: Save a screenshot to
/tmp/before.png, apply the chosen threshold, save/tmp/after.png, and compare them. If the expected change is absent, inspect state and logs before adjusting the threshold once; do not blindly repeat a mutation whose outcome is unknown.
Prompt: Use Groovy to call an installed scriptable plugin that is not representable as a structured command, then summarize its bounded result and the active-image state.
Prompt: Save the active image as
/data/output/processed.tiff. Do not overwrite an existing file, and report the exact path Fiji created.
What can it do?
Inspect and move data: read live state, open a local image, save the active image, and page through the Results table.
Use installed commands: search Fiji's SciJava and ImageJ1 registries, then invoke a selected command through structured parameters or legacy options when that route is supported.
Reach scriptable plugins: use trusted IJM or Groovy for ROIs, unusual Java inputs, and installed plugins that do not fit the registered command route.
Verify visually: render the active plane or Results table, save before and after PNGs, and compare dimensions and same-size pixel metrics.
The server does not install plugins, click dialogs, drive menus, or promise structured parameters for every plugin.
The nine tools
Tool | Purpose |
| Read Fiji lifecycle, active/open images, and Results-table state. |
| Search registered SciJava and ImageJ1 commands and inspect their routes. |
| Run one resolved installed command with supported parameters or options. |
| Run one trusted IJM or Groovy script. |
| Open an existing local image and make it current. |
| Save the active image to a new exact lowercase supported path. |
| Read an ordered, paginated page from Fiji's live Results table. |
| Return and optionally save a PNG of the active plane or Results. |
| Compare two saved raster paths visually and, when sizes match, numerically. |
See the complete nine-tool reference for signatures, return fields, limits, and failure behavior.
How it works
AI client ── stdio JSON-RPC ──▶ FastMCP ── serialized bridge ──▶ PyImageJ ──▶ Fiji + installed pluginsFiji operations share one process-wide lock. Read-only operations receive at most one retry for a small allowlist of transient failures. Commands, scripts, image opens, and saves are never automatically repeated after dispatch.
Safety and limitations
run_script executes trusted arbitrary local code. IJM and Groovy can read
or modify anything available to the MCP process, so run this server only for a
trusted local client. It is not a remote multi-user service or a sandbox.
Python diagnostics and ordinary Java output are redirected to stderr to protect
stdio JSON-RPC. Plugins that require GUI dialogs, mouse/keyboard automation, or
unscriptable interaction may fail in headless mode. Use FIJI_MODE=gui only for
an intentional local desktop workflow supported by that plugin.
save_image is strict within this MCP server process: its requested suffix must
be one of the exact lowercase formats documented in the tool reference, and an
output that exists when the serialized save begins is rejected. It is not a
cross-process atomic publisher, so another local process can still race that
check; use a dedicated output directory when other writers are active.
screenshot and compare_screenshots overwrite an existing save_path; use a
new path when preserving an existing PNG is required. After any mutation with
an unknown outcome, inspect state or take a screenshot before deciding whether
to retry.
Project links and acknowledgments
README-structure inspiration: Cellpose MCP
Related minimal viewer bridge: napari-mcp
License
BSD-3-Clause. See LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create, modify, and manage Figma designs through natural language commands via a specialized MCP server and plugin bridge. It supports a wide range of operations including element creation, property modification, component management, and accessibility checks.7103MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to perform cell segmentation through natural language commands, including 2D/3D segmentation, batch processing, image restoration, and custom model training.BSD 3-Clause
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to perform image processing tasks such as sprite sheet splitting, resizing, cropping, and batch operations on local images.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to control RELION 5.x cryo-EM structure determination software through natural language, providing 23 tools for the complete single-particle analysis pipeline.4MIT
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Create and manage AI agents that collaborate and solve problems through natural language interacti…
Build and run visual creative-production workflows from your AI agent.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/surajinacademia/Fiji_imageJ_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server