Cursor IDE Integration¶
Setup guide for using napari MCP server with Cursor - AI-powered coding with full napari control.
๐ Quick Setup¶
# 1. Install napari-mcp
pip install napari-mcp
# 2. Auto-configure Cursor (global)
napari-mcp-install cursor --global
# OR configure for specific project
napari-mcp-install cursor --project /path/to/project
# 3. Restart Cursor
๐ Configuration Location¶
Global Installation (Recommended)¶
- All platforms:
~/.cursor/mcp.json
- Available in all Cursor projects
Project-Specific Installation¶
- Location:
.cursor/mcp.json
in project root - Only available in that specific project
- Useful for project-specific napari configurations
๐ก Why Use Cursor with napari?¶
- AI-Enhanced Coding: Next-level development experience
- Project Awareness: Understands your entire codebase
- Smart Completions: AI suggests napari operations
- Workspace Integration: Seamless file and project handling
- Live Visualization: See analysis results immediately
๐งช Testing¶
After restarting Cursor, test with:
๐ป Development Workflows¶
Image Analysis Projects¶
Interactive Development¶
Documentation & Testing¶
๐ง Configuration Options¶
Global Configuration¶
Best for most users:
Creates: ~/.cursor/mcp.json
Project-Specific Configuration¶
For project-specific setups:
Creates: .cursor/mcp.json
in project directory
Manual Configuration¶
Edit the appropriate config file:
{
"mcpServers": {
"napari-mcp": {
"command": "uv",
"args": ["run", "--with", "napari-mcp", "napari-mcp"]
}
}
}
Using Persistent Environment¶
๐ ๏ธ Management¶
# Check installation status
napari-mcp-install list
# Update global configuration
napari-mcp-install cursor --global --force
# Update project configuration
napari-mcp-install cursor --project . --force
# Uninstall
napari-mcp-install uninstall cursor
โ Troubleshooting¶
Cursor Doesn't See napari Tools¶
Tools not appearing
Solutions:
-
Verify installation:
-
Check which config is being used:
- Global:
~/.cursor/mcp.json
-
Project:
.cursor/mcp.json
-
Restart Cursor completely:
- Quit Cursor (don't just close windows)
-
Reopen Cursor
-
Reinstall:
Project vs Global Confusion¶
Works in some projects but not others
Explanation: Project-specific configs override global configs.
Solution: Choose one approach:
-
Use global for all projects:
-
Use project-specific for this project:
Configuration File Not Found¶
Config file doesn't exist
Solution: The installer creates it automatically. For manual setup:
๐ Security Note¶
- Cursor runs MCP servers locally with your user permissions
- The server can execute Python code when asked
- Project-specific configs are committed to git - be cautious with sensitive settings
๐ Next Steps¶
- Quick Start - Get started quickly
- API Reference - Explore all tools
- Troubleshooting - Solve issues