by MIC-DKFZ
nnInteractive as a tool for AI agents: say what to segment, the agent does the rest (Claude Code, Codex, any MCP client)
# Add to your Claude Code skills
git clone https://github.com/MIC-DKFZ/nninteractive-agentGuides for using ai agents skills like nninteractive-agent.
See how nninteractive-agent compares with popular alternatives.
nninteractive-agent is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by MIC-DKFZ. nnInteractive as a tool for AI agents: say what to segment, the agent does the rest (Claude Code, Codex, any MCP client). It has 51 GitHub stars.
nninteractive-agent's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/MIC-DKFZ/nninteractive-agent" and add it to your Claude Code skills directory (see the Installation section above).
nninteractive-agent is primarily written in Python. It is open-source under MIC-DKFZ on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh nninteractive-agent against similar tools.
No comments yet. Be the first to share your thoughts!
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Say what to segment. The agent does the rest.
nnInteractive as a tool for AI agents. Tell your agent in plain text what to segment ("segment every rib individually and save the result"). The agent prompts nnInteractive with scribbles (boxes where a box fits the object, points for tiny regions), checks the 3D result and corrects it, as a human annotator would. It works on CT, MRI, microscopy, electron microscopy and photographs.
What you get:
nninteractive) with the tools listed under Tools. Any agent that
speaks MCP can use it: Claude Code, Codex, open models behind Claude Code, and others.nninteractive-segmentation) that teaches the agent the workflow: prompt rules, a
correction playbook and how to verify. The MCP server also offers it as an MCP prompt for agents
that do not load skills.How well it works: on our benchmark (14 public CT, MRI, PET and micro-CT images, 51 named targets, nnInteractive v1.0), Claude Code and Codex reach a mean Dice of 0.81 to 0.85 (averaged per image) in about four minutes per image. nnInteractive alone, with one click per target, reaches 0.71. When the agents are told where each target is, their prompts are about as good as simulated prompts placed with the reference mask, at the same number of prompts. VoxTell, a 3D model that segments from text alone, reaches 0.54: it does well on standard radiology targets and fails on the leg muscles, the foot bones and the animals.
Technical report: nnInteractive Agent: General-Purpose AI Agents as 3D Image Annotators (arXiv, 2026). It describes the tools and the skill and evaluates them on the benchmark.
nnInteractive itself runs on your machine (a CUDA GPU is strongly recommended) or on an
nninteractive-server on a GPU machine elsewhere.
| You want to | Read |
|---|---|
| segment images from Claude Code or Codex | Use it from Claude Code or Codex |
| show the agent to other people in a browser | Web demo |
| run nnInteractive on another machine than the agent | nnInteractive: local or on a server |
| measure how well an agent segments | benchmark/README.md |
Requires Python 3.10 or newer.
pip install "nninteractive-agent[local] @ git+https://github.com/MIC-DKFZ/nninteractive-agent"
| Extra | Adds | Needed for |
|---|---|---|
[local] |
nnInteractive with PyTorch and nnU-Net | running nnInteractive on this machine (the default) |
[web] |
FastAPI, the Claude Agent SDK | the web demo |
| none | the torch-free nnInteractive client | using an nnInteractive server only |
Extras combine: [local,web]. Local inference needs an NVIDIA GPU with about 10 GB of memory
(small objects work with less); on a CPU it works, but every prompt takes long. If pip installs a
PyTorch that does not match your CUDA driver, install PyTorch first
(pytorch.org), then this package.
Install Claude Code or Codex and log in. Then:
nninteractive-agent setup claude # or: nninteractive-agent setup codex
setup does three things:
~/.nninteractive). With --server it connects to
the server once instead.~/.claude/skills, plus a verifier subagent in
~/.claude/agents. Codex gets it in ~/.codex/skills.From then on, every new Claude Code or Codex session has the tools and the skill, in any directory. A session that never segments anything only starts a small Python process: PyTorch and the model load with the first image.
setup option |
|
|---|---|
--server URL |
use an nninteractive-server instead of local inference (see On a server) |
--python full|guarded|off |
the agent's python tool (see Security); default full |
--workdir DIR |
where renders, the tool log and default outputs go (default: ./runs/<time> in the directory the agent runs in) |
--skip-model |
do not check PyTorch or download the weights now |
--uninstall |
remove the MCP server, the skill and the verifier agent again |
The choices are stored in the agent's MCP configuration. To change them, for example to switch from
local inference to a server, run setup again with the new options.
Start the agent in the directory where results should go, and ask in plain text:
claude "Segment the liver and the spleen in /data/ct.nii.gz, each as its own object, and save the result."
codex "Segment every nucleus in /data/cells.tif and save the result."
Or start claude or codex without a prompt and ask there. The agent loads the skill on its own
when you ask it to segment, delineate, outline, label or count structures in an image file. The
image and its objects stay loaded for the whole session, so you can follow up: "the liver leaks
into the heart, fix that", "now also both kidneys, each as its own object".
<image>_instances in the input's
format) and objects.json with names and notes. They go wherever you tell the agent, or to
./runs/<time>/output/."mcp__nninteractive" to permissions.allow in
~/.claude/settings.json to allow all of them.codex exec (non-interactive) needs the tools approved up front:
codex exec -c mcp_servers.nninteractive.default_tools_approval_mode="approve" "...".python tool for good, read Security.Tested with Claude Code 2.1 (Opus 5.5), Codex 0.162.1 (gpt-6.1-sol) and Claude Code on vLLM (Qwen3.8-27B, see Open models).
nninteractive-agent setup print
This prints an mcpServers entry for any MCP client (Cursor, opencode, Goose, ...) and the path of
the skill folder. Copy the folder to wherever your agent looks for skills. If the agent has no
skills, it can read the MCP prompt nninteractive-segmentation (also available as resources
under nninteractive://skill/); the server's instructions point the agent to it.
The agent needs a model that sees images: the tools return rendered views.
Claude Code can also load the tools and the skill as a plugin, for one session only, from an
environment where nninteractive-agent-mcp is on the PATH:
claude --plugin-dir "$(python -c 'import nninteractive_agent.skill as s; print(s.PLUGIN_DIR)')"
Claude Code can drive any model behind an Anthropic-compatible API, for example a
vLLM server (it serves /v1/messages). The model must:
--enable-auto-tool-choice and the model's --tool-call-parser;
otherwise tool calls come back as plain text.We tested Qwen3.8-27B:
nninteractive-agent setup claude
export ANTHROPIC_BASE_URL=http://localhost:8000 ANTHROPIC_API_KEY=dummy ENABLE_TOOL_SEARCH=false
export ANTHROPIC_DEFAULT_OPUS_MODEL=Qwen/Qwen3.8-27B ANTHROPIC_DEFAULT_SONNET_MODEL=Qwen/Qwen3.8-27B \
ANTHROPIC_DEFAULT_HAIKU_MODEL=Qwen/Qwen3.8-27B
claude --model Qwen/Qwen3.8-27B --effort medium
Pick an effort the server accepts: vLLM with Qwen takes low, medium and xhigh, not high. Open
models work, but they are slower and less precise. On a spleen CT (spleen_10 of the Medical
Segmentation Decathlon, nnInteractive v1.0 on the same machine), Qwen3.8-27B at medium effort
reached Dice 0.93 with five prompts, but took 34 minutes; Claude Code and Codex need about four
minutes per image in the benchmark, for 3.6 targets on average.
Its first boxes are often too large, so do not tell it to skip verification.
A demonstrator, separate from the tools above: the same tools and skill, driven by an agent behind
a browser page. The people using it need no agent of their own, and the web demo does not need
setup.
pip install "nninteractive-agent[local,web] @ git+https://github.com/MIC-DKFZ/nninteractive-agent"
nninteractive-agent-web --examples ~/images
It prints a link, http://127.0.0.1:8443/?key=...: open it in a browser on the same machine.
The start-up lines also show where nnInteractive runs, its model license, the agent's LLM and the
python mode. If the demo runs on