Claude Desktop Integration¶
Complete setup guide for using napari MCP server with Claude Desktop - the most popular choice for AI-assisted microscopy analysis.
๐ Quick Setup¶
Automated Installation (Recommended)¶
# 1. Install napari-mcp
pip install napari-mcp
# 2. Auto-configure Claude Desktop
napari-mcp-install claude-desktop
# 3. Restart Claude Desktop
That's it! Claude Desktop will now have access to all napari MCP tools.
๐ Configuration Location¶
The installer automatically detects your platform and configures:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
โ๏ธ Installation Options¶
Basic Installation¶
Advanced 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
# Custom Python path
napari-mcp-install claude-desktop --python-path /path/to/python
# Force update without prompts
napari-mcp-install claude-desktop --force
๐งช Testing the Integration¶
After restarting Claude Desktop, test with:
1. Basic Connection Test¶
Expected: Claude returns detailed information about the napari server, viewer state, and available tools.
2. Visual Test¶
Expected: Claude returns a PNG image of the napari window.
3. Interactive Test¶
Expected: Napari window appears with colored image data.
๐ก Example Workflows¶
Basic Image Analysis¶
Multi-dimensional Data¶
Advanced Analysis¶
Execute this code to segment the image:
from skimage import filters
threshold = filters.threshold_otsu(viewer.layers[0].data)
binary = viewer.layers[0].data > threshold
viewer.add_labels(binary.astype(int), name='segmentation')
๐ง Manual Configuration (Optional)¶
If you prefer manual setup, add this to your config file:
{
"mcpServers": {
"napari-mcp": {
"command": "uv",
"args": ["run", "--with", "napari-mcp", "napari-mcp"]
}
}
}
Using Persistent Python Environment¶
If napari-mcp is installed in your Python environment:
Or with a specific Python path:
{
"mcpServers": {
"napari-mcp": {
"command": "/path/to/your/python",
"args": ["-m", "napari_mcp.server"]
}
}
}
๐ ๏ธ Management¶
Check Installation Status¶
Update Configuration¶
Uninstall¶
โ Troubleshooting¶
Claude Can't See napari Tools¶
Tools not appearing
Solutions:
-
Verify configuration exists:
-
Completely restart Claude Desktop:
- Quit Claude Desktop completely (โ+Q on macOS)
-
Reopen Claude Desktop
-
Check config file syntax:
-
Reinstall:
Napari Window Doesn't Appear¶
No napari window
Solutions:
- On remote systems: You may need X11 forwarding or offscreen mode
- Check Qt:
python -c "from PyQt6.QtWidgets import QApplication; print('OK')"
- Try offscreen mode: Set
QT_QPA_PLATFORM=offscreen
in environment
Configuration File Not Found¶
Can't find config file
Solution:
The installer creates the directory and file automatically. If you're doing manual setup:
Permission Errors¶
Permission denied
Solution:
๐ Security Considerations¶
- Claude Desktop runs MCP servers locally with your user permissions
- The server can execute arbitrary Python code when you ask Claude to
- Only use with trusted code and in environments you control
- Never expose the server to untrusted networks
๐ Next Steps¶
- Quick Start Guide - Get started with basic workflows
- API Reference - Explore all available tools
- Troubleshooting - Solve common issues