A JetBrains IDE plugin that provides seamless integration with Cursor CLI functionality, inspired by the Claude Code plugin architecture but specifically designed for Cursor CLI integration.
- Open file diffs in the IDE's native diff viewer
- Review and modify proposed changes from Cursor CLI
- Syntax highlighting and side-by-side comparison
- Automatically shares the current IDE selection with Cursor CLI
- Real-time synchronization of cursor position and selected text
- Provides context-aware assistance from Cursor
- Shortcut:
Ctrl+Alt+K
(Windows/Linux) orCmd+Option+K
(Mac) - Insert file references in format:
@File#L1-99
- Interactive file selector with line range specification
- Relative path resolution from project root
- Real-time sharing of IDE diagnostics (errors, warnings)
- Automatic detection and transmission of squiggly underlines
- Integration with IDE's code analysis system
- Main service class managing the plugin lifecycle
- Handles IDE event listeners (selection, file changes, diagnostics)
- Coordinates communication with Cursor CLI via MCP
- Model Context Protocol (MCP) client for communication with Cursor CLI
- Handles JSON-RPC 2.0 protocol implementation
- Supports both HTTP and stdio transport methods
- Asynchronous request/response handling
- CursorDiffAction: Triggers diff viewer for Cursor changes
- FileReferenceAction: Inserts file references with keyboard shortcut
The plugin uses the Model Context Protocol (MCP) to communicate with Cursor CLI:
- Initialization: Establishes connection and capability exchange
- Selection Updates: Notifies Cursor of current IDE selection
- Diagnostics Updates: Shares IDE errors/warnings with Cursor
- Diff Requests: Requests code changes from Cursor CLI
- JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.)
- Cursor CLI installed and running
- Java 17 or later
# Clone and build
git clone <repository-url>
cd CursorCode
./gradlew build
# The plugin JAR will be generated in build/distributions/
- Build the plugin using Gradle
- Go to IDE Settings → Plugins → Install Plugin from Disk
- Select the generated JAR file
- Restart the IDE
- Ensure Cursor CLI is running with MCP server enabled
- Default MCP endpoint:
http://localhost:3000/mcp
- The plugin will automatically attempt to connect on startup
- Right-click on a file in the editor or project tree
- Select "Open Cursor Diff Viewer"
- Review changes in the IDE's diff viewer
- Position cursor where you want to insert a file reference
- Press
Ctrl+Alt+K
(orCmd+Option+K
on Mac) - Select target file and specify line range
- Reference will be inserted in format:
@filename.ext#L1-10
- Simply select text in the editor
- The plugin automatically shares selection with Cursor CLI
- No manual action required
- IDE errors and warnings are automatically shared
- Real-time updates as you type
- No configuration needed
- Kotlin 1.9.22
- IntelliJ Platform SDK 2023.2.5
- Gson 2.10.1 for JSON processing
- Java HTTP Client for MCP communication
- IntelliJ IDEA Community/Ultimate
- PyCharm Professional/Community
- WebStorm
- PhpStorm
- GoLand
- Android Studio
- Other JetBrains IDEs
- JSON-RPC 2.0 compliant
- Supports notifications and requests
- Error handling and timeout management
- Asynchronous operations
src/main/kotlin/com/maplebreak/cursorcode/
├── CursorService.kt # Main plugin service
├── MCPClient.kt # MCP protocol client
├── CursorDiffAction.kt # Diff viewer action
├── FileReferenceAction.kt # File reference shortcuts
└── Data classes for selection context and diagnostics
- Project Service for lifecycle management
- Actions for user interactions
- Event listeners for IDE state changes
- Verify Cursor CLI is running on port 3000
- Check MCP server is enabled in Cursor configuration
- Review IDE logs for connection errors
- Check for conflicting key mappings in IDE settings
- Customize shortcuts in Keymap preferences if needed
- Plugin uses asynchronous communication to avoid blocking
- Minimal performance impact on IDE operations
- Fork the repository
- Create a feature branch
- Implement changes following the existing architecture
- Add tests if applicable
- Submit a pull request
[Specify your license here]
For issues and feature requests, please use the GitHub issue tracker.