SuperAPI AI Directory

mcp-nixos

Information on NixOS packages, system options, Home Manager configurations and nix-darwin macOS settings.

Open website

About this tool

MCP-NixOS is a Model Context Protocol (MCP) server that provides AI assistants with accurate, real-time information about NixOS resources. Its goal is to stop AI from making up package names and instead answer based on real data. The server does not require Nix/NixOS to be installed and can run on Windows, macOS, and Linux because it only queries APIs.

Main capabilities

  • NixOS packages: covers 130K+ packages that actually exist.
  • NixOS options: 23K+ ways to configure the system.
  • Home Manager: 5K+ options, suitable for users managing dotfiles.
  • nix-darwin: 1K+ macOS settings, settings that Apple does not document.
  • Nixvim: 5K+ Neovim configuration options, provided through NuschtOS search.
  • NVF: 2.4K+ Neovim options, from its released unstable documentation.
  • FlakeHub: 600+ flakes from the FlakeHub.com registry.
  • Noogle: 2K+ Nix functions with type signatures, from noogle.dev.
  • NixOS Wiki: community documentation and guides from wiki.nixos.org.
  • nix.dev: official Nix tutorials and guides from nix.dev.
  • Package versions: historical versions and commit hashes provided through NixHub.io.
  • Binary cache status: checks whether a package is cached on cache.nixos.org and shows the download size.
  • Local flake inputs: directly explore pinned flake dependencies from the Nix store (requires Nix).

Number of tools The server provides only two tools, merging the original 17 tools into 2 to save the AI's context window. Total token usage is about 1,030.

  1. nix: unified query tool. The version and system parameters are only used for action="cache". NVF results use canonical vim.* option paths. Queries can also use the shorthand programs.nvf.vim.* or the NixOS/Home Manager module path programs.nvf.settings.vim.*, and both are automatically normalized.
  2. nix_versions: package version history tool. Used to find historical versions with nixpkgs commit hashes. Output includes: package metadata (license, homepage, programs, etc., if available), platform availability for each version (Linux/macOS), nixpkgs commit hashes for reproducible builds, and attribute paths for Nix expressions.

How to use Nix does not need to be installed. As long as Python can run, it can run. Multiple installation and running options are provided:

  • Option 1: uvx (recommended).
  • Option 3: Docker.
  • Option 4: HTTP (remote MCP). FastMCP supports running this server over HTTP via URL (the MCP endpoint defaults to /mcp). Supports STDIO (default) and stateless HTTP (disables per-client session state).
  • Option 5: Pi Coding Agent. Pi itself does not support MCP, and there are two support paths: A. pi-mcp-adapter (recommended — supports MCP, single source of truth), then add it to ~/.pi/agent/mcp.json. B. Project-local extension (clone and run): the repository includes .pi/extensions/mcp-nixos.ts, which is automatically loaded when running pi in the cloned repository. Optional: cd .pi && npm install for editor type resolution. Pi will run it regardless.

Declarative installation (NixOS / Home Manager / nix-darwin) mcp-nixos is available in nixpkgs. You can also use the flake directly through the provided overlay. overlays.default adds only pkgs.mcp-nixos. The package bundles the FastMCP 4 / MCP SDK 2 stack (see nix/fastmcp4.nix), including the starlette 1.0.1 security lower bound required by FastMCP, so even if the nixpkgs channel still provides FastMCP 3, nothing else in your Python package set will change. If you also want to upgrade pkgs.pytho across the setn3Packages.fastmcp itself, please additionally apply mcp-nixos.overlays.fastmcp4.

Use cases

  • When you need to let an AI assistant accurately query NixOS packages, options, and configuration information.
  • When configuring with tools such as Home Manager, nix-darwin, Nixvim, and NVF.
  • When you need to find historical versions, commit hashes, or binary cache status of a specific package.
  • Use on any platform that supports Python, with no need to install Nix.

Limitations

  • Some features require Nix, such as exploring local flake inputs.
  • Specific installation commands and configuration details are not fully provided in the material.
  • Other unmentioned features, fees, prices, or effects are not yet provided.