nx-console icon indicating copy to clipboard operation
nx-console copied to clipboard

[Webstorm] various issues

Open aqeelat opened this issue 3 months ago • 6 comments

Current Behavior

I installed the mcp server in webstorm and:

  1. it launched 2 processes
  2. with high memory usage
  3. closing WebStorm did not terminate these processes.

I don't know how I can provide more data

##Expected Behavior

For the MCP server to run without issues.

Steps to Reproduce

  1. click on the "install mcp server" notification inside the ide

Logs (Required)

I added #dev.nx.console:trace but I couldn't find any logs higher than INFO, anything about the mcp itself.

Environment

  • Nx Console version: 1.54.0
  • IDE version (VS Code/IntelliJ/WebStorm/etc): WebStorm 2025.2.5 (252.28238.10)
  • Operating System (Windows/macOS/Linux): MacOS 15.7.1
  • Node.js version: 24.5.0

Nx Report:

Node           : 24.5.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 10.22.0

nx                     : 22.1.1
@nx/js                 : 22.1.1
@nx/jest               : 22.1.1
@nx/eslint             : 22.1.1
@nx/workspace          : 22.1.1
@nx/angular            : 22.1.1
@nx/cypress            : 22.1.1
@nx/devkit             : 22.1.1
@nx/module-federation  : 22.1.1
@nx/rspack             : 22.1.1
@nx/storybook          : 22.1.1
@nx/web                : 22.1.1
@nx/webpack            : 22.1.1
typescript             : 5.8.3
---------------------------------------
Community plugins:
@compodoc/compodoc : 1.1.32
@storybook/angular : 10.0.8
angular-eslint     : 20.6.0
---------------------------------------
Cache Usage: 45.49 MB / 92.64 GB

I don't know how I can provide any more info. Should I run the mcp server directly (outside of the ide) and copy the logs?

aqeelat avatar Dec 03 '25 09:12 aqeelat

Oh I actually found that webstorm writes the mcp logs to file.

This is what it has for today:

2025-12-03 11:55:48,778 INFO - Server started
2025-12-03 11:55:48,796 CLIENT - {"id":2,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-03 11:55:48,798 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-03 12:00:23,886 INFO - Server started

nx-mcp.log nx-mcp-1.log

aqeelat avatar Dec 03 '25 09:12 aqeelat

Thanks for the logs! Those make it possible to actually debug what's happening here. It looks like the native file watcher is used in the MCP, which should never be the case. What version of the nx mcp are you using?

MaxKless avatar Dec 03 '25 15:12 MaxKless

I think you're definitely running an outdated version of the nx mcp. Do you have it installed to your workspace with a fixed version? Or maybe an older version in your npx cache?

MaxKless avatar Dec 03 '25 15:12 MaxKless

I am having this same issue. I was about to file a similar bug the other day but waited to try to reproduce it. Here's the bug template I filled out:

Bug Info

Current Behavior

When working in a large monorepo in WebStorm, whenever I open the AI Chat window, nx-mcp starts up. The process takes up >1GB of memory and starts using 500% CPU on startup, and shortly afterwards jumps up to using 10-20+ GB of memory, sometimes causing my entire machine to lock up.

This sometimes also happens randomly, without me opening the AI Chat window. Usually, it is also preceded by an alert that "WebStorm would like to access data from other apps".

This process also does not exit when WebStorm is exited; I have to kill it from the Activity Monitor.

Expected Behavior

This should not happen.

Steps to Reproduce

Reproduction Repository/Steps:

The repository I'm working in is private, unfortunately. However, all I have to do in order to trigger this is open the AI Chat tool / window within WebStorm while the monorepo repository is open.

Logs (Required)

Log Output:

The log output doesn't contain much of anything helpful (even after enabling nx console debugging.) In the below log, I opened "AI Chat" at 15:35:53, then manually killed the nx-mcp process at 15:36:09.

2025-11-18 15:35:53,554 [  45432]   INFO - #c.i.u.s.JBUIScale - Set user scale factor: 1.1
2025-11-18 15:35:53,558 [  45436]   INFO - #c.i.u.s.JBUIScale - Set user scale factor: 1.0
2025-11-18 15:35:53,596 [  45474]   INFO - #c.i.m.l.c.c.u.c.AIAssistantChatQuotaNotificationViewModel - Notification: null
2025-11-18 15:35:53,636 [  45514]   INFO - #c.i.u.s.JBUIScale - Set user scale factor: 1.1
2025-11-18 15:35:53,637 [  45515]   INFO - #c.i.u.s.JBUIScale - Set user scale factor: 1.0
2025-11-18 15:35:53,713 [  45591]   INFO - #c.i.m.l.e.i.FileBasedEmbeddingIndexer - Started file-based embedding indexing [dcsg-ngx-ecommerce][code:0.1.0, model:0.0.5, server:2.4.166]
2025-11-18 15:35:54,057 [  45935]   INFO - #c.i.m.l.e.i.FileBasedEmbeddingIndexer - Size changes after embedding indexing [dcsg-ngx-ecommerce]: FILES: 4908 -> 4908 (no change), CLASSES: 2286 -> 2286 (no change), SYMBOLS: 6809 -> 6809 (no change), CLASS_BODIES: 0 -> 0 (no change), SYMBOL_BODIES: 0 -> 0 (no change)
2025-11-18 15:35:54,077 [  45955]   INFO - #c.i.m.l.e.i.FileBasedEmbeddingIndexer - Finished file-based embedding indexing [dcsg-ngx-ecommerce] in 358ms
2025-11-18 15:36:03,259 [  55137]   INFO - #c.i.DynamicBundle - Cleanup bundle cache for messages.BookmarkBundle
2025-11-18 15:36:09,445 [  61323] SEVERE - #c.i.o.a.i.CoroutineExceptionHandlerImpl - Unhandled exception in [Kernel@ph3knh1komc5nbebs04s, Rete(failFast=false, commands=capacity=2147483647,data=[onReceive], reteState=kotlinx.coroutines.flow.StateFlowImpl@4fb64261, dbSource=ReteDbSource(reteState=kotlinx.coroutines.flow.StateFlowImpl@4fb64261)), DbSourceContextElement(kernel Kernel@ph3knh1komc5nbebs04s), ComponentManager(ProjectImpl@1942184585), com.intellij.codeWithMe.ClientIdContextElementPrecursor@6bd1556a, CoroutineName(com.intellij.ml.llm.mcp.client.McpClientService$McpProjectClientService), Dispatchers.IO]
java.lang.IllegalStateException: Transport is already closed
	at io.modelcontextprotocol.kotlin.sdk.client.StdioClientTransport.close(StdioClientTransport.kt:104)
	at com.intellij.ml.llm.mcp.client.McpClient$start$2.invokeSuspend(McpClient.kt:108)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
2025-11-18 15:36:09,446 [  61324] SEVERE - #c.i.o.a.i.CoroutineExceptionHandlerImpl - WebStorm 2025.1.1  Build #WS-251.25410.117
2025-11-18 15:36:09,446 [  61324] SEVERE - #c.i.o.a.i.CoroutineExceptionHandlerImpl - JDK: 21.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2025-11-18 15:36:09,446 [  61324] SEVERE - #c.i.o.a.i.CoroutineExceptionHandlerImpl - OS: Mac OS X
2025-11-18 15:36:09,446 [  61324] SEVERE - #c.i.o.a.i.CoroutineExceptionHandlerImpl - Plugin to blame: JetBrains AI Assistant version: 251.26094.80.11
2025-11-18 15:36:09,446 [  61324]   INFO - STDERR - Exception in thread "DefaultDispatcher-worker-71" java.lang.IllegalStateException: Transport is already closed
2025-11-18 15:36:09,446 [  61324]   INFO - STDERR - 	at io.modelcontextprotocol.kotlin.sdk.client.StdioClientTransport.close(StdioClientTransport.kt:104)
2025-11-18 15:36:09,446 [  61324]   INFO - STDERR - 	at com.intellij.ml.llm.mcp.client.McpClient$start$2.invokeSuspend(McpClient.kt:108)
2025-11-18 15:36:09,446 [  61324]   INFO - STDERR - 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
2025-11-18 15:36:09,447 [  61325]   INFO - STDERR - 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [Kernel@ph3knh1komc5nbebs04s, Rete(failFast=false, commands=capacity=2147483647,data=[onReceive], reteState=kotlinx.coroutines.flow.StateFlowImpl@4fb64261, dbSource=ReteDbSource(reteState=kotlinx.coroutines.flow.StateFlowImpl@4fb64261)), DbSourceContextElement(kernel Kernel@ph3knh1komc5nbebs04s), ComponentManager(ProjectImpl@1942184585), com.intellij.codeWithMe.ClientIdContextElementPrecursor@6bd1556a, CoroutineName(com.intellij.ml.llm.mcp.client.McpClientService$McpProjectClientService), StandaloneCoroutine{Cancelling}@27bf17fa, Dispatchers.IO]

Environment

  • Nx Console version: 1.54.0
  • IDE version (VS Code/IntelliJ/WebStorm/etc): WebStorm 2025.2.5
  • Operating System (Windows/macOS/Linux): macOS Sequoia 15.7.1
  • Node.js version: 22.16.0

Nx Report:

Node           : 22.16.0
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.9.3

nx                     : 21.5.3
@nx/js                 : 21.5.3
@nx/jest               : 21.5.3
@nx/eslint             : 21.5.3
@nx/workspace          : 21.5.3
@nx/angular            : 21.5.3
@nx/devkit             : 21.5.3
@nx/eslint-plugin      : 21.5.3
@nx/module-federation  : 21.5.3
@nx/playwright         : 21.5.3
@nx/plugin             : 21.5.3
@nx/rollup             : 21.5.3
@nx/rspack             : 21.5.3
@nx/vite               : 21.5.3
@nx/web                : 21.5.3
@nx/webpack            : 21.5.3
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/playwright/plugin
@nx/eslint/plugin
---------------------------------------
Community plugins:
@analogjs/vite-plugin-angular : 1.19.4
@analogjs/vitest-angular      : 1.19.4
@ng-bootstrap/ng-bootstrap    : 18.0.0
@ngrx/effects                 : 19.0.0
@ngrx/operators               : 19.0.0
@ngrx/router-store            : 19.0.0
@ngrx/signals                 : 19.0.0
@ngrx/store                   : 19.0.0
@ngrx/store-devtools          : 19.0.0
angular-eslint                : 19.8.1
ng-mocks                      : 14.13.5
---------------------------------------
Local workspace plugins:
@dcsg-ngx-ecommerce/workspace-plugin
---------------------------------------
Cache Usage: 370.51 MB / 46.04 GB

How would I check what version of the MCP is installed? What version do you think should be installed to avoid this issue? Running npm list nx-mcp comes up with no results.

w-biggs avatar Dec 04 '25 18:12 w-biggs

I let it happen again and it looks like the startup command is node /Users/USERNAME/.npm/_npx/9c5993e98c3546e3/node_modules/.bin/nx-mcp /Users/USERNAME/Documents/dev/monorepo-directory. The version number at /Users/USERNAME/.npm/_npx/9c5993e98c3546e3/node_modules/nx-mcp/package.json is 0.11.0 which seems like the current version.

My own nx-mcp.log file has very little info:

2025-11-18 14:13:32,452 INFO - Server started
2025-11-18 14:13:32,467 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-11-18 15:55:36,061 INFO - Server started
2025-11-18 15:55:36,068 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-11-18 15:55:53,366 INFO - Server stopped
2025-11-24 14:17:48,852 INFO - Server started
2025-11-24 14:17:48,864 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-11-24 14:18:46,888 INFO - Server stopped
2025-12-01 16:31:12,778 INFO - Server started
2025-12-01 16:31:12,815 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-01 16:59:39,352 INFO - Server started
2025-12-01 16:59:39,364 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-01 17:00:02,321 INFO - Server stopped
2025-12-04 13:29:24,286 INFO - Server started
2025-12-04 13:29:24,317 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-04 13:53:50,219 INFO - Server started
2025-12-04 13:53:50,234 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-04 13:54:04,638 INFO - Server stopped
2025-12-04 14:09:26,823 INFO - Server started
2025-12-04 14:09:26,841 CLIENT - {"id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"sampling":{}},"clientInfo":{"name":"jetbrains-ai-assistant-client","version":"1.0.0"},"_meta":{}},"jsonrpc":"2.0"}
2025-12-04 14:09:41,188 INFO - Server stopped

w-biggs avatar Dec 04 '25 19:12 w-biggs

It seems like this is easiest to reproduce when opening the AI Chat tool but it also seems to happen randomly in the background too. I'm having to constantly keep an eye on Activity Monitor to make sure it doesn't crash my computer, and even then I'm still experiencing a lock-up/crash a couple times a week. If there's anything I can do to help debug this when it happens, let me know!

w-biggs avatar Dec 08 '25 21:12 w-biggs