How to setup claude-code and mcp-nixos on NixOS

Edited 9/21/25 (Removed previous setup guide).


Nothing ever stays the same it seems, especially surrounding using LLM's and NixOS lately.

As of now, I recommend using the claude-code package on stable and the mcp-nixos package on unstable. So much easier than what I was suggesting previously.

Add those in your configuration.nix, declare which version you'd like and rebuild.

Modify your claude config to include:

{
  "mcpServers": {
    "nixos": {
      "command": "uvx",
      "args": ["mcp-nixos"]
    }
  }
}

Read the documentation from either project to get more help.

Links:
- https://mcp-nixos.io