eclipse-mcp

Model Context Protocol Server contributions over extension points

GitHubスター

0

ユーザー評価

未評価

お気に入り

0

閲覧数

11

フォーク

0

イシュー

0

README
Eclipse Plug-In Developer Extension for Model Context Protocol Services

The org.eclipse.mcp.modelContextProtocolServer extension point can be used to declare and instantiate Model Context Protocol (MCP) servers that run within the Eclipse IDE's VM enable interactivity between Eclipse based experiences and LLM-powered Agentic experiences running within or outside of the Eclipse IDE.

It provides a simple mechanism to contribute MCP Tools and Resources to an MCP server running inside Eclipse.

Optional access to the underlying modelcontextprotocol/java-sdk elements are available

Provides a centralized location for users customize Eclipse MCP capabilities and preferences.

The built-in MCP Server makes available a suite MCP resources, templates and tools accessing the Eclipse platform, enabling agents to interact with your Eclipse IDEs workspace files, editors, consoles, problems and tasks.

Documentation
Demonstrations

Update your Eclipse plugin to contribute your own MCP tool and resource controllers to the platform in a few steps

IT also adds a new "Platform MCP" preference page will let users:

  • Enable / Disable Platform MCP Server
  • Set the HTTP Port
  • Copy the URL to clipboard
  • Turn on/off capabilities/activities for different categories of MCP tools, resources and prompts
  • Add custom preference pages under the MCP preference page to toggle your plugin's behavior and contributions

To expose an aspect of your IDE plugin as an MCP tool, do the following:

Getting Started: Lets create an MCP Tool using an Annotated method
  1. Create or open an Eclipse Plugin Project
  2. Add plugins org.eclipse.mcp and io.modelcontextprotocol as dependencies to your plugin
  3. Create a class that implements MCPAnnotatedToolFactory.java
public class MyToolFactory extends MCPAnnotatedToolFactory {

	@Tool (description = "Return the compilation issues for a file")
	public String[] getProblems(
		@ToolArg(description="The full path to the file to return prblems for")	String filePath) {
		
		List<String> result = new ArrayList<String>();
		
		/** Populate results with problems **/

		return result.toArray(String[]::new);
	}
}
  1. Implement the logic for your tool, returning an array of Strings as your result
Declare your tool as an extension in your plugin.xml
  1. Using the Plugin Manifest Editor, add to your plugin.xml
    1. Add the 'org.eclipse.mcp.modelContextProtocolServer' extension
    2. Add the the extension a contributor
    3. Add to the contributor a factory

Example:

  <extension
         point="org.eclipse.mcp.modelContextProtocolServer"
         id="foo.com.my.extension.id"
         name="My MCP Extension">

      <contributor
         activityId="foo.com.my.activity.id">
         <factory class = "foo.com.MyToolFactory"/>
      </contributor>
   </extension>

Thats all that is required. Upon startup, MCP servers will start up and serve content over HTTP for the registered tools. Calls to tools will be delegated to your instances of IMCPTool

  1. The infrastructure will handle generation of JSON input and output schema and conversion between JSON and basic Java types.
  2. Use jackson JSON annotations such as @JsonProperty and @JsonPropertyDescription as necessary
  3. Register your toolFactory using an org.eclipse.mcp.modelContextProtocolServer extension in your plugin.xml
Future Considerations
  1. Mechanism for shell-shared MCP Clients to invoke MCP tools as Java calls rather than HTTP calls, removing the need for HTTP endpoints when consumed internally and hand registration of MCP endpoints into co-installed MCP clients.
  2. Preferences to
    1. Button to copy Server URL to clip-board
    2. Button for opening Tool-specific property editors
      1. For example, set the default Db2 Connection to use when running a SQL query.
    3. ?Option to customize a Tools name/prompt
  3. Set of Built-in Tools and Examples, such as
    1. Access to Problems
    2. Access to Consoles
    3. Access to Editors
References
Examples of Agentic IDE Tooling