{"record":{"id":"530f40b64abef5f8","repo":"langflow-ai/langflow","slug":"unsupported-operating-system-for-claude-configurat","errorCode":null,"errorMessage":"Unsupported operating system for Claude configuration","messagePattern":"Unsupported operating system for Claude configuration","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"src/backend/base/langflow/api/v1/mcp_projects.py","lineNumber":1288,"sourceCode":"                        ]\n                        if user_dirs:\n                            return user_dirs[0] / \"AppData\" / \"Roaming\" / \"Claude\" / \"claude_desktop_config.json\"\n\n                    if not Path(\"/mnt/c\").exists():\n                        msg = \"Windows C: drive not mounted at /mnt/c in WSL\"\n                        raise ValueError(msg)\n\n                    msg = \"Could not find valid Windows user directory in WSL\"\n                    raise ValueError(msg)\n                except (OSError, CalledProcessError) as e:\n                    await logger.awarning(\"Failed to determine Windows user path in WSL: %s\", str(e))\n                    msg = f\"Could not determine Windows Claude config path in WSL: {e!s}\"\n                    raise ValueError(msg) from e\n            # Regular Windows\n            return Path(os.environ[\"APPDATA\"]) / \"Claude\" / \"claude_desktop_config.json\"\n\n        msg = \"Unsupported operating system for Claude configuration\"\n        raise ValueError(msg)\n\n    msg = \"Unsupported client\"\n    raise ValueError(msg)\n\n\ndef remove_server_by_urls(config_data: dict, urls: Sequence[str] | str) -> tuple[dict, list[str]]:\n    \"\"\"Remove any MCP servers that use one of the specified URLs from config data.\n\n    Returns:\n        tuple: (updated_config, list_of_removed_server_names)\n    \"\"\"\n    normalized_urls = _normalize_url_list(urls)\n    if not normalized_urls:\n        return config_data, []\n\n    if \"mcpServers\" not in config_data:\n        return config_data, []\n","sourceCodeStart":1270,"sourceCodeEnd":1306,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/mcp_projects.py#L1270-L1306","documentation":"Raised by get_config_path() in Langflow's MCP projects API when the requested client is 'claude' but the operating system is neither Darwin nor Windows/WSL. The Claude Desktop config path is only implemented for macOS (~/Library/Application Support/Claude), regular Windows (%APPDATA%), and WSL; on any other platform — plain Linux, FreeBSD, etc. — the function refuses with this ValueError because Claude Desktop does not ship for those systems.","triggerScenarios":"Calling get_config_path(\"claude\") on a Linux host where platform.uname().release does not contain 'microsoft' (bare Linux server, Docker container, CI runner) — os_type is 'Linux', is_wsl is False, so neither the Windows/WSL branch nor Darwin matches and the raise at mcp_projects.py:1288 fires.","commonSituations":"Deploying Langflow on a Linux VM/container and expecting the Claude client check/install endpoints to work; developers on Linux desktops testing the MCP client-configuration API with client='claude'; CI pipelines that exercise MCP routes against Linux runners.","solutions":["Use a supported client for Linux environments: get_config_path supports 'cursor' (~/.cursor/mcp.json) and 'windsurf' (~/.codeium/windsurf/mcp_config.json), which work on plain Linux.","If you need Claude Desktop integration, run Langflow (or the config-writing step) on the Windows/macOS host where Claude Desktop is installed, or from WSL so the Windows path resolution applies.","If your environment is WSL but the release string lacks 'microsoft' (rare custom kernels), fix the detection by ensuring you are in a real WSL kernel, or patch is_wsl detection to also check for /proc/sys/fs/binfmt_misc/WSLInterop."],"exampleFix":"# before\npath = await get_config_path(\"claude\")  # raises on plain Linux\n\n# after\nclient = \"cursor\" if platform.system() == \"Linux\" else \"claude\"\npath = await get_config_path(client)","handlingStrategy":"type-guard","validationCode":"import platform\n\ndef claude_client_supported_on_this_os() -> bool:\n    os_type = platform.system()\n    is_wsl = os_type == \"Linux\" and \"microsoft\" in platform.uname().release.lower()\n    return os_type in {\"Darwin\", \"Windows\"} or is_wsl","typeGuard":"SUPPORTED_CLIENTS_BY_OS = {\n    \"Darwin\": {\"cursor\", \"windsurf\", \"claude\"},\n    \"Windows\": {\"cursor\", \"windsurf\", \"claude\"},\n    \"Linux\": {\"cursor\", \"windsurf\"},  # claude only when WSL\n}\n\ndef client_supported(client: str, os_type: str, is_wsl: bool) -> bool:\n    key = \"Windows\" if (os_type == \"Windows\" or is_wsl) else os_type\n    return client.strip().lower() in SUPPORTED_CLIENTS_BY_OS.get(key, set())","tryCatchPattern":"try:\n    path = await get_config_path(client)\nexcept ValueError as e:\n    if \"Unsupported operating system\" in str(e):\n        # pick a Linux-capable client or skip silently\n        path = await get_config_path(\"cursor\")\n    else:\n        raise","preventionTips":["Gate Claude-client options in the UI by platform (hide 'claude' on non-Windows/macOS/WSL hosts)","On Linux deployments, default MCP client management to cursor or windsurf","Catch ValueError from get_config_path and map it to a 400 with the supported-client list instead of a 500"],"tags":["mcp","platform-support","claude-desktop","linux"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}