[BUG] `ide:getDiagnostics` times out if file is not active in Jetbrains IDE
Status Closed — not planned
Maintainer reply ✓ Yes — hackyon-anthropic
Workaround ✓ Mentioned in thread ↓
Activity 15 comments · opened Jul 6, 2025 · closed Feb 6, 2026
💡 Likely answer: A maintainer (hackyon-anthropic, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [X] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.30 (Claude Code)
- Operating System: 6.12.34 1-NixOS
- Terminal: Alacritty
Bug Description
When claude attempts to call the ide:getDiagnostics MCP after connecting with /ide and the file it is requesting information for is not the file, that is the currently selected file, the tool times out with Timeout getting diagnostics.
Steps to Reproduce
- Open a Jetbrains IDE with Claude Code installed
- Connect with
/ide - Ask Claude to get diagnostic information about file xyz
- Watch it time out
- Open file xyz in the IDE and ask Claude again
- Watch it retrieve the information successfully
Expected Behavior
Diagnostics retrieval should not depend on the file being the actively selected file in the IDE.
Actual Behavior
Diagnostics retrieval only works when the file for which the information is being retrieved is open and selected.
15 Comments
Thanks for the report!
Unfortunately, last I checked, there were limitations to the JetBrains IDE API, where the relevant diagnostics can only be retrieved for the visible files. I can take another look to see if they've opened up the API since I last checked (or if there are any other ways around it)!
If its not possible to retrieve the diagnostics, a better error message would be nice. The official Jetbrains MCP has a method for retrieving project wide diagnostics even when the files are not open, but I think the limitations regarding diagnostics only for open files apply there too when attempting to retrieve file specific diagnostics
Interested in this as well, it's pretty unwieldy having to manually open every single file to let claude check the warnings/errors.
Also interested, hope there's a solution to this in the near future.
Solution would be to create a hook. For example (WebStorm on MacOS):
This way it will open a file in your IDE before executing the tool.
Thank you @iSuslov. In my case, when using Linux, I had to adjust the path and add a delay after opening the file:
Maybe this helps someone.
Thanks for that workaround. For Windows (using cmd as the shell), it was more complicated to get it working. In addition to the hook:
I had to add the following to Claude.md:
The first call to the tool opens the file but still times out if the file wasn't already open, but then Claude tries again and it works. A 5s sleep is not enough to make the first call work.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Thanks for the workaround for mcp__ide__getDiagnostics timeout issue
I needed to adapt the workaround for my setup, if it can help !
Add this to your ~/.claude/settings.json :
Key points:
For other IDEs, replace studio64.exe with your IDE's executable:
This works perfectly - the file opens automatically in the IDE before diagnostics are retrieved, eliminating the timeout issue.
I found the real issue and fix.
getDiagnostics was the only tool provided by the old MCP Proxy, no more supported.
Now We should use the built-in MCP Server (https://www.jetbrains.com/help/idea/mcp-server.html) which provides 21 tools. The new equivalent is get_file_problems.
Yea, unfortunately it times out, but it shouldn't block the execution (might delay it slightly). JetBrains only returns diagnostics if the file is active in the editor
We also have support for integrating LSPs using hooks as well, so you could use that to get around limitations of the JetBrains API.
The idea MCP server is bugged too, we wait the 2025.3.2 RC
https://youtrack.jetbrains.com/projects/IJPL/issues/IJPL-222627/AnalysisToolset.getfileproblems-doesnt-see-any-inspections-when-file-is-not-open-in-editor
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.