Skip to content

doctor: detect snap-docker on host and surface the systemd drop-in needed when the deb runs alongside it #457

Closed

Description

@Dumbris

Problem

When the mcpproxy deb is installed on a host with Docker installed via snap (Ubuntu 24.04 default), every upstream MCP server that shells out to docker run fails. The deb's hardened systemd unit fights snap-confine on four orthogonal axes:

Failure Root cause
Sorry, home directories outside of /home needs configuration snap rejects non-/home HOME — packaged unit sets HOME=/var/lib/mcpproxy
cannot create XDG_RUNTIME_DIR folder /run/user/<uid>/snap.docker: permission denied ProtectHome=true masks /run/user/*
snap-confine ... cap_dac_override not found CapabilityBoundingSet=CAP_NET_BIND_SERVICE is too narrow
operation not permitted on SUID exec NoNewPrivileges=true + RestrictSUIDSGID=true + LockPersonality=true block SUID elevation

The fix is host-specific (snap-docker + system-user-service combo), and once you know it, the drop-in is ~10 lines. Discovering it from the error messages is a 30+ minute investigation. Same class of failure already documented for scanners (see internal/security/scanner/docker.go::ClassifyScannerExecFailure).

Proposed fix

Extend mcpproxy doctor with a host-environment check. When all of:

  1. Host has snap docker (docker version output contains snap, OR /snap/bin/docker exists)
  2. mcpproxy is running under systemd as a non-root user whose \$HOME is outside /home/
  3. At least one configured upstream uses docker run / docker-isolation=true

…emit a doctor warning in the Environment section with:

  • The exact /etc/systemd/system/mcpproxy.service.d/snap-docker.conf snippet
  • The three one-time host commands (loginctl enable-linger, snap set system homedirs=/var/lib, systemctl restart snapd && snap restart docker)
  • Pointer to docs

Scope

  • Add detection in cmd/mcpproxy/ (e.g. doctor_env_snapdocker.go) — client-side check (doctor already requires socket-local daemon, same-host).
  • TDD: table-driven unit tests for the detection function.
  • Update doctor pretty output to render an Environment section.

Context

Discovered during a manual-install → deb migration on kubic (Ubuntu 24.04, snap docker 28.4.0, mcpproxy 0.30.0). See also #455 (migration docs) and the auto-update-conffile issue.

Activity

  1. added a commit that references this issue on May 13, 2026
    9b79254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions