Skip to content

Servoy/eclipse-chatgpt-plugin

 
 

Repository files navigation

AssistAI - A LLM (ChatGPT) Plugin for Eclipse IDE

AssistAI is an Eclipse IDE plugin that brings a Large Language Model (LLM) assistant (similar to ChatGPT) into your development environment. This an experimental plugin..

Features

  • Refactor selected code snippets with LLM
  • Generate JavaDoc comments for chosen classes or methods with LLM's help
  • Create JUnit tests for selected classes or methods using LLM's assistance
  • Engage in a conversation with LLM about the content of the currently opened file
  • Fix compilation errors with LLM's guidance
  • Copy code blocks generated by LLM to the clipboard
  • Produce Git commit comments based on changes in staged files
  • Customize pre-defined prompts
  • Using the built in tools (MPC) AssistAI can:
    • use JavaDoc or related source code to better understand the context
    • perform a web search using DuckDuckGo
    • read a content of a web page
  • Create contexts for the LLM that include source files or images
  • Use the vision model to discuss a image content
  • Switch between defined LLMs
  • Added support for interfacing with Model Context Protocol (MPC) servers. The plugin is a MCP Client. You can interface your favorite MCP servers using any of the supported LLMs (not limited to Claude).
  • Now you can give control to LLM to modify your project files, access error logs, console output, and more... use Claude, sit back, vibe, and watch them tokens burn
  • Discuss about math, or tabular data. The chat component now supports latex and table rendering
  • Added tools that AI agents can use to execute and review JUnit tests
  • [NEW] The AssistAI plugin is now a MCP Server accessible via HTTP. This means that you can configure Claude Code or Claude Desktop client to directly interact with your Eclipse IDE via MCP - this way you can let Claude use it's own planning, search tools and system tools, and still maintain the code by Eclipse (history, etc.). It also means that you don't need Claude API keys when using Claude Desktop.
  • [NEW] New cached resource management and smart resource caching - LLM always sees the current version of files that are attached to the context (always up to date, no multiple copies)
  • [NEW] In-text code completion with Alt+/

You can also pose general questions to LLM, just like with the regular AI chatbot interface.

Supported Models

AssistAI supports multiple LLM providers through different API protocols:

Provider Protocol Sample Models MCP / tools Vision Notes
OpenAI OpenAI API gpt-5 Default integration
Anthropic Claude API claude-sonnet-4-5-20250929 Native Claude API integration
Groq OpenAI API qwen-qwq-32b, llama3-70b-8192 Uses OpenAI-compatible API
DeepSeek DeepSeek API deepseek-chat Specialized integration
Google Gemini API gemini-2.5-flash, gemini-3-pro-preview Specialized integration
Grok Grok API grok-4, grok-code-fast Specialized integration
Local/Self-hosted OpenAI API Any local model via Ollama, LM Studio, etc. Varies Varies Configure with OpenAI-compatible endpoint
Other 3rd party OpenAI API Various models from providers like Together.ai, Anyscale, etc. Varies Varies Use OpenAI-compatible settings

To use a local or third-party model, configure it using the OpenAI protocol format in the Models preferences section with the appropriate endpoint URL.

Built-in MCP tools

MCP Server Tool Description
duck-duck-search webSearch Performs a search using a Duck Duck Go search engine and returns the search result json.
eclipse-coder createFile Creates a new file in the specified project, adds it to the project, and opens it in the editor.
eclipse-coder insertIntoFile Inserts content at a specific position in an existing file.
eclipse-coder replaceString Replaces a specific string in a file with a new string, optionally within a specified line range.
eclipse-coder undoEdit Undoes the last edit operation by restoring a file from its backup.
eclipse-coder createDirectories Creates a directory structure (recursively) in the specified project.
eclipse-coder renameFile Renames a file in the specified project.
eclipse-coder deleteFile Deletes a file from the specified project.
eclipse-coder replaceFileContent Replaces the entire content of a file with new content.
eclipse-coder deleteLinesInFile Deletes a range of lines in a file, using 1-based line indexing.
eclipse-coder refactorRenameJavaType Renames a Java class/interface/enum using Eclipse's refactoring mechanism, updating the type name, file name, and all references throughout the workspace.
eclipse-coder refactorMoveJavaType Moves a Java class/interface/enum to a different package using Eclipse's refactoring mechanism, updating the package declaration and all references.
eclipse-coder refactorRenamePackage Renames a Java package using Eclipse's refactoring mechanism, updating all package declarations and references throughout the workspace.
eclipse-coder moveResource Moves a file or folder to a different location within the project.
eclipse-coder organizeImports Organizes imports in a Java file (removes unused, adds missing, sorts). Equivalent to Ctrl+Shift+O.
eclipse-coder organizeImportsInPackage Organizes imports in all Java files within a package.
eclipse-ide formatCode Formats code according to the current Eclipse formatter settings.
eclipse-ide getJavaDoc Get the JavaDoc for the given compilation unit.
eclipse-ide getSource Get the source for the given class.
eclipse-ide getProjectProperties Retrieves the properties and configuration of a specified project.
eclipse-ide getProjectLayout Get the file and folder structure of a specified project in a hierarchical format.
eclipse-ide getMethodCallHierarchy Retrieves the call hierarchy (callers) for a specified method.
eclipse-ide getCompilationErrors Retrieves compilation errors and problems from the workspace or a project.
eclipse-ide readProjectResource Read the content of a text resource from a specified project.
eclipse-ide listProjects List all available projects in the workspace with their detected natures.
eclipse-ide getCurrentlyOpenedFile Gets information about the currently active file in the Eclipse editor.
eclipse-ide getEditorSelection Gets the currently selected text or lines in the active editor.
eclipse-ide getConsoleOutput Retrieves the recent output from Eclipse console(s).
eclipse-ide runAllTests Runs all tests in a specified project and returns the results.
eclipse-ide runPackageTests Runs tests in a specific package and returns the results.
eclipse-ide runClassTests Runs tests for a specific class and returns the results.
eclipse-ide runTestMethod Runs a specific test method and returns the results.
eclipse-ide findTestClasses Finds all test classes in a project.
eclipse-ide runMavenBuild Runs a Maven build with the specified goals on a project.
eclipse-ide getEffectivePom Gets the effective POM for a Maven project.
eclipse-ide listMavenProjects Lists all available Maven projects in the workspace.
eclipse-ide getProjectDependencies Gets Maven project dependencies.
eclipse-ide fileSearch Searches for a plain substring in workspace files using Eclipse's text search engine.
eclipse-ide fileSearchRegExp Searches workspace files using a Java regular expression via Eclipse's text search engine.
eclipse-ide findFiles Finds workspace files matching the given glob patterns.
eclipse-ide searchAndReplace Search and replace across multiple files in the workspace using Eclipse's text search engine.
memory think Use this tool to think about something without obtaining new information or performing changes.
webpage-reader readWebPage Reads the content of the given web site and returns its content as a markdown text.
time currentTime Returns the current date and time in the following format: yyyy-MM-dd HH:mm:ss
time convertTimeZone Converts time from one time zone to another.

Context

The plugin leverages the OpenAI API to send predefined prompts to the LLM. These prompts include relevant context from your IDE, such as:

  • File name
  • Content of the opened file
  • Selected class or method name

If you're not satisfied with the results, you can ask follow-up questions to LLM. Your inquiries, along with the complete conversation history, will be sent to LLM, ensuring more precise answers.

Use the "Clear" button to reset the conversation context. Press the "Stop" button to halt LLM's response generation.

Current LLM context resources are accessible with the View > AssistAI > AI Resources

Smart Resource Caching

AssistAI remembers the files you've asked it to look at during a conversation. When you ask LLM to read the same file multiple times (for example, while iterating on code changes), it automatically keeps only the latest version—so LLM always sees your current code, not outdated copies. The plugin also detects when you edit files in Eclipse and refreshes its cache automatically. This means faster responses, lower token usage, and no confusion from LLM seeing old versions of your code mixed with new ones. Just remember save the file!

Usage Examples

  1. Vibe-coding ;)

    Eclipse Coder

  2. Learn new things

    Math rendering
  3. To discuss the class you're working on, select "Discuss" from the "Code Assist AI" context menu and ask any question about the code.

Discuss with ChatGPT

  1. To refactor a code snippet, select it and choose "Refactor" from the "Code Assist AI" context menu.

Refactor with ChatGPT

  1. You can also ask ChatGPT to document a selected class or method using the "Document" command:

Document with ChatGPT

  1. Additionally, you can request ChatGPT to generate a JUnit test:

JUnit Test Generation

  1. After staging all modified files, ask ChatGPT to create a Git commit message:

Git Commit Message Generation

  1. If you have errors in your code, ChatGPT can generate a patch to solve your issues. Select "Fix Errors" command, copy patch contents using the "Copy Code" button, and paste it to your project with CTRL+v, or you can use "Apply Patch" button that will open the patch import window.

    The "Apply Patch" button is active whenever ChatGPT returns a diff code block. When interacting with ChatGPT (i.e. performing a code review) you can ask it to format its answers this way using a following prompt: "Return your answer in diff format using full paths".

Git Commit Message Generation

  1. AssistAI can use function calls to get the related source code or JavaDoc to better understand the problem and provide you with a more accurate solution.

Function calling

  1. Using the context menu Paste an image from a Cliboard or drag-and-drop an image file to discuss it with the ChatGPT.

Vision

  1. Configure and use MPC servers. Fill in MCP server details: name, command (CLI), enviromnent variables, and allow the LLM to use external tools. MPC

Installation

Plugin Installation

The easiest way to install the plugin is to use the Eclipse Marketplace. Just drag the "Install" button below into your running Eclipse workspace.

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

Alternatively you can configure an update site:

  1. In Eclipse IDE, open Help > Install new software
  2. Click the Add button to open the "add repository" window, and input AssistAI as Name and https://gradusnikov.github.io/eclipse-chatgpt-plugin/ as Location
  3. Click Add
  4. Back in Install window, choose AssistAI from the Work with: list
  5. Select "Assist AI" from the plugin list and proceed to the next step by clicking the Next button
  6. Accept any certificate warnings (note: this is a self-signed plugin, so you will be warned about potential security risks)

Configuration

After installing the plugin, configure access to the OpenAI API:

  1. Open Window > Preferences > Assist AI preferences

  2. Configure your models Window > Preferences > Assist AI preferences > Models

  3. Select the model you want to use from a dropdown list: Window > Preferences > Assist AI preferences. You can switch between the defined models here.

Configuring MCP Servers

MCP servers provide LLMs with tools to interact with files, databases, and APIs. These tools can transform this plugin into an alternative to Cursor or MANUS. Several built-in MCP servers exist, such as DuckDuckGo search, web fetching, or Eclipse integrations, but you can easily add any MCP server that provides a stdio interface.

Adding the Filesystem MCP Server

To enable the filesystem MCP (e.g., filesystem), which allows LLMs to read or modify files, follow these steps:

  1. Open the Preferences
    Navigate to Window > Preferences > Assist AI > MCP Servers and click Add.

  2. Configure the Server
    Fill in the configuration details:

    Name: server-filesystem  
    Command: wsl.exe npx -y @modelcontextprotocol/server-filesystem ${workspace_loc}  
    
  3. Optional Environment Variables
    Define environment variables if required (e.g., API keys).

Notes

  • The ${workspace_loc} variable specifies the workspace folder accessible to the MCP. When using WSL, this path is automatically converted to a Unix-style path for compatibility. Other eclipse variables are available (${project_loc}, etc.)
  • Security Warning: Use MCP servers cautiously, as they grant LLMs access to read or modify sensitive data in your project directory, which could be accidentally altered or deleted by the LLM.

HTTP MCP Server - Exposing Eclipse Tools to External Clients

AssistAI now supports exposing its internal MCP servers (eclipse-ide, eclipse-coder, etc.) as HTTP endpoints. This allows external AI clients like Claude Desktop, Cursor, or any other MCP-compatible application to use Eclipse IDE capabilities remotely.

Enabling the HTTP MCP Server

  1. Open the Preferences
    Navigate to Window > Preferences > Assist AI > HTTP MCP Server.

  2. Configure the Server

    • Check Enable HTTP MCP Server
    • Set Hostname (default: localhost)
    • Set Port (default: 8124)
    • Click Generate to create a new authentication token, or use an existing one
    • Click Apply to start the server
  3. Verify Server Status
    The Server Status section will show "HTTP Server is running" when active.

  4. View Enabled Endpoints
    The Enabled Endpoints section displays all available MCP servers exposed via HTTP:

    • http://localhost:8124/mcp/eclipse-ide
    • http://localhost:8124/mcp/eclipse-coder
    • http://localhost:8124/mcp/duck-duck-search
    • http://localhost:8124/mcp/webpage-reader
    • http://localhost:8124/mcp/time
    • http://localhost:8124/mcp/memory

Integrating with Claude Desktop

To connect Claude Desktop to your Eclipse HTTP MCP Server:

  1. Locate Claude Configuration File
    Open the Claude Desktop configuration file:

    • Windows: %APPDATA%\Roaming\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add MCP Server Configuration
    Add entries for each Eclipse MCP server you want to use:

    {
      "mcpServers": {
        "eclipse-ide": {
          "command": "wsl",
          "args": [
            "npx", "-y", "mcp-remote", "http://172.24.208.1:8124/mcp/eclipse-ide", "--allow-http"
          ]
        },
        "eclipse-coder": {
          "command": "wsl",
          "args": [
            "npx", "-y", "mcp-remote", "http://172.24.208.1:8124/mcp/eclipse-coder", "--allow-http"
          ]
        }
      }
    }

    Notes:

    • Replace 172.24.208.1:8124 with your actual hostname and port
    • Use wsl command on Windows to run npx through WSL
    • On macOS/Linux, use "command": "npx" directly
    • The --allow-http flag is required for non-HTTPS connections
    • Add authentication header if using auth token (see below)
  3. Using Authentication Token
    If you configured an authentication token in Eclipse, add it to the args:

    {
      "mcpServers": {
        "eclipse-coder": {
          "command": "wsl",
          "args": [
            "npx", "-y", "mcp-remote", "http://172.24.208.1:8124/mcp/eclipse-coder", 
            "--allow-http",
            "--header", "Authorization: Bearer de34508b-e69b-4d93-8910-470c61c9f098"
          ]
        }
      }
    }
  4. Restart Claude Desktop
    Close and reopen Claude Desktop for the changes to take effect.

Use Cases

With HTTP MCP Server enabled, external AI clients can:

  • Read and modify Eclipse project files using eclipse-coder tools
  • Access project structure and properties using eclipse-ide tools
  • Run and analyze JUnit tests in your Eclipse workspace
  • Read compilation errors and get context about your code
  • Format code according to Eclipse formatter settings
  • Access JavaDoc and source code for better context understanding

This feature enables powerful AI-assisted development workflows where Claude or other AI assistants can directly interact with your Eclipse IDE environment.

Security Considerations

  • Local Network Only: By default, the server binds to localhost. Only expose to external networks if necessary.
  • Authentication Token: Always use an authentication token when exposing the server beyond localhost.
  • Firewall Rules: Ensure your firewall allows connections only from trusted sources.
  • HTTPS: Consider using a reverse proxy with HTTPS for production use.
  • Access Control: The AI client will have full access to all tools exposed by the enabled MCP servers.

Add ChatGPT View

Add the ChatGPT View to your IDE:

  1. Open Window > Show View > Other
  2. Select ChatGPT View from the Code Assist AI category

About

An Eclipse plugin that integrates with ChatGPT

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.1%
  • Other 1.9%