master
md 300 lines 8.03 KB
Rendered Raw
1 # JetBrains IDEs
2
3 Configure JetBrains IDEs to access your Netdata infrastructure through MCP.
4
5 ## Supported IDEs
6
7 - IntelliJ IDEA
8 - PyCharm
9 - WebStorm
10 - PhpStorm
11 - GoLand
12 - DataGrip
13 - Rider
14 - CLion
15 - RubyMine
16
17 ## Transport Support
18
19 JetBrains AI Assistant currently communicates with MCP servers over `stdio` only (https://www.jetbrains.com/help/ai-assistant/mcp.html).
20
21 | Transport | Support | Netdata Version | Notes |
22 |-----------|---------|-----------------|-------|
23 | **stdio** (via `nd-mcp`) | ✅ Fully Supported | v2.6.0+ | Launches bridge as subprocess |
24 | **stdio** (via `npx mcp-remote`) | ✅ Fully Supported | v2.7.2+ | Wrap remote HTTP/SSE in stdio |
25 | **Streamable HTTP / SSE** | ❌ Not Supported | - | Use a stdio launcher |
26 | **WebSocket** | ❌ Not Supported | - | Accessible only through `nd-mcp` |
27
28 > JetBrains documents a “workaround for remote servers” that relies on launching a stdio wrapper. Native HTTP/SSE support is not available yet.
29
30 ## Prerequisites
31
32 1. **JetBrains IDE installed** - Any IDE from the list above
33 2. **AI Assistant plugin** - Install from IDE marketplace
34 3. **Netdata v2.6.0 or later** with MCP support - Prefer a Netdata Parent for full infrastructure visibility.
35 4. **Stdio launcher**:
36 - `nd-mcp` bridge - Required for Netdata versions that only expose WebSocket (v2.6.0–v2.7.1)
37 - `npx mcp-remote@latest` - Optional wrapper that exposes Netdata HTTP/SSE as stdio (useful for v2.7.2+)
38 5. **Netdata MCP API key exported before launching the IDE**:
39 ```bash
40 export ND_MCP_BEARER_TOKEN="$(cat /var/lib/netdata/mcp_dev_preview_api_key)"
41 ```
42 Each Netdata Agent or Parent has its own unique API key for MCP - [Find your Netdata MCP API key](/docs/netdata-ai/mcp/README.md#finding-your-api-key)
43
44 ## Installing AI Assistant
45
46 1. Open your JetBrains IDE
47 2. Go to Settings/Preferences:
48 - **Windows/Linux**: File → Settings → Plugins
49 - **macOS**: IntelliJ IDEA → Preferences → Plugins
50 3. Search for "AI Assistant" in Marketplace
51 4. Install and restart IDE
52
53 ## MCP Configuration
54
55 :::note
56 MCP support in JetBrains IDEs may require additional plugins or configuration. Check the plugin documentation for the latest setup instructions.
57 :::
58
59 ### Netdata Cloud MCP
60
61 Connect to your entire Netdata Cloud infrastructure
62 through a single endpoint — no local Netdata setup
63 or firewall changes needed.
64
65 **Prerequisites:**
66
67 - Netdata Cloud account with a Paid plan
68 - Nodes claimed to Netdata Cloud
69 - API token with `scope:mcp`
70 ([create one](/docs/netdata-cloud/authentication-and-authorization/api-tokens.md))
71
72 Since JetBrains AI Assistant only supports stdio, use `npx mcp-remote` as a bridge:
73
74 **AI Assistant Settings:**
75
76 ```json
77 {
78 "name": "netdata-cloud",
79 "command": "npx",
80 "args": [
81 "mcp-remote@latest",
82 "https://app.netdata.cloud/api/v1/mcp",
83 "--header",
84 "Authorization: Bearer YOUR_NETDATA_CLOUD_API_TOKEN"
85 ]
86 }
87 ```
88
89 Replace `YOUR_NETDATA_CLOUD_API_TOKEN` with your
90 Netdata Cloud API token (must have `scope:mcp`).
91 For more details, see
92 [Netdata Cloud MCP](/docs/netdata-ai/mcp/README.md#netdata-cloud-mcp).
93
94 ### Local Agent or Parent
95
96 The following methods connect directly to a Netdata Agent or Parent on your network.
97
98 #### Method 1: Using nd-mcp Bridge (All Netdata versions v2.6.0+)
99
100 **AI Assistant Settings:**
101
102 1. Go to Settings → Tools → AI Assistant
103 2. Look for MCP or External Tools configuration
104 3. Add Netdata MCP server:
105
106 ```json
107 {
108 "name": "netdata",
109 "command": "/usr/sbin/nd-mcp",
110 "args": [
111 "ws://YOUR_NETDATA_IP:19999/mcp"
112 ]
113 }
114 ```
115
116 **External Tools (if AI Assistant doesn't support MCP directly):**
117
118 1. Go to Settings → Tools → External Tools
119 2. Click "+" to add new tool
120 3. Configure:
121 - **Name**: Netdata MCP
122 - **Program**: `/usr/sbin/nd-mcp`
123 - **Arguments**: `ws://YOUR_NETDATA_IP:19999/mcp`
124
125 #### Method 2: Using npx mcp-remote (Netdata v2.7.2+)
126
127 For detailed options and troubleshooting, see [Using MCP Remote Client](/docs/netdata-ai/mcp/README.md#using-mcp-remote-client). JetBrains still launches this command over stdio; `mcp-remote` converts the remote HTTP/SSE session into the format AI Assistant understands.
128
129 **AI Assistant Settings:**
130
131 ```json
132 {
133 "name": "netdata",
134 "command": "npx",
135 "args": [
136 "mcp-remote@latest",
137 "--http",
138 "http://YOUR_NETDATA_IP:19999/mcp",
139 "--allow-http",
140 "--header",
141 "Authorization: Bearer NETDATA_MCP_API_KEY"
142 ]
143 }
144 ```
145
146 **External Tools:**
147
148 - **Name**: Netdata MCP
149 - **Program**: `npx`
150 - **Arguments**: `mcp-remote@latest --http http://YOUR_NETDATA_IP:19999/mcp --allow-http --header "Authorization: Bearer NETDATA_MCP_API_KEY"`
151
152 Replace in all examples:
153
154 - `/usr/sbin/nd-mcp` - With your [actual nd-mcp path](/docs/netdata-ai/mcp/README.md#finding-the-nd-mcp-bridge) (nd-mcp method only)
155 - `YOUR_NETDATA_IP` - IP address or hostname of your Netdata Agent/Parent
156 - `NETDATA_MCP_API_KEY` - Your [Netdata MCP API key](/docs/netdata-ai/mcp/README.md#finding-your-api-key)
157 - `ND_MCP_BEARER_TOKEN` - Export with your API key before launching the IDE (nd-mcp method only)
158
159 ## Usage in Different IDEs
160
161 ### IntelliJ IDEA (Java/Kotlin)
162
163 Monitor JVM applications:
164
165 ```
166 // Ask AI Assistant about production performance
167 "What's the memory usage of our Java services?"
168 "Show me GC patterns in the last hour"
169 "Are there any thread pool issues?"
170 ```
171
172 ### PyCharm (Python)
173
174 Debug Python applications:
175
176 ```python
177 # Ask: What's the CPU usage when this function runs in production?
178 def process_data():
179 pass
180
181 # Ask: Show me memory patterns for the Python workers
182 ```
183
184 ### WebStorm (JavaScript/TypeScript)
185
186 Monitor Node.js applications:
187
188 ```javascript
189 // Ask: What's the event loop latency?
190 // Ask: Show me API endpoint response times
191 // Ask: Any memory leaks in the Node processes?
192 ```
193
194 ### DataGrip (Databases)
195
196 Analyze database performance:
197
198 ```sql
199 -- Ask: Show me database query latency
200 -- Ask: What's the connection pool usage?
201 -- Ask: Any slow queries in the last hour?
202 ```
203
204 ## IDE-Specific Features
205
206 ### Code Annotations
207
208 Add infrastructure context to your code:
209
210 ```java
211 @NetdataMonitor("cpu.usage > 80%")
212 public void resourceIntensiveMethod() {
213 // AI Assistant can show real-time metrics
214 }
215 ```
216
217 ### Debugging with Metrics
218
219 While debugging:
220
221 1. Set breakpoint
222 2. Ask AI Assistant: "What were the system metrics when this code last ran in production?"
223 3. Get historical context for better debugging
224
225 ### Performance Profiling
226
227 Combine IDE profiler with Netdata metrics:
228
229 - Run profiler in IDE
230 - Ask: "Show me system metrics during the profiling period"
231 - Correlate application and system performance
232
233 ## Best Practices
234
235 ### Development Workflow
236
237 1. Before deploying: "What's the current production load?"
238 2. During testing: "Compare metrics between dev and prod"
239 3. After deployment: "Show me metrics changes after deployment"
240
241 ### Troubleshooting Production Issues
242
243 ```
244 "Show me what happened at 14:32 when the error occurred"
245 "What were the system resources during the last OutOfMemory error?"
246 "Find correlated metrics during the last service degradation"
247 ```
248
249 ### Capacity Planning
250
251 ```
252 "What's the resource usage trend for this service?"
253 "Project memory needs based on current growth"
254 "When will we need to scale based on current patterns?"
255 ```
256
257 ## Plugin Alternatives
258
259 If official MCP support is limited, consider:
260
261 ### MCP Bridge Plugin
262
263 Search marketplace for:
264
265 - "MCP Client"
266 - "Model Context Protocol"
267 - "External AI Tools"
268
269 ### Custom Plugin Development
270
271 Create a simple plugin that bridges JetBrains with Netdata:
272
273 1. Use IDE Plugin SDK
274 2. Implement MCP client
275 3. Add tool window for Netdata metrics
276
277 ## Troubleshooting
278
279 ### AI Assistant Not Connecting
280
281 - Check MCP configuration in settings
282 - Restart IDE after configuration changes
283
284 ### No Netdata Option
285
286 - Ensure latest AI Assistant version
287 - Check for additional MCP plugins
288 - Try External Tools approach
289
290 ### Connection Errors
291
292 - Test Netdata access: `curl http://YOUR_NETDATA_IP:19999/api/v3/info`
293 - Verify bridge path and permissions
294 - Check IDE logs for detailed errors
295
296 ### Limited Functionality
297
298 - Some IDEs may have restricted AI Assistant features
299 - Try different JetBrains IDEs for better support
300 - Consider using Cursor or VS Code for full MCP support