by utensils
MCP-NixOS is a Model Context Protocol server that provides AI assistants with accurate, real-time information about NixOS packages, system options, Home Manager settings, and nix-darwin macOS configurations, preventing AI hallucinations.
MCP-NixOS is a Model Context Protocol (MCP) server designed to provide AI assistants with precise and up-to-date information regarding the NixOS ecosystem. This includes details on NixOS packages, configuration options, Home Manager settings, and nix-darwin macOS configurations. Its primary goal is to prevent AI models from "hallucinating" or providing incorrect information when queried about Nix-related topics.
MCP-NixOS can be used on any system (Windows, macOS, Linux) and does not require Nix/NixOS to be installed. It primarily queries web APIs. There are two main ways to use it:
Using uvx
(Recommended):
{
"mcpServers": {
"nixos": {
"command": "uvx",
"args": ["mcp-nixos"]
}
}
}
Or, install globally: pip install mcp-nixos
or uv pip install mcp-nixos
.
Using Nix (for Nix users):
{
"mcpServers": {
"nixos": {
"command": "nix",
"args": ["run", "github:utensils/mcp-nixos", "--"]
}
}
}
You can also run it without installing (nix run github:utensils/mcp-nixos
) or install to your profile (nix profile install github:utensils/mcp-nixos
).
nixos_search
, nixos_info
, nixos_stats
, nixos_channels
, nixos_flakes_search
, nixos_flakes_stats
.nixhub_package_versions
, nixhub_find_version
(via NixHub.io).home_manager_search
, home_manager_info
, home_manager_stats
, home_manager_list_options
, home_manager_options_by_prefix
.darwin_search
, darwin_info
, darwin_stats
, darwin_list_options
, darwin_options_by_prefix
.🎉 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.
🚨 No Nix/NixOS Required! This tool works on any system - Windows, macOS, Linux. You're just querying web APIs.
{
"mcpServers": {
"nixos": {
"command": "uvx",
"args": ["mcp-nixos"]
}
}
}
{
"mcpServers": {
"nixos": {
"command": "nix",
"args": ["run", "github:utensils/mcp-nixos", "--"]
}
}
}
That's it. Your AI assistant now has access to real NixOS data instead of making things up. You're welcome.
MCP-NixOS is a Model Context Protocol server that gives your AI assistant accurate, real-time information about:
nixos_search(query, type, channel)
- Search packages, options, or programsnixos_info(name, type, channel)
- Get detailed info about packages/optionsnixos_stats(channel)
- Package and option countsnixos_channels()
- List all available channelsnixos_flakes_search(query)
- Search community flakesnixos_flakes_stats()
- Flake ecosystem statisticsnixhub_package_versions(package, limit)
- Get version history with commit hashesnixhub_find_version(package, version)
- Smart search for specific versionshome_manager_search(query)
- Search user config optionshome_manager_info(name)
- Get option details (with suggestions!)home_manager_stats()
- See what's availablehome_manager_list_options()
- Browse all 131 categorieshome_manager_options_by_prefix(prefix)
- Explore options by prefixdarwin_search(query)
- Search macOS optionsdarwin_info(name)
- Get option detailsdarwin_stats()
- macOS configuration statisticsdarwin_list_options()
- Browse all 21 categoriesdarwin_options_by_prefix(prefix)
- Explore macOS optionsRemember: You DON'T need Nix/NixOS installed! This tool runs anywhere Python runs.
# Run directly with uvx (no installation needed)
uvx mcp-nixos
# Or install globally
pip install mcp-nixos
uv pip install mcp-nixos
# Run without installing
nix run github:utensils/mcp-nixos
# Install to profile
nix profile install github:utensils/mcp-nixos
stable
always points to current stablenix develop
menu # Shows all available commands
# Common tasks
run # Start the server
run-tests # Run all tests
lint # Format and check code
typecheck # Check types
pip install -e ".[dev]"
pytest tests/
black mcp_nixos/
flake8 mcp_nixos/
Just one. We're minimalists now:
Variable | Description | Default |
---|---|---|
ELASTICSEARCH_URL |
NixOS API endpoint | https://search.nixos.org/backend |
This project queries data from several amazing services:
Note: These services have not endorsed this tool. We're just grateful API consumers.
MIT - Because sharing is caring, even if the code hurts.
Created by James Brink and maintained by masochists who enjoy Nix.
Special thanks to the NixOS project for creating an OS that's simultaneously the best and worst thing ever.
Reviews feature coming soon
Stay tuned for community discussions and feedback