MCP Connector

Query NixOS Package and Configuration Data

Query real NixOS packages, options, Home Manager, nix-darwin, and Nixvim data - no Nix installation required, just two tools.

Works with githubdockernixhub

Maintainer of this project? Claim this page to edit the listing.


91
Spark score
out of 100
Updated 26 days ago
Version 2.4.3
Models
universal

Add to Favorites

Why it matters

Access real-time information on over 130,000 NixOS packages, 22,000 configuration options, and related ecosystem data. This asset empowers AI assistants with accurate, up-to-date details for development and system management.

Outcomes

What it gets done

01

Search NixOS packages, options, and programs.

02

Retrieve detailed information on NixOS packages and configuration options.

03

Access Home Manager and nix-darwin configuration details.

04

View package version history and ecosystem statistics.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-mcp-nixos | bash

Capabilities

Tools your agent gets

nixos_search

Search for packages, options, or programs by query, type, and channel

nixos_info

Get detailed information about packages or options

nixos_stats

Get the count of packages and options for a channel

nixos_channels

List all available NixOS channels

nixos_flakes_search

Search community flakes

nixos_flakes_stats

Get flakes ecosystem statistics

nixhub_package_versions

Get package version history with commit hashes

nixhub_find_version

Smart search for specific package versions

+7 tools

Overview

MCP-NixOS MCP Server

MCP-NixOS provides an AI assistant with real-time, accurate data on NixOS packages, options, Home Manager, nix-darwin, Nixvim, FlakeHub, and Nix functions through two minimal tools. It requires no local Nix installation except for the flake-inputs action. Use it whenever an AI needs correct Nix/NixOS package or configuration data instead of guessing. The flake-inputs action for exploring local flake dependencies requires Nix to be installed.

What it does

MCP-NixOS gives an AI assistant accurate, real-time access to the Nix ecosystem instead of letting it hallucinate package or option names. It covers 130K+ NixOS packages, 23K+ NixOS options, 5K+ Home Manager options, 1K+ nix-darwin settings, 5K+ Nixvim options, 600+ FlakeHub flakes, 2K+ Noogle function signatures, NixOS Wiki articles, nix.dev tutorials, historical package versions via NixHub, and binary cache status on cache.nixos.org.

When to use - and when NOT to

Use it when an AI assistant needs to answer questions about Nix/NixOS packages, system configuration options, Home Manager or nix-darwin settings, Nixvim configuration, or Nix function signatures with real, current data rather than guessed names. It runs anywhere Python runs - Windows, macOS, or Linux - and does not require Nix or NixOS to be installed, since it only queries public APIs. Do not use it for tasks unrelated to the Nix ecosystem, and note that the flake-inputs action (exploring local pinned flake dependencies from the Nix store) does require Nix to be installed locally.

Capabilities

The server is deliberately minimal - just two tools totaling about 1,030 tokens of context:

  • nix(action, query, source, type, channel, limit) - a unified query tool. Actions include search (packages, options, programs, or 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, requires Nix), and cache (check binary cache status with download sizes). Sources span nixos, home-manager, darwin, flakes, flakehub, nixvim, noogle, wiki, nix-dev, and nixhub.
  • nix_versions(package, version, limit) - historical package version lookup, returning metadata (license, homepage, programs), per-version platform availability, nixpkgs commit hashes for reproducible builds, and Nix attribute paths.

How to install

No Nix installation needed - run directly or install via Python packaging:

uvx mcp-nixos
# or
pip install mcp-nixos

MCP client config:

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

Nix users can instead run nix run github:utensils/mcp-nixos or nix profile install github:utensils/mcp-nixos, or a Docker image via docker run --rm -i ghcr.io/utensils/mcp-nixos. It's also declaratively installable via nixpkgs (environment.systemPackages = [ pkgs.mcp-nixos ]; for NixOS/nix-darwin, or home.packages for Home Manager). Remote HTTP transport is supported via MCP_NIXOS_TRANSPORT=http with configurable MCP_NIXOS_HOST, MCP_NIXOS_PORT, and MCP_NIXOS_PATH.

Who it's for

NixOS, Home Manager, and nix-darwin users who want an AI assistant to give accurate answers about packages, configuration options, and Nix functions instead of confidently inventing ones that don't exist.

Source README

MCP-NixOS - Because Your AI Shouldn't Hallucinate Package Names

CI
codecov
PyPI
FlakeHub
Python 3.11+
CodeRabbit Pull Request Reviews
Built with Claude

Quick Start

🚨 No Nix/NixOS Required! Works on any system - Windows, macOS, Linux. You're just querying APIs.

Option 1: uvx (Recommended)

Install MCP Server

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

Option 2: Nix

Install MCP Server

{
  "mcpServers": {
    "nixos": {
      "command": "nix",
      "args": ["run", "github:utensils/mcp-nixos", "--"]
    }
  }
}

Option 3: Docker

Install MCP Server

{
  "mcpServers": {
    "nixos": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "ghcr.io/utensils/mcp-nixos"]
    }
  }
}

Your AI now has access to real NixOS data instead of making things up. You're welcome.

Option 4: HTTP (Remote MCP)

FastMCP supports running this server over HTTP at a URL (the MCP endpoint defaults to /mcp).

# Run an HTTP MCP server at http://127.0.0.1:8000/mcp
MCP_NIXOS_TRANSPORT=http MCP_NIXOS_HOST=127.0.0.1 MCP_NIXOS_PORT=8000 mcp-nixos

STDIO (default):

MCP_NIXOS_TRANSPORT=stdio mcp-nixos

Custom path:

MCP_NIXOS_TRANSPORT=http MCP_NIXOS_PATH=/api/mcp mcp-nixos

Stateless HTTP (disables per-client session state):

MCP_NIXOS_TRANSPORT=http MCP_NIXOS_STATELESS_HTTP=1 mcp-nixos

Option 5: Pi Coding Agent

Pi does not speak MCP natively. Two supported paths:

A. pi-mcp-adapter (recommended - speaks MCP, single source of truth):

pi install npm:pi-mcp-adapter

Then add to ~/.pi/agent/mcp.json:

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

B. Project-local extension (clone + run): this repo ships .pi/extensions/mcp-nixos.ts, auto-loaded when you run pi in the cloned repo. Optional: cd .pi && npm install for editor type resolution. Pi runs it either way.

What Is This?

An MCP server providing accurate, real-time information about:

  • NixOS packages - 130K+ packages that actually exist
  • NixOS options - 23K+ ways to configure your system
  • Home Manager - 5K+ options for dotfile enthusiasts
  • nix-darwin - 1K+ macOS settings Apple doesn't document
  • Nixvim - 5K+ options for Neovim configuration via NuschtOS search
  • FlakeHub - 600+ flakes from FlakeHub.com registry
  • Noogle - 2K+ Nix functions with type signatures via 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 with commit hashes via NixHub.io
  • Binary cache status - Check if packages are cached on cache.nixos.org with download sizes
  • Local flake inputs - Explore your pinned flake dependencies directly from the Nix store (requires Nix)

The Tools

Just two. We consolidated 17 tools into 2 because your AI's context window isn't infinite.

~1,030 tokens total. That's it. While other MCP servers are hogging your context like it's Black Friday, we're sipping minimalist tea in the corner. Your AI gets NixOS superpowers without the bloat.

nix - Unified Query Tool

One tool to rule them all:

nix(action, query, source, type, channel, limit)
Action What it does
search Search packages, options, programs, or flakes
info Get detailed info about a package or option
stats Get counts and categories
options Browse Home Manager/Darwin options by prefix
channels List available NixOS channels
flake-inputs Explore local flake inputs from Nix store
cache Check binary cache status for packages
Source What it queries
nixos Packages, options, programs
home-manager Home Manager options
darwin nix-darwin options
flakes Community flakes (search.nixos.org)
flakehub FlakeHub registry (flakehub.com)
nixvim Nixvim Neovim configuration options
noogle Nix function signatures and docs (noogle.dev)
wiki NixOS Wiki articles (wiki.nixos.org)
nix-dev Official Nix documentation (nix.dev)
nixhub Package metadata and store paths (nixhub.io)

Examples:

# Search NixOS packages
nix(action="search", query="firefox", source="nixos", type="packages")

# Get package info
nix(action="info", query="firefox", source="nixos", type="package")

# Search Home Manager options
nix(action="search", query="git", source="home-manager")

# Browse darwin options
nix(action="options", source="darwin", query="system.defaults")

# Search Nixvim options
nix(action="search", query="telescope", source="nixvim")

# Get Nixvim option info
nix(action="info", query="plugins.telescope.enable", source="nixvim")

# Search FlakeHub
nix(action="search", query="nixpkgs", source="flakehub")

# Get FlakeHub flake info
nix(action="info", query="NixOS/nixpkgs", source="flakehub")

# Search Noogle for Nix functions
nix(action="search", query="mapAttrs", source="noogle")

# Get Noogle function info
nix(action="info", query="lib.attrsets.mapAttrs", source="noogle")

# Browse Noogle function categories
nix(action="options", source="noogle", query="lib.strings")

# Search NixOS Wiki
nix(action="search", query="nvidia", source="wiki")

# Get Wiki page info
nix(action="info", query="Flakes", source="wiki")

# Search nix.dev documentation
nix(action="search", query="packaging tutorial", source="nix-dev")

# Search NixHub for package metadata
nix(action="search", query="nodejs", source="nixhub")

# Get detailed package info from NixHub (license, homepage, store paths)
nix(action="info", query="python", source="nixhub")

# Check binary cache status
nix(action="cache", query="hello")

# Check cache for specific version
nix(action="cache", query="python", version="3.12.0")

# Check cache for specific system
nix(action="cache", query="firefox", system="x86_64-linux")

# Get stats
nix(action="stats", source="nixos", channel="stable")

# List local flake inputs (requires Nix)
nix(action="flake-inputs", type="list")

# Browse files in a flake input
nix(action="flake-inputs", type="ls", query="nixpkgs:pkgs/by-name")

# Read a file from a flake input
nix(action="flake-inputs", type="read", query="nixpkgs:flake.nix")

nix_versions - Package Version History

Find historical versions with nixpkgs commit hashes. Output includes:

  • Package metadata (license, homepage, programs) when available
  • Platform availability per version (Linux/macOS)
  • Nixpkgs commit hash for reproducible builds
  • Attribute path for Nix expressions
nix_versions(package, version, limit)

Examples:

# List recent versions with metadata
nix_versions(package="python", limit=5)

# Find specific version
nix_versions(package="nodejs", version="20.0.0")

Installation

You DON'T need Nix installed. This runs anywhere Python runs.

# Run directly (no install)
uvx mcp-nixos

# Or install
pip install mcp-nixos

For Nix users:

nix run github:utensils/mcp-nixos
nix profile install github:utensils/mcp-nixos

Declarative Installation (NixOS / Home Manager / nix-darwin)

mcp-nixos is available in nixpkgs:

# NixOS (configuration.nix)
environment.systemPackages = [ pkgs.mcp-nixos ];

# Home Manager (home.nix)
home.packages = [ pkgs.mcp-nixos ];

# nix-darwin (darwin-configuration.nix)
environment.systemPackages = [ pkgs.mcp-nixos ];

Or use the flake directly with the provided overlay:

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    mcp-nixos.url = "github:utensils/mcp-nixos";
  };

  outputs = { self, nixpkgs, mcp-nixos, ... }: {
    # Example: NixOS configuration
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [{
        nixpkgs.overlays = [ mcp-nixos.overlays.default ];
        environment.systemPackages = [ pkgs.mcp-nixos ];
      }];
    };

    # Example: Home Manager standalone
    homeConfigurations.myuser = home-manager.lib.homeManagerConfiguration {
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [ mcp-nixos.overlays.default ];
      };
      modules = [{
        home.packages = [ pkgs.mcp-nixos ];
      }];
    };
  };
}

Development

nix develop          # Enter dev shell
nix build            # Build package
pytest tests/        # Run tests
ruff check .         # Lint
ruff format .        # Format
mypy mcp_nixos/      # Type check

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.