How to Integrate with JetBrains IDEs Using MCP: Plugins, Proxy Setup, and CI Workflows

You can integrate JetBrains IDEs with the Model Context Protocol (MCP) by installing the jetbrains-debugger-mcp-plugin or jetbrains-index-mcp-plugin, which expose IDE capabilities via a local HTTP server on port 39200, then bridging external access through the mcpProxy tool to enable AI agent connectivity with authentication.

JetBrains IDEs including IntelliJ IDEA, PyCharm, and WebStorm can function as MCP servers through open-source plugins that expose debugging, refactoring, and indexing capabilities as JSON-RPC tools. According to the punkpeye/awesome-mcp-servers registry, this architecture allows AI coding assistants and automation scripts to programmatically control your IDE through standardized protocol interfaces.

Architecture of JetBrains MCP Integration

The integration follows a layered architecture that bridges your local IDE to external MCP clients through three core components.

In-IDE MCP Server

The jetbrains-debugger-mcp-plugin and jetbrains-index-mcp-plugin embed a lightweight MCP server directly inside the IDE process【/cache/repos/github.com/punkpeye/awesome-mcp-servers/main/README.md#L1266-L1267】. These plugins expose tools such as debugger.start, debugger.stop, index.rename, and index.findReferences via a local HTTP endpoint running on 127.0.0.1:39200 by default.

Network Bridge

The mcpProxy project acts as a Go-based bridge that forwards MCP calls from external agents to the in-IDE server【/cache/repos/github.com/punkpeye/awesome-mcp-servers/main/README.md#L1303】. It handles authentication, transport protocols (WebSocket or TCP), and multiplexing for multiple IDE instances.

Optional CI Integration

For continuous integration workflows, the teamcity-mcp server wraps JetBrains TeamCity APIs into MCP tools, enabling agents to trigger builds and fetch logs within the same ecosystem.

Installing and Configuring the JetBrains MCP Plugins

Plugin Installation

Install the plugins directly from the JetBrains Marketplace:

  1. Open your JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.)
  2. Navigate to Settings → Plugins → Marketplace
  3. Search for "MCP" and install either jetbrains-debugger-mcp-plugin or jetbrains-index-mcp-plugin from hechtcarmel
  4. Restart the IDE

Server Configuration

After installation, the plugin automatically starts a local MCP server. Configure the port via Settings → MCP → Port (default is 39200).

The server exposes a manifest describing available tools:

{
  "name": "jetbrains-debugger",
  "tools": [
    {
      "name": "debugger.start",
      "description": "Start a debugging session for the currently selected run configuration",
      "input_schema": { "type": "object", "properties": {} },
      "output_schema": { "type": "object", "properties": { "sessionId": { "type": "string" } } }
    },
    {
      "name": "debugger.stop",
      "description": "Terminate a running debug session",
      "input_schema": { "type": "object", "properties": { "sessionId": { "type": "string" } } },
      "output_schema": { "type": "object", "properties": {} }
    }
  ]
}

Setting Up the mcpProxy Bridge

To expose your local IDE to external MCP clients, deploy the mcpProxy bridge from the official JetBrains repository.

Installation and Startup


# Clone and build the proxy

git clone https://github.com/JetBrains/mcpProxy.git
cd mcpProxy
go build -o mcp-proxy .

# Run with authentication

./mcp-proxy \
  --local-url http://127.0.0.1:39200 \
  --listen :8080 \
  --auth-token my-secret-token

The proxy now listens on http://<host>:8080. All requests must include the header Authorization: Bearer my-secret-token.

Calling JetBrains IDE Tools from MCP Clients

Once the bridge is running, any MCP-compatible client can invoke IDE operations programmatically.

Python Client Example

import requests
import json

MCP_ENDPOINT = "http://my-host:8080"
HEADERS = {"Authorization": "Bearer my-secret-token"}

def call_tool(tool, args):
    payload = {
        "jsonrpc": "2.0",
        "method": tool,
        "params": args,
        "id": 1
    }
    resp = requests.post(MCP_ENDPOINT, headers=HEADERS, json=payload)
    resp.raise_for_status()
    return resp.json()["result"]

# Rename a symbol programmatically

result = call_tool(
    "index.rename",
    {
        "filePath": "/src/main/java/com/example/Foo.java",
        "offset": 123,
        "newName": "Bar"
    }
)
print("Rename succeeded:", result)

Available Tools

  • debugger.start: Launch debugging sessions
  • debugger.stop: Terminate active sessions
  • index.rename: Perform safe refactoring
  • index.findReferences: Locate symbol usage across the codebase

Integrating with TeamCity CI/CD

For automated build pipelines, the teamcity-mcp server exposes TeamCity operations as MCP tools.

Docker Deployment

docker run -d -p 8081:8080 \
  -e TEAMCITY_URL=https://teamcity.mycompany.com \
  -e TEAMCITY_USER=ci_user \
  -e TEAMCITY_PASSWORD=ci_pass \
  daghis/teamcity-mcp

Triggering Builds via MCP


# Trigger a build from the same Python client

result = call_tool(
    "teamcity.startBuild",
    {"buildConfigurationId": "MyProject_Build"}
)
print("Build queued:", result["buildId"])

This enables AI agents to coordinate builds, fetch test results, and query build logs through the same MCP interface used for IDE operations.

Security Considerations

When you integrate with JetBrains IDEs using MCP, always configure authentication tokens via the mcpProxy --auth-token flag to prevent unauthorized access to your development environment. The local IDE server binds to 127.0.0.1 by default, ensuring it is not directly exposed to the network without the proxy layer.

Summary

  • Install JetBrains plugins: Use hechtcarmel's jetbrains-debugger-mcp-plugin or jetbrains-index-mcp-plugin to expose IDE tools via local HTTP on port 39200.
  • Deploy mcpProxy: Bridge local IDE servers to external networks using the JetBrains/mcpProxy Go binary with configurable authentication.
  • Consume via MCP clients: Any MCP-compatible agent can invoke debugger.start, index.rename, and other tools using standard JSON-RPC over HTTP.
  • Extend to CI: Integrate TeamCity builds using the daghis/teamcity-mcp server for end-to-end DevOps automation.

Frequently Asked Questions

Which JetBrains IDEs support MCP integration?

The jetbrains-debugger-mcp-plugin and jetbrains-index-mcp-plugin work across the JetBrains ecosystem including IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, and Rider. Any IDE based on the IntelliJ Platform can host the MCP server component and expose its indexing and debugging capabilities to external agents.

How do I secure the MCP connection to my IDE?

The local MCP server binds to localhost (127.0.0.1:39200) by default, preventing remote access. When exposing to external agents, always run the mcpProxy bridge with the --auth-token flag to require Bearer token authentication on all requests, and consider using TLS termination for production deployments.

Can I use MCP with JetBrains TeamCity for automated builds?

Yes. The teamcity-mcp server wraps TeamCity REST APIs into MCP tools, allowing you to trigger builds, query build statuses, and retrieve logs through the same protocol used for IDE operations. Deploy it via Docker or run it as a standalone service alongside your TeamCity instance to enable AI-driven CI/CD workflows.

What programming operations can AI agents perform via the JetBrains MCP plugins?

AI agents can start and stop debugging sessions, perform safe renaming and refactoring across the codebase, find symbol references, and access the IDE's indexing capabilities. These operations are exposed as JSON-RPC methods defined in the server's manifest, enabling automated code maintenance and AI-assisted debugging.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →