
MCP-NixOS
Real-time NixOS, Home Manager, nix-darwin, and Nixvim data so your AI stops hallucinating package and option names.
Add to your client
Copy the config for your MCP client and paste it into its config file.
uvx mcp-nixosPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-nixos": {
"command": "uvx",
"args": [
"mcp-nixos"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Python 3.11+ (when installed via pip/uvx)
- uvx, pip, Nix, or Docker to run the server
- Nix installed locally only for the flake-inputs action (querying local flake dependencies)
About MCP-NixOS
An MCP server providing accurate, real-time information about the Nix ecosystem: NixOS packages (130K+) and options (23K+), Home Manager options (5K+), nix-darwin macOS settings (1K+), Nixvim Neovim options (5K+) via NuschtOS search, FlakeHub flakes (600+), Noogle Nix functions (2K+), the NixOS Wiki, nix.dev documentation, historical package versions with commit hashes via NixHub, binary cache status on cache.nixos.org, and local flake inputs from the Nix store. It exposes only two tools to minimize AI context usage and works without any local Nix installation (except where querying local flake inputs, which requires Nix).
Tools & capabilities (2)
nixUnified query tool: nix(action, query, source, type, channel, limit). Actions include search (packages/options/programs/flakes), info (detailed package/option info), stats (counts and categories), options (browse Home Manager/Darwin options by prefix), channels (list NixOS channels), flake-inputs (explore local flake inputs from the Nix store), and cache (check binary cache status). Sources include nixos, home-manager, darwin, flakes, flakehub, nixvim, noogle, wiki, nix-dev, and nixhub.
nix_versionsPackage version history: nix_versions(package, version, limit). Finds historical versions with nixpkgs commit hashes; output includes package metadata (license, homepage, programs), platform availability per version (Linux/macOS), the nixpkgs commit hash for reproducible builds, and the attribute path for Nix expressions.
When to use it
- Look up real NixOS packages and configuration options instead of letting an AI invent them
- Search Home Manager, nix-darwin, and Nixvim options while writing a Nix configuration
- Find a specific historical package version and its nixpkgs commit hash for reproducible builds
- Check whether a package is already in the binary cache and its download size before building
- Search the NixOS Wiki, nix.dev tutorials, and Noogle function signatures from inside an AI assistant
MCP-NixOS FAQ
Do I need Nix or NixOS installed to use this?
No. It runs anywhere Python runs (Windows, macOS, Linux) and queries upstream APIs. Nix is only required for the flake-inputs action, which explores local flake dependencies from the Nix store.
How many tools does it expose?
Just two: nix (a unified query tool) and nix_versions (package version history). Seventeen underlying capabilities were consolidated into these two to keep the AI's context usage to roughly 1,030 tokens.
How do I run it over HTTP instead of stdio?
Set MCP_NIXOS_TRANSPORT=http (with optional MCP_NIXOS_HOST, MCP_NIXOS_PORT, and MCP_NIXOS_PATH). For example: MCP_NIXOS_TRANSPORT=http MCP_NIXOS_HOST=127.0.0.1 MCP_NIXOS_PORT=8000 mcp-nixos runs an HTTP MCP server at http://127.0.0.1:8000/mcp.
Alternatives to MCP-NixOS
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.
Compare MCP-NixOS with: