An Eclipse plugin that provides MCP (Model Context Protocol) server functionality, allowing external clients to interact with Eclipse IDE features programmatically.
This plugin exposes the following Eclipse functionality through MCP tools:
- find_type: Locate Java types by name (similar to "Open Type" - Ctrl+Shift+T)
- find_resource: Locate resources by name (similar to "Open Resource" - Ctrl+Shift+R)
- run_tests: Run JUnit tests for individual files or methods
- get_problems: Read problems (errors/warnings) by project
- source_actions: Execute Eclipse source actions
- Generate getters/setters
- Generate constructors
- Generate toString()
- Generate hashCode() and equals()
- refactor_actions: Execute Eclipse refactoring actions
- Rename
- Extract method
- Extract variable
- Inline
- Move
- maven_goal: Run Maven goals on projects
- maven_update_project: Update Maven project configuration
The plugin consists of:
- MCP Server: JSON-RPC 2.0 compliant server running on configurable port (default: 3627 - EMCP on phone keypad)
- Tool System: Modular tool implementations for each Eclipse feature
- Resource System: Access to workspace projects and files
- Eclipse Integration: Deep integration with Eclipse JDT, Maven (M2E), and debug frameworks
This project uses Eclipse Tycho for building. To build the plugin:
mvn clean installTo build for specific target platform:
mvn clean install -Dtycho.targetPlatform=/path/to/eclipse/installationThe project includes comprehensive unit and integration tests:
# Run all tests
mvn clean test
# Run tests with verbose output
mvn clean test -X
# Run only unit tests (skip integration tests)
mvn clean test -Dtest=*Test- Unit Tests: Test individual classes and components
MCPMessageTest- MCP protocol message handlingMCPErrorTest- MCP error handlingInitializeHandlerTest- Server initializationToolsListHandlerTest- Available tools listing
- Integration Tests: Test complete MCP server functionality
MCPServerTest- Server lifecycle and configuration
- Test Plugin:
com.eclipse.mcp.server.tests- Separate OSGi test bundle
- In Eclipse, go to Help → Install New Software
- Add the update site URL (built in
com.eclipse.mcp.updatesite/target/repository) - Select "MCP (Model Context Protocol)" category
- Install and restart Eclipse
- Copy the built JAR from
com.eclipse.mcp.server/target/to Eclipse'sdropinsfolder - Restart Eclipse
Configure the MCP Server through Eclipse preferences:
- Go to Window → Preferences → MCP Server
- Enable/disable the server
- Configure server port (default: 3627)
- Set auto-start behavior
Once installed and configured, the MCP server will start automatically when Eclipse starts. External MCP clients can connect to the server on the configured port.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_type",
"arguments": {
"typeName": "String",
"caseSensitive": false
}
}
}- Eclipse 2025-03 (4.35.0) or later
- Java 21 or later
- Maven projects require M2E plugin
- Jackson OSGi bundles (typically included in Eclipse IDE packages)
eclipse-mcp/
├── com.eclipse.mcp.server/ # Main plugin bundle
│ ├── src/main/java/
│ │ └── com/eclipse/mcp/server/
│ │ ├── handlers/ # MCP message handlers
│ │ ├── tools/ # Tool implementations
│ │ ├── protocol/ # MCP protocol classes
│ │ ├── startup/ # Eclipse startup integration
│ │ └── preferences/ # Preference pages
│ ├── META-INF/MANIFEST.MF # OSGi bundle manifest
│ ├── plugin.xml # Eclipse plugin configuration
│ └── build.properties # Build configuration
├── com.eclipse.mcp.feature/ # Eclipse feature definition
├── com.eclipse.mcp.updatesite/ # P2 update site
└── pom.xml # Parent Maven POM
- Implement the
Toolinterface incom.eclipse.mcp.server.tools - Register the tool in
ToolsCallHandler - Add tool definition in
ToolsListHandler - Update documentation
The plugin can be tested in development by:
- Running as Eclipse Application from the development environment
- Using a MCP client to connect to port 3627
- Sending MCP requests to test tool functionality
Run the test suite:
mvn clean testThe tests validate:
- MCP protocol message handling
- Tool registration and listing
- Server lifecycle management
- Handler functionality
Eclipse Public License v2.0
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request