# jetbrains/mcp-jetbrains architecture

> Architecture diagram of the GitHub repository jetbrains/mcp-jetbrains, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jetbrains/mcp-jetbrains
- Repository: https://github.com/jetbrains/mcp-jetbrains

## Overview

This small Node.js MCP proxy exposes JetBrains IDE tools to clients over stdio. It discovers and periodically refreshes the IDE endpoint, lists available tools, and forwards tool calls and results. The implementation is concentrated in `src/index.ts`; the README also documents configurable host/port selection and optional logging. The graph reflects the sampled source and documented client workflow, not IDE-side implementation details.

Main entry points: [`src/index.ts`](https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts) (MCP Proxy)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_client(("MCP Client"))
node_proxy["MCP Proxy<br/>[index.ts]"]
node_endpoint["Endpoint Discovery<br/>[index.ts]"]
node_ide["IDE MCP API"]
node_logging["Optional Logging<br/>[index.ts]"]

node_client -->|"stdio requests"| node_proxy
node_proxy -->|"refreshes endpoint"| node_endpoint
node_endpoint -->|"probes tools"| node_ide
node_ide -->|"returns probe response"| node_endpoint
node_proxy -->|"lists tools"| node_ide
node_ide -->|"returns tool list"| node_proxy
node_proxy -->|"forwards tool call"| node_ide
node_ide -->|"returns tool result"| node_proxy
node_proxy -->|"returns MCP response"| node_client
node_proxy -.->|"writes diagnostics"| node_logging

click node_proxy "https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts"
click node_endpoint "https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts"
click node_logging "https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client toneBlue
class node_proxy,node_endpoint,node_logging toneTeal
class node_ide toneMint
```

## Components

### Other components

- **MCP Client**
- [MCP Proxy](https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts): `src/index.ts`
- [Endpoint Discovery](https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts): `src/index.ts`
- **IDE MCP API**
- [Optional Logging](https://github.com/jetbrains/mcp-jetbrains/blob/main/src/index.ts): `src/index.ts`

## Connections

- MCP Client → MCP Proxy: stdio requests
- MCP Proxy → Endpoint Discovery: refreshes endpoint
- Endpoint Discovery → IDE MCP API: probes tools
- IDE MCP API → Endpoint Discovery: returns probe response
- MCP Proxy → IDE MCP API: lists tools
- IDE MCP API → MCP Proxy: returns tool list
- MCP Proxy → IDE MCP API: forwards tool call
- IDE MCP API → MCP Proxy: returns tool result
- MCP Proxy → MCP Client: returns MCP response
- MCP Proxy → Optional Logging: writes diagnostics
