by gradusnikov
Eclipse IDE as an MCP Server for AI Agents
# Add to your Claude Code skills
git clone https://github.com/gradusnikov/eclipse-chatgpt-pluginAssistAI is an Eclipse IDE plugin that exposes your entire development environment as an MCP (Model Context Protocol) server. External AI agents — Claude Code, OpenAI Codex, Claude Desktop, or any MCP-compatible client — can read, navigate, edit, build, test, run, and debug your Java projects directly through Eclipse, preserving workspace sync, local history, and incremental compilation.
AssistAI also includes a built-in LLM chat view for quick inline interactions with any supported model.
When AI agents edit files through the filesystem directly, Eclipse doesn't know anything changed. Editors show stale content, incremental compilation misses updates, and local history gaps appear.
AssistAI solves this by routing all operations through Eclipse APIs:
No comments yet. Be the first to share your thoughts!
localhost:8124The status panel shows all available endpoints:
http://localhost:8124/mcp/eclipse-ide — code analysis, navigation, search, testing, buildshttp://localhost:8124/mcp/eclipse-coder — file editing, refactoring, patching, formattinghttp://localhost:8124/mcp/eclipse-runner — launch, debug, breakpoints, steppinghttp://localhost:8124/mcp/eclipse-context — resource cache, file local history, version trackingAdd to your Claude Code MCP settings (.claude/settings.json or project-level):
{
"mcpServers": {
"eclipse-ide": {
"command": "npx",
"args": [
"-y", "mcp-remote", "http://localhost:8124/mcp/eclipse-ide",
"--allow-http",
"--header", "Authorization: Bearer YOUR_TOKEN"
]
},
"eclipse-coder": {
"command": "npx",
"args": [
"-y", "mcp-remote", "http://localhost:8124/mcp/eclipse-coder",
"--allow-http",
"--header", "Authorization: Bearer YOUR_TOKEN"
]
},
"eclipse-runner": {
"command": "npx",
"args": [
"-y", "mcp-remote", "http://localhost:8124/mcp/eclipse-runner",
"--allow-http",
"--header", "Authorization: Bearer YOUR_TOKEN"
]
}
}
}
On Windows with WSL, use
"command": "wsl"and prepend"npx"to the args array.
Add to your Claude Desktop configuration file:
%APPDATA%\Roaming\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonUse the same mcpServers format as above.
Any client that supports MCP over Streamable HTTP can connect directly to the endpoint URLs. Use the Authorization: Bearer <token> header for authentication.
With the MCP tools, an external agent can:
External agents don't know what you're looking at in Eclipse — unless they ask. AssistAI provides MCP tools that let agents pick up context from your IDE session, so you can guide their work by simply opening files, selecting code, or running programs:
| What you do in Eclipse | Tool the agent calls | What the agent sees |
|------------------------|---------------------|---------------------|
| Open a file in the editor | getCurrentlyOpenedFile | Full file content with path, project name, and line numbers |
| Select a code region | getEditorSelection | Selected text with start/end line numbers and surrounding file context |
| Run or debug a program | getConsoleOutput | Recent stdout/stderr from Eclipse console(s) |
| Have compilation errors | getCompilationErrors | All errors/warnings with file, line, and message |
| Open a specific class | getClassOutline | Compact structure — fields, method signatures, line numbers |
Workflow tip: When asking an agent to fix something, open the relevant file in Eclipse first, select the problem area, and tell the agent to check your selection. This gives the agent precise context without you having to describe file paths or paste code.
Token-efficient navigation: Instead of reading entire files, agents can use getClassOutline to see the structure (~30 lines for a 500-line class), then getMethodSource to read only the methods they need, or getFilteredSource to see the full file with irrelevant methods collapsed to one-line signatures. The readProjectResource tool supports excludeImports to further reduce token usage.
Resource cache: Files and classes read through Eclipse MCP tools are automatically cached with version tracking and file modification timestamps (tied to Eclipse's Local History). Agents can call listCachedResources to see what's already loaded, or getCachedResource to re-read cached content instantly — no disk I/O, no re-parsing.
Local History: Eclipse automatically maintains a Local History for every file modified through the IDE. Agents can browse past versions (getFileHistory), read historical content (getFileHistoryContent), compare with the current version (compareWithHistory), or restore to any previous state (restoreFileVersion). This is more powerful than a simple undo — it preserves every edit across the entire session, including changes made by the agent itself.
| Tool | Description | |------|-------------| | createFile | Creates a new file, adds it to the project, and opens it in the editor | | insertIntoFile | Inserts content at a specific position in an existing file | | replaceString | Replaces a specific string in a file, optionally within a line range | | applyPatch | Applies a unified diff patch with fuzzy context matching — preferred for multi-hunk edits | | formatFile | Formats a Java file using Eclipse's code formatter | | undoEdit | Restores a file from its backup (undo last edit) | | createDirectories | Creates a directory structure recursively | | renameFile | Renames a file in a project | | deleteFile | Deletes a file from a project | | replaceFileContent | Replaces the entire content of a file | | deleteLinesInFile | Deletes a range of lines (1-based indexing) | | refactorRenameJavaType | Renames a Java type using Eclipse's refactoring, updating all references | | refactorMoveJavaType | Moves a Java type to a different package, updating all references | | refactorRenamePackage | Renames a package, updating all declarations and references | | moveResource | Moves a file or folder to a different location | | organizeImports | Organizes imports in a Java file (Ctrl+Shift+O equivalent) | | organizeImportsInPackage | Organizes imports in all Java files within a package |
| Tool | Description |
|------|-------------|
| getSource | Full source of a class |
| getClassOutline | Compact class outline — declarations and method signatures (no bodies) with line numbers |
| getMethodSource | Source of specific methods by name, with overload disambiguation |
| getFilteredSource | Full source with non-selected methods collapsed to signatures |
| readProjectResource | Read a text resource, with optional import block collapsing |
| getJavaDoc | JavaDoc for a compilation unit |
| formatCode | Format code using Eclipse formatter settings |
| getProjectProperties | Project properties and configuration |
| getProjectLayout | File/folder structure with scopePath and maxDepth support |
| listProjects | All workspace projects with detected natures |
| listMavenProjects | All Maven projects in the workspace |
| getCurrentlyOpenedFile | Currently active file in the editor |
| getEditorSelection | Selected text or lines in the active editor |
| getConsoleOutput | Recent Eclipse console output |
| getMethodCallHierarchy | Call hierarchy (callers) for a method |
| getTypeHierarchy | Type hierarchy (supertypes, interfaces, subtypes) |