Prerequisites
- Cursor IDE installed
- Pylance MCP Server running (local or cloud)
- Active subscription (Hobby, Pro, or Enterprise)
Installation Steps
Authenticate
On first use, Cursor will prompt for authentication:
- Click Sign in with Clerk
- Complete OAuth flow in browser
- Return to Cursor
Configuration Options
Local Deployment
For maximum privacy, run Pylance MCP locally:~/.cursor/mcp_config.json
Cloud Deployment
Connect to hosted Pylance MCP:~/.cursor/mcp_config.json
Usage Examples
Code Completion
Type naturally and pressTab to accept suggestions:
Hover Documentation
Hover over any symbol for instant documentation:Go to Definition
Cmd+Click (Mac) or Ctrl+Click (Windows) on any symbol:
Find References
Right-click → Find All References:Rename Symbol
Right-click → Rename Symbol (F2):
Advanced Features
Workspace Settings
Configure per-workspace settings in.cursor/workspace.json:
.cursor/workspace.json
Keybindings
Customize keyboard shortcuts inkeybindings.json:
keybindings.json
Troubleshooting
Server Not Starting
Server Not Starting
Symptoms: “Failed to start Pylance MCP server”Solutions:
- Check Python is in PATH:
which pythonorwhere python - Verify installation:
python -m pylance_mcp.server --version - Check logs:
~/.cursor/logs/mcp-pylance.log
No Completions
No Completions
Symptoms: No autocomplete suggestions appearSolutions:
- Ensure file is saved (Pylance analyzes saved files)
- Check file encoding (must be UTF-8)
- Restart Cursor:
Cmd+Shift+P→ “Reload Window” - Clear cache: Delete
~/.cursor/cache/pylance/
Slow Performance
Slow Performance
Symptoms: Completions take >2 secondsSolutions:
- Reduce
diagnosticModeto “openFilesOnly” - Exclude large directories in
.cursorignore: - Upgrade subscription tier for higher rate limits
Authentication Errors
Authentication Errors
Symptoms: “Unauthorized” or “Invalid API key”Solutions:
- Log out and log back in:
Cmd+Shift+P→ “MCP: Sign Out” - Check subscription status at https://pylancemcp.dev/dashboard
- Verify API key hasn’t expired
Best Practices
Enable Auto-Save: Pylance analyzes saved files for best results
Use Type Hints: Add type annotations for better completions
Organize Imports: Keep imports at top of file for faster analysis
Configure .cursorignore: Exclude virtual environments and caches
Performance Tips
Optimize Cursor for large Python projects:settings.json