mcp-jetbrains

MCP.Pizza Chef: JetBrains

The mcp-jetbrains server acts as a proxy to connect Model Context Protocol clients with JetBrains IDEs such as IntelliJ, PyCharm, WebStorm, and Android Studio. It facilitates real-time, structured communication between LLMs and the IDE environment, enabling advanced AI-assisted development workflows. Installation involves adding the MCP Server plugin to the IDE and configuring clients like Claude Desktop to route requests through this server. It supports connecting to multiple IDE instances by specifying ports, allowing flexible and secure integration tailored to developer setups.

Use This MCP server To

Enable AI-assisted coding in JetBrains IDEs Proxy MCP requests between LLM clients and JetBrains IDEs Integrate real-time code context into LLM workflows Support multiple JetBrains IDE instances with port configuration Enhance developer productivity with AI-powered code suggestions

README

official JetBrains project

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 the specific one, add to the MCP server configuration:

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

By default, we connect 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. Make sure that command in config points to the correct Node.js version. Try to use the full path to the latest version of NodeJS.

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

Problem: On MacOS, if you have Node.js installed through nvm (Node Version Manager), the MCP Server Plugin might be unable to detect your Node.js installation.

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 one-liner 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: When attempting to connect to the JetBrains MCP proxy from external clients, Docker containers, or third-party applications (like LibreChat), requests to endpoints such as http://host.docker.internal:6365/api/mcp/list_tools may return 404 errors or fail to connect. Solution: There are two key issues to address:

  1. Enable External Connections:

In your JetBrains IDE, enable "Can accept external connections" in the Settings | Build, Execution, Deployment | Debugger.

  1. 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. brew install node pnpm
  3. Run pnpm build to build the project

mcp-jetbrains FAQ

How do I install the mcp-jetbrains server plugin?
Install the MCP Server plugin from the JetBrains plugin marketplace at https://plugins.jetbrains.com/plugin/26071-mcp-server.
How do I configure Claude Desktop to use the mcp-jetbrains server?
Add the mcp-jetbrains server configuration to your claude_desktop_config.json with the command 'npx' and args ['-y', '@jetbrains/mcp-proxy'].
Can I connect the mcp-jetbrains server to multiple JetBrains IDE instances?
Yes, by specifying the IDE_PORT environment variable in the MCP server configuration, you can target specific IDE instances.
What IP address does the mcp-jetbrains server connect to by default?
It connects to 127.0.0.1 (localhost) by default, but this can be changed in the configuration.
Is the mcp-jetbrains server compatible with Android Studio?
Yes, it supports Android Studio along with IntelliJ, PyCharm, and WebStorm.
Does the mcp-jetbrains server support secure communication?
The server runs locally and connects via localhost by default, ensuring secure communication within the developer's machine.
Can I use the mcp-jetbrains server with LLMs other than Claude?
Yes, it is compatible with any MCP client and LLM provider supporting MCP, including OpenAI, Claude, and Gemini.
Where can I find the source code for the mcp-jetbrains server?
The source code is available on GitHub under the JetBrains organization at https://github.com/JetBrains.