GitHubスター
0
ユーザー評価
未評価
お気に入り
0
閲覧数
12
フォーク
0
イシュー
0
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
- Extension Point Documentation
- Extension Point Docs
- Extension Point Annotations Docs
- Summaries of Platform MCP contributions:
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
- Create or open an Eclipse Plugin Project
- Add plugins
org.eclipse.mcp
andio.modelcontextprotocol
as dependencies to your plugin - 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);
}
}
- Implement the logic for your tool, returning an array of Strings as your result
Declare your tool as an extension in your plugin.xml
- Using the Plugin Manifest Editor, add to your plugin.xml
- Add the 'org.eclipse.mcp.modelContextProtocolServer' extension
- Add the the extension a contributor
- 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
- The infrastructure will handle generation of JSON input and output schema and conversion between JSON and basic Java types.
- Use jackson JSON annotations such as @JsonProperty and @JsonPropertyDescription as necessary
- Register your toolFactory using an org.eclipse.mcp.modelContextProtocolServer extension in your plugin.xml
Future Considerations
- 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.
- Preferences to
- Button to copy Server URL to clip-board
- Button for opening Tool-specific property editors
- For example, set the default Db2 Connection to use when running a SQL query.
- ?Option to customize a Tools name/prompt
- Set of Built-in Tools and Examples, such as
- Access to Problems
- Access to Consoles
- Access to Editors
References
- Model Context Protocol
- java sdk
- spring sdk
- java sdk jar
- quarkus examples
- spring mcp
- MCP Client and Server with the Java MCP SDK and LangChain4j