Quick Start - 3 Minutes to AI-Controlled Napari¶
Get napari working with AI assistance in just 3 minutes using our automated CLI installer.
What You'll Accomplish
By the end of this guide:
- ✅ napari-mcp installed and configured
- ✅ Your AI application automatically launches the server
- ✅ Full control over a live napari viewer
- ✅ Ready to load images and analyze data
Step 1: Install the Package (30 seconds)¶
This installs:
- The napari MCP server
- CLI installer tool (napari-mcp-install
)
- All required dependencies
Step 2: Auto-Configure Your Application (1 minute)¶
The CLI installer automatically configures your AI application with the correct settings.
For Claude Desktop¶
For Other Applications¶
# Claude Code CLI
napari-mcp-install claude-code
# Cursor IDE
napari-mcp-install cursor
# Cline in VS Code
napari-mcp-install cline-vscode
# See all options
napari-mcp-install --help
What the Installer Does
- Detects your application's config file location
- Adds napari-mcp server configuration
- Creates a backup of existing config
- Validates Python environment
- Shows you exactly what changed
Installer Options¶
# Preview changes without applying
napari-mcp-install claude-desktop --dry-run
# Use your Python environment instead of uv
napari-mcp-install claude-desktop --persistent
# Install for all supported applications at once
napari-mcp-install all
Step 3: Restart & Test (30 seconds)¶
- Restart your AI application (completely quit and reopen)
- Test the connection by asking your AI:
Test Commands
Expected response: Information about your napari viewer including system details, viewer state, and available features.
🎉 Success! What's Next?¶
If the tests above work, you're ready to explore. Here are some immediate things to try:
Basic Operations¶
Advanced Features¶
📚 Learning More¶
- User Guide - Learn common workflows and best practices
- API Reference - Complete documentation of all available tools
- Integrations - Application-specific guides
⚙️ Advanced Configuration¶
Manual Configuration (Optional)¶
If you prefer to configure manually or need custom settings, the CLI installer creates this JSON:
{
"mcpServers": {
"napari-mcp": {
"command": "uv",
"args": ["run", "--with", "napari-mcp", "napari-mcp"]
}
}
}
Config file locations:
- Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
- Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
- Claude Desktop (Linux): ~/.config/Claude/claude_desktop_config.json
- Claude Code: ~/.claude.json
- Cursor: ~/.cursor/mcp.json
or .cursor/mcp.json
(project-specific)
→ See Installation Guide for all config locations and formats
Using Your Python Environment¶
If you want to use an existing Python environment instead of uv:
# Install in your environment first
pip install napari-mcp
# Configure to use your Python
napari-mcp-install claude-desktop --persistent
This will use your Python interpreter directly: python -m napari_mcp.server
External Viewer Mode (Plugin Bridge)¶
Prefer controlling an existing napari window?
- Open napari → Plugins → MCP Server Control
- Click Start Server (default port 9999)
- Use the same CLI installer command (it will auto-detect and proxy to the external viewer)
❌ Common Issues¶
napari-mcp-install: command not found
Solution: The package wasn't installed correctly.
AI can't see napari tools
Solutions:
- Restart your AI application completely
- Check config was created:
napari-mcp-install list
- Run with
--dry-run
to see what would be configured - Check for error messages in the application's logs
Napari window doesn't appear
Solutions:
- On remote systems: May need X11 forwarding or use offscreen mode
- Check Qt installation:
python -c "from PyQt6.QtWidgets import QApplication; print('OK')"
- Try setting:
export QT_QPA_PLATFORM=offscreen
for headless mode
Permission errors
Solution:
🛠️ Management Commands¶
# List all installations
napari-mcp-install list
# Uninstall from an application
napari-mcp-install uninstall claude-desktop
# Uninstall from all applications
napari-mcp-install uninstall all
🆘 Still Need Help?¶
- Troubleshooting Guide - Comprehensive problem solving
- GitHub Issues - Report bugs or ask questions
- Installation Guide - More detailed setup instructions
Congratulations! 🎊 You now have AI-controlled napari up and running. Time to explore the amazing possibilities of combining AI assistance with powerful microscopy analysis tools!