Serena MCP plugin fails to connect when running from VSCode Snap terminal
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- OS: Ubuntu Linux 6.14.0-37-generic
- VSCode: Snap version 220 (classic confinement)
- Claude Code: 2.1.x (native install)
- Serena: 0.1.4 via uvx
Problem
Serena MCP plugin shows "failed" status when Claude Code is launched from VSCode integrated terminal, but works correctly when launched from native Ubuntu terminal.
Diagnostics performed
- Serena starts correctly when run manually in both terminals:
``bash``
uvx --from git+https://github.com/oraios/serena serena start-mcp-server
- Environment comparison shows VSCode Snap modifies several variables:
XDG_DATA_HOME=/home/user/snap/code/220/.local/shareXDG_DATA_DIRSpoints to snap directories- Various GTK/GIO paths modified
- Attempted fixes (none worked):
- Cleared plugin cache
- Killed orphan Serena processes
- Created wrapper script to reset XDG variables
- Configured Serena as manual MCP instead of plugin
Expected behavior
Serena should connect successfully regardless of which terminal Claude Code is launched from.
Workaround
Running Claude Code from native terminal instead of VSCode integrated terminal.
What Should Happen?
Serena MCP plugin should connect successfully regardless of which terminal Claude Code is launched from (native Ubuntu terminal or VSCode integrated terminal).
Error Messages/Logs
No specific error logs available. The MCP management screen shows:
plugin:serena:serena · ✘ failed
When trying to access 127.0.0.1 (dashboard), browser shows:
ERR_CONNECTION_REFUSED
Steps to Reproduce
- Install VSCode via Snap:
sudo snap install code --classic - Install Claude Code natively
- Install Serena plugin in Claude Code
- Open VSCode and its integrated terminal
- Run
claudefrom VSCode terminal - Check MCP status - Serena shows "failed"
- Close VSCode, open native Ubuntu terminal
- Run
claudefrom native terminal - Check MCP status - Serena shows "connected"
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.29 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗