servers icon indicating copy to clipboard operation
servers copied to clipboard

Windows: SSH-based MCP servers require PROGRAMDATA environment variable

Open NF1198 opened this issue 2 months ago • 0 comments

Issue

SSH connections fail when MCP servers are launched from Claude Desktop on Windows.

Common Use Case

Running an MCP server on a remote host (Raspberry Pi, home server, NAS, another PC on local network) and connecting to it via SSH from Windows Claude Desktop.

Root Cause

Claude Desktop launches MCP servers with a minimal environment missing PROGRAMDATA, which OpenSSH on Windows requires to locate system SSH configuration files.

Solution

Add PROGRAMDATA to the env configuration:

    {
      "mcpServers": {
        "my-remote-server": {
          "command": "C:\\WINDOWS\\System32\\OpenSSH\\ssh.exe",
          "args": [
            "[email protected]",
            "-o", "StrictHostKeyChecking=accept-new",
            "-i", "C:\\Users\\username\\.ssh\\id_ed25519",
            "/path/to/remote/mcp-server/command"
          ],
          "env": {
            "PROGRAMDATA": "C:\\ProgramData"
          }
        }
      }
    }

Recommendation

  1. Add this to Windows troubleshooting documentation
  2. Consider passing PROGRAMDATA by default for Windows MCP server environments

Environment

  • OS: Windows 11
  • Claude Desktop
  • OpenSSH (Windows built-in)
  • Remote MCP server over SSH on local network

NF1198 avatar Nov 02 '25 12:11 NF1198