Serena MCP plugin fails to connect when running from VSCode Snap terminal

Resolved 💬 3 comments Opened Feb 3, 2026 by alexfloripavieira Closed Mar 5, 2026

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

  1. Serena starts correctly when run manually in both terminals:

``bash
uvx --from git+https://github.com/oraios/serena serena start-mcp-server
``

  1. Environment comparison shows VSCode Snap modifies several variables:
  • XDG_DATA_HOME=/home/user/snap/code/220/.local/share
  • XDG_DATA_DIRS points to snap directories
  • Various GTK/GIO paths modified
  1. 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

  1. Install VSCode via Snap: sudo snap install code --classic
  2. Install Claude Code natively
  3. Install Serena plugin in Claude Code
  4. Open VSCode and its integrated terminal
  5. Run claude from VSCode terminal
  6. Check MCP status - Serena shows "failed"
  7. Close VSCode, open native Ubuntu terminal
  8. Run claude from native terminal
  9. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗