MCP HubMCP Hub
JetBrains

mcp-jetbrains

by: JetBrains

A model context protocol server to work with JetBrains IDEs: IntelliJ, PyCharm, WebStorm, etc. Also, works with Android Studio

509created 09/12/2024
Visit
IDE
JetBrains

📌Overview

Purpose: The JetBrains MCP Proxy Server facilitates communication between client applications and JetBrains Integrated Development Environments (IDEs) by proxying requests.

Overview: This framework acts as a server that proxies requests from clients to JetBrains IDEs, enabling seamless integration and interaction with IDE features.

Key Features:

  • Easy Integration with Claude Desktop: Allows for straightforward configuration with the Claude Desktop application, enhancing user experience by simplifying setup through a configuration file.

  • Customizable Configuration: Users can specify individual IDE connection settings such as port and host address, enabling tailored setups for different development environments.


JetBrains MCP Proxy Server

The server proxies requests from client to JetBrains IDE.

Install MCP Server Plugin

https://plugins.jetbrains.com/plugin/26071-mcp-server

Usage with Claude Desktop

To use this with Claude Desktop, add the following to your claude_desktop_config.json.
The full path on MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json, on Windows: %APPDATA%/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "jetbrains": {
      "command": "npx",
      "args": ["-y", "@jetbrains/mcp-proxy"]
    }
  }
}

Configuration

If you're running multiple IDEs with MCP server and want to connect to a specific one, add to the MCP server configuration:

"env": {
  "IDE_PORT": "<port of IDE's built-in webserver>"
}

By default, the connection is to IDE on 127.0.0.1 but you can specify a different address/host:

"env": {
  "HOST": "<host/address of IDE's built-in webserver>"
}

To enable logging add:

"env": {
  "LOG_ENABLED": "true"
}

Troubleshooting

Node.js Version Requirements

Problem: Error message Cannot find module 'node:path'

Solution:
MCP Proxy doesn't work on Node 16. Upgrade your Node.js installation to version 18 or later. Ensure that command in config points to the correct Node.js version. Using the full path to the latest Node.js version might help.

MacOS: Plugin Unable to Detect Node.js Installed via nvm

Problem: MCP Server Plugin might be unable to detect Node.js installed through nvm on MacOS.

Solution: Create a symbolic link in /usr/local/bin pointing to your nvm npx executable:

which npx &>/dev/null && sudo ln -sf "$(which npx)" /usr/local/bin/npx

This command checks if npx exists in your path and creates the necessary symbolic link with proper permissions.

Using MCP with External Clients or Docker Containers (LibreChat, Cline, etc.)

Problem: Requests to endpoints such as http://host.docker.internal:6365/api/mcp/list_tools may return 404 errors or fail to connect when using external clients or Docker containers.

Solution:

  1. Enable External Connections in your JetBrains IDE:
    Enable "Can accept external connections" in Settings | Build, Execution, Deployment | Debugger.

  2. Configure with LAN IP and Port:
    Use your machine's LAN IP address instead of host.docker.internal. Explicitly set the IDE_PORT and HOST in your configuration.

Example configuration for LibreChat or similar external clients:

mcpServers:
  intellij:
    type: stdio
    command: sh
    args:
      - "-c"
      - "IDE_PORT=YOUR_IDEA_PORT HOST=YOUR_IDEA_LAN_IP npx -y @jetbrains/mcp-proxy"

Replace:

  • YOUR_IDEA_PORT with your IDE's debug port (found in IDE settings)
  • YOUR_IDEA_LAN_IP with your computer's local network IP (e.g., 192.168.0.12)

How to Build

  1. Tested on macOS
  2. Install dependencies:
    brew install node pnpm
    
  3. Build the project:
    pnpm build