mcp-server-plugin
by: JetBrains
JetBrains MCP Server Plugin
📌Overview
Purpose: The JetBrains MCP Server Plugin aims to facilitate seamless integration between Large Language Models (LLMs) and JetBrains IDEs through a robust server-side solution.
Overview: This plugin enables the handling of Model Context Protocol (MCP) requests in JetBrains IDEs, allowing developers to implement custom tools via an extension point system. The plugin is designed to enhance the IDE's capabilities by leveraging powerful language models.
Key Features:
-
Custom Tool Implementation: Provides an extension point for developers to create and register their own MCP tools using a defined class structure, enabling customization to meet specific project needs.
-
Integration with JetBrains IDEs: Supports popular JetBrains IDEs like IntelliJ IDEA and WebStorm, ensuring a broad application scope within the development environment.
JetBrains MCP Server Plugin
The JetBrains MCP (Model Context Protocol) Server Plugin enables integration between Large Language Models (LLMs) and JetBrains IDEs, providing a server-side implementation for handling MCP requests and allowing for custom tool extensions.
Prerequisites
- JetBrains MCP Proxy
- JetBrains IDE (IntelliJ IDEA, WebStorm, etc.)
Custom Tools Implementation
The plugin supports third-party plugins to implement their own MCP tools. Here's how to do it:
1. Creating a Custom Tool
Create a class that extends AbstractMcpTool
:
class MyCustomTool : AbstractMcpTool<MyArgs>() {
override val name: String = "myCustomTool"
override val description: String = "Description of what your tool does"
override fun handle(project: Project, args: MyArgs): Response {
return Response.ok("Result")
}
}
@Serializable
data class MyArgs(
val param1: String,
val param2: Int
)
2. Registering Your Tool
Add your tool as an extension in your plugin.xml
:
<idea-plugin>
<depends>com.intellij.mcpServer</depends>
<extensions defaultExtensionNs="com.intellij.mcpServer">
<mcpTool implementation="com.example.MyCustomTool"/>
</extensions>
</idea-plugin>
3. Tool Implementation Guidelines
- Use descriptive tool names in lowercase with underscores if necessary.
- Create a data class for the tool's arguments that matches the expected JSON input.
- Use the Response class for:
Response(result)
for successful operationsResponse(error = message)
for errors
- Utilize the Project instance to access IDE services.
How to Publish Update
- Update
settings.gradle.kts
for a new version. - Create a release on GitHub to trigger the publishing task automatically.
Contributing
Contributions are welcome! Feel free to submit a Pull Request.