Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

claude-desktop-linux-flake

MCP.Pizza Chef: k3d3

claude-desktop-linux-flake is a Nix flake client designed to run Claude Desktop on Linux systems. It supports the Model Context Protocol (MCP), enabling seamless integration with AI workflows. The client features a convenient Ctrl+Alt+Space popup for quick access and a system tray menu for easy control, optimized for desktop environments like KDE. This unofficial build script requires Nix package manager and handles licensing constraints due to Claude Desktop's proprietary nature. It provides Linux users with a streamlined way to leverage Claude's capabilities within an MCP-enabled environment.

Use This MCP client To

Run Claude Desktop AI client on Linux via Nix flake Integrate Claude Desktop with MCP-enabled workflows Access Claude Desktop quickly using Ctrl+Alt+Space popup Control Claude Desktop from system tray menu on Linux Deploy an unofficial Linux build of Claude Desktop easily

README

THIS IS AN UNOFFICIAL BUILD SCRIPT!

If you run into an issue with this build script, make an issue here. Don't bug Anthropic about it - they already have enough on their plates.

Claude Desktop for Linux (Nix)

Supports MCP! image

Supports the Ctrl+Alt+Space popup! image

Supports the Tray menu! (Screenshot of running on KDE)

image

This is a Nix flake for running Claude Desktop on Linux.

Usage

To run this once, make sure Nix is installed, then run

NIXPKGS_ALLOW_UNFREE=1 nix run github:k3d3/claude-desktop-linux-flake --impure

The "unfree" part is due to the fact that Claude Desktop is not an open source application, and thus, Nix's licensing rules are dictated by the application itself, not the build script used to build the application.

Installation on NixOS with Flakes

Add the following to your flake.nix:

inputs.claude-desktop.url = "github:k3d3/claude-desktop-linux-flake";
inputs.claude-desktop.inputs.nixpkgs.follows = "nixpkgs";
inputs.claude-desktop.inputs.flake-utils.follows = "flake-utils";

And then the following package to your environment.systemPackages or home.packages:

inputs.claude-desktop.packages.${system}.claude-desktop

If you would like to run MCP servers with Claude Desktop on NixOS, use the claude-desktop-with-fhs package. This will allow running MCP servers with calls to npx, uvx, or docker (assuming docker is installed).

inputs.claude-desktop.packages.${system}.claude-desktop-with-fhs

Other distributions

This repository only provides a Nix flake, and does not provide a package for e.g. Ubuntu, Fedora, or Arch Linux.

Other known variants:

If anyone else packages Claude Desktop for other distributions, make an issue or PR and I'll link it here.

How it works

Claude Desktop is an Electron application. That means the majority of the application is inside an app.asar archive, which usually contains minified Javascript, HTML, and CSS, along with images and a few other things.

Despite there being no official Linux Claude Desktop release, the vast majority of the code is completely cross-platform.

With the exception of one library.

claude-native-bindings

image

Node, and by extension Electron, allow you to import natively-compiled objects into the Node runtime as if they were regular modules. These are typically used to extend the functionality in ways Node itself can't do. Only problem, as shown above, is that these objects are only compiled for one OS.

Luckily enough, because it's a loadable Node module, that means you can open it up yourself in node and inspect it - no decompilation or disassembly needed:

image

There are many functions here for getting monitor/window information, as well as for controlling the mouse and keyboard. I'm not sure what exactly these are for - my best guess is something unreleased related to Computer Use, however I'm not a huge fan of this functionality existing in the first place.

As for how to move forward with getting Claude Desktop working on Linux, seeing as how the API surface area of this module is relatively small, it looked fairly easy to just wholesale reimplement it, using stubs for the functionality.

patchy-cnb

The result of that is a library I call patchy-cnb, which uses NAPI-RS to match the original API with stub functions. Turns out, the original module also used NAPI-RS. Neat!

From there, it's just a matter of compiling patchy-cnb, repackaging the app.asar to include the newly built Linux module, and making a new Electron build with these files.

License

The build scripts in this repository, as well as patchy-cnb, are dual-licensed under the terms of the MIT license and the Apache License (Version 2.0).

See LICENSE-MIT and LICENSE-APACHE for details.

The Claude Desktop application, not included in this repository, is likely covered by Anthropic's Consumer Terms.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

claude-desktop-linux-flake FAQ

How do I install claude-desktop-linux-flake?
Ensure Nix is installed, then run `NIXPKGS_ALLOW_UNFREE=1 nix run github:k3d3/claude-desktop-linux-flake --impure` to launch the client.
Is claude-desktop-linux-flake an official Anthropic release?
No, this is an unofficial build script. For issues, file them on the GitHub repository rather than contacting Anthropic.
What desktop environments does claude-desktop-linux-flake support?
It supports Linux desktop environments with system tray functionality, such as KDE, providing tray menu integration.
Does claude-desktop-linux-flake support MCP?
Yes, it fully supports the Model Context Protocol for enhanced AI integration.
Why is the NIXPKGS_ALLOW_UNFREE flag required?
Claude Desktop is proprietary software, so this flag allows Nix to build and run unfree packages as per licensing requirements.
Can I use claude-desktop-linux-flake with other LLM providers?
While designed for Claude, MCP compatibility allows integration with other LLMs like OpenAI and Gemini through the protocol.
How do I report bugs or issues?
Report issues on the GitHub repository where the build script is hosted; avoid contacting Anthropic directly.
Is source code for Claude Desktop included?
No, Claude Desktop is not open source; this flake only automates running the proprietary client on Linux.