MCP-NixOS

MCP-NixOS

Stop AI hallucinations about NixOS packages—get accurate, real-time information.

328
Stars
17
Forks
328
Watchers
9
Issues
MCP-NixOS is a Model Context Protocol server designed to provide AI assistants with accurate, up-to-date information about NixOS packages, configuration options, Home Manager settings, and nix-darwin configurations. By interfacing with NixOS and NixHub.io, it enables detailed package search, version history, and configuration queries, drastically reducing AI-generated inaccuracies. It works cross-platform and can be deployed via different methods including uvx, Nix, and Docker.

Key Features

Real-time NixOS package search and lookup
Detailed information retrieval for packages and options
Statistics on packages and configuration options
Support for multiple deployment strategies (uvx, Nix, Docker)
Integration with NixHub.io for package version history
Community flake search and statistics
Home Manager config search and details
nix-darwin configuration retrieval
Cross-platform compatibility
Standardized protocol for AI assistant integration

Use Cases

Providing AI chat assistants with authoritative NixOS data
Retrieving current and historical package information for development environments
Assisting users in discovering valid configuration options
Helping system administrators validate availability of NixOS features
Enabling automated tools to generate accurate infrastructure recommendations
Offering developers a way to resolve package and version questions programmatically
Assisting in writing Home Manager or nix-darwin configurations with verified options
Validating package existence before script or deployment execution
Enhancing code editors or IDE tools with real-time NixOS context
Surfacing accurate, detailed package metadata in technical documentation

README

MCP-NixOS - Because Your AI Assistant Shouldn't Hallucinate About Packages

CI codecov PyPI Python versions smithery badge Verified on MseeP

🎉 REFACTORED: Version 1.0.0 represents a complete rewrite that drastically simplified everything. We removed all the complex caching, abstractions, and "enterprise" patterns. Because sometimes less is more, and more is just showing off.

🚀 ASYNC UPDATE: Version 1.0.1 migrated to FastMCP 2.x for modern async goodness. Because who doesn't love adding await to everything?

Quick Start (Because You Want to Use It NOW)

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

Option 1: Using uvx (Recommended for most users)

Install MCP Server

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

Option 2: Using Nix (For Nix users)

Install MCP Server

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

Option 3: Using Docker (Container lovers unite)

Install MCP Server

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

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

What Is This Thing?

MCP-NixOS is a Model Context Protocol server that gives your AI assistant accurate, real-time information about:

  • NixOS packages (130K+ packages that actually exist)
  • Configuration options (22K+ ways to break your system)
  • Home Manager settings (4K+ options for the power users)
  • nix-darwin configurations (1K+ macOS settings Apple doesn't want you to touch)
  • Package version history via NixHub.io (Find that ancient Ruby 2.6 with commit hashes)

The Tools You Actually Care About

🔍 NixOS Tools

  • nixos_search(query, type, channel) - Search packages, options, or programs
  • nixos_info(name, type, channel) - Get detailed info about packages/options
  • nixos_stats(channel) - Package and option counts
  • nixos_channels() - List all available channels
  • nixos_flakes_search(query) - Search community flakes
  • nixos_flakes_stats() - Flake ecosystem statistics

📦 Version History Tools (NEW!)

  • nixhub_package_versions(package, limit) - Get version history with commit hashes
  • nixhub_find_version(package, version) - Smart search for specific versions

🏠 Home Manager Tools

  • home_manager_search(query) - Search user config options
  • home_manager_info(name) - Get option details (with suggestions!)
  • home_manager_stats() - See what's available
  • home_manager_list_options() - Browse all 131 categories
  • home_manager_options_by_prefix(prefix) - Explore options by prefix

🍎 Darwin Tools

  • darwin_search(query) - Search macOS options
  • darwin_info(name) - Get option details
  • darwin_stats() - macOS configuration statistics
  • darwin_list_options() - Browse all 21 categories
  • darwin_options_by_prefix(prefix) - Explore macOS options

Installation Options

Remember: You DON'T need Nix/NixOS installed! This tool runs anywhere Python runs.

For Regular Humans (Windows/Mac/Linux)

bash
# Run directly with uvx (no installation needed)
uvx mcp-nixos

# Or install globally
pip install mcp-nixos
uv pip install mcp-nixos

For Nix Users (You Know Who You Are)

bash
# Run without installing
nix run github:utensils/mcp-nixos

# Install to profile
nix profile install github:utensils/mcp-nixos

Features Worth Mentioning

🚀 Version 1.0.1: The Async Revolution (After The Great Simplification)

  • Drastically less code - v1.0.0 removed thousands of lines, v1.0.1 made them async
  • 100% functionality - Everything still works, now with more await
  • 0% cache corruption - Because we removed the cache entirely (still gone!)
  • Stateless operation - No files to clean up (async doesn't change this)
  • Direct API access - No abstraction nonsense (but now it's async nonsense)
  • Modern MCP - FastMCP 2.x because the old MCP was too synchronous

📊 What You Get

  • Real-time data - Always current, never stale
  • Plain text output - Human and AI readable
  • Smart suggestions - Helps when you typo option names
  • Cross-platform - Works on Linux, macOS, and yes, even Windows
  • No configuration - It just works™

🎯 Key Improvements

  • Dynamic channel resolution - stable always points to current stable
  • Enhanced error messages - Actually helpful when things go wrong
  • Deduped flake results - No more duplicate spam
  • Version-aware searches - Find that old Ruby version you need
  • Category browsing - Explore options systematically

For Developers (The Brave Ones)

Local Development Setup

Want to test your changes in Claude Code or another MCP client? Create a .mcp.json file in your project directory:

json
{
  "mcpServers": {
    "nixos": {
      "type": "stdio",
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/home/hackerman/Projects/mcp-nixos",
        "mcp-nixos"
      ]
    }
  }
}

Replace /home/hackerman/Projects/mcp-nixos with your actual project path (yes, even you, Windows users with your C:\Users\CoolDev\... paths).

This .mcp.json file:

  • Automatically activates when you launch Claude Code from the project directory
  • Uses your local code instead of the installed package
  • Enables real-time testing - just restart Claude Code after changes
  • Already in .gitignore so you won't accidentally commit your path

With Nix (The Blessed Path)

bash
nix develop
menu  # Shows all available commands

# Common tasks
run        # Start the server (now with FastMCP!)
run-tests  # Run all tests (now async!)
lint       # Format and check code (ruff replaced black/flake8)
typecheck  # Check types (mypy still judges you)
build      # Build the package
publish    # Upload to PyPI (requires credentials)

Without Nix (The Path of Pain)

bash
# Install development dependencies
uv pip install -e ".[dev]"  # or pip install -e ".[dev]"

# Run the server locally
uv run mcp-nixos  # or python -m mcp_nixos.server

# Development commands
pytest tests/          # Now with asyncio goodness
ruff format mcp_nixos/ # black is so 2023
ruff check mcp_nixos/  # flake8 is for boomers
mypy mcp_nixos/        # Still pedantic as ever

# Build and publish
python -m build        # Build distributions
twine upload dist/*    # Upload to PyPI

Testing Philosophy

  • 367 tests that actually test things (now async because why not)
  • Real API calls because mocks are for cowards (await real_courage())
  • Plain text validation ensuring no XML leaks through
  • Cross-platform tests because Windows users deserve pain too
  • 15 test files down from 29 because organization is a virtue

Environment Variables

Just one. We're minimalists now:

Variable Description Default
ELASTICSEARCH_URL NixOS API endpoint https://search.nixos.org/backend

Troubleshooting

Nix Sandbox Error

If you encounter this error when running via Nix:

error: derivation '/nix/store/...-python3.11-watchfiles-1.0.4.drv' specifies a sandbox profile, 
but this is only allowed when 'sandbox' is 'relaxed'

Solution: Run with relaxed sandbox mode:

bash
nix run --option sandbox relaxed github:utensils/mcp-nixos --

Why this happens: The watchfiles package (a transitive dependency via MCP) requires custom sandbox permissions for file system monitoring. This is only allowed when Nix's sandbox is in 'relaxed' mode instead of the default 'strict' mode.

Permanent fix: Add to your /etc/nix/nix.conf:

sandbox = relaxed

Acknowledgments

This project queries data from several amazing services:

Note: These services have not endorsed this tool. We're just grateful API consumers.

License

MIT - Because sharing is caring, even if the code hurts.


Created by James Brink and maintained by masochists who enjoy Nix and async/await patterns.

Special thanks to the NixOS project for creating an OS that's simultaneously the best and worst thing ever.

Star History

Star History Chart

Repository Owner

utensils
utensils

Organization

Repository Details

Language HTML
Default Branch main
Size 2,605 KB
Contributors 6
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

HTML
74.5%
Python
20.67%
TypeScript
3.53%
Nix
1.12%
CSS
0.07%
JavaScript
0.06%
Dockerfile
0.05%
Shell
0%

Tags

Topics

ai-assistant ai-integration ai-tools anthropic claude developer-tools devops-tools fastmcp llm-tools mcp model-context-protocol nix nix-options nix-packages nix-search nixos package-search python sre-tools

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Nexus MCP Server

    Nexus MCP Server

    AI integration without the complexity

    Nexus MCP Server implements the Model Context Protocol to provide streamlined AI-powered web search capabilities through OpenRouter and the Perplexity Sonar models. It enables intelligent model search and discovery for MCP-compatible clients such as Claude Desktop and Cursor, supporting context-rich queries and structured citation extraction. The server features robust deployment options, including zero-install NPX execution, and is fully implemented in TypeScript. Its architecture includes production-ready features like error handling, request caching, deduplication, and logging.

    • 16
    • MCP
    • adawalli/nexus
  • NyxDocs

    NyxDocs

    MCP server for real-time cryptocurrency project documentation and insights.

    NyxDocs is a Model Context Protocol (MCP) compatible server built in Python for managing and serving up-to-date documentation for cryptocurrency projects. It aggregates information from multiple sources such as CoinGecko, GitHub, GitBook, Notion, and official websites, providing real-time data and updates on blockchain ecosystems. Featuring tools for searching projects, retrieving detailed info, extracting documentation, and monitoring changes, it is tailored for developers and AI contexts needing access to accurate crypto documentation. The architecture leverages a FastMCP-based server core, automated document scrapers, and supports multi-blockchain environments.

    • 3
    • MCP
    • nyxn-ai/NyxDocs
  • mcp-recon

    mcp-recon

    Conversational reconnaissance interface and MCP server for HTTP and ASN analysis.

    mcp-recon acts as a conversational interface and Model Context Protocol (MCP) server, enabling seamless web domain and ASN reconnaissance through natural language prompts. It integrates powerful tooling like httpx and asnmap to conduct lightweight or full HTTP analysis and ASN lookups, exposing these capabilities to any MCP-compatible AI assistant. With predefined prompts and Docker-based deployment, it streamlines infrastructure analysis via AI interfaces such as Claude Desktop.

    • 22
    • MCP
    • nickpending/mcp-recon
  • Pearch.ai MCP

    Pearch.ai MCP

    Natural Language People Search and Candidate Sourcing API for Seamless ATS Integration

    Pearch.ai MCP provides a high-precision people search API that interprets natural language queries to deliver top-quality candidate results. Designed for easy integration with Applicant Tracking Systems and hiring platforms, it leverages scientific methods and is trusted by recruiters. The tool is implemented as a Model Context Protocol (MCP), facilitating standardized model context handling and deployment via packages like FastMCP or through Smithery. The solution prioritizes ease of use, reliability, and high candidate match accuracy.

    • 5
    • MCP
    • Pearch-ai/mcp_pearch
  • ZoomEye MCP Server

    ZoomEye MCP Server

    Real-time cyberspace asset intelligence for AI assistants via Model Context Protocol.

    ZoomEye MCP Server implements the Model Context Protocol (MCP) to provide network asset intelligence to AI assistants and development tools. It enables querying of global internet assets through ZoomEye's cyber asset search engine using structured parameters and dorks. The server includes features like caching, error handling, and compatibility with leading MCP environments, supporting real-time cyber asset data integration for various AI and developer platforms.

    • 50
    • MCP
    • zoomeye-ai/mcp_zoomeye
  • Signoz MCP Server

    Signoz MCP Server

    Connect SigNoz observability data to AI assistants via the Model Context Protocol.

    Signoz MCP Server acts as a bridge between SigNoz observability platforms and AI assistants by implementing the Model Context Protocol (MCP). It exposes a suite of tools for querying dashboard information, fetching panel and metrics data, executing custom queries, and retrieving traces or logs from SigNoz. The tool supports integration with popular AI assistants, flexible deployment options (Docker, local virtual environments), and secure configuration via environment variables or YAML files. The server is designed to enable standardized programmatic context retrieval for enhancing AI/LLM workflows.

    • 11
    • MCP
    • DrDroidLab/signoz-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results