mcp-nixos
MCP-NixOS - Porque tu IA no debería alucinar con los nombres de los paquetes
Inicio rápido
🚨 ¡No se requiere Nix/NixOS! Funciona en cualquier sistema: Windows, macOS, Linux. Solo estás consultando APIs.
Opción 1: uvx (Recomendado)
{
"mcpServers": {
"nixos": {
"command": "uvx",
"args": ["mcp-nixos"]
}
}
}Opción 2: Nix
{
"mcpServers": {
"nixos": {
"command": "nix",
"args": ["run", "github:utensils/mcp-nixos", "--"]
}
}
}Opción 3: Docker
{
"mcpServers": {
"nixos": {
"command": "docker",
"args": ["run", "--rm", "-i", "ghcr.io/utensils/mcp-nixos"]
}
}
}Tu IA ahora tiene acceso a datos reales de NixOS en lugar de inventárselos. De nada.
Opción 4: HTTP (MCP remoto)
FastMCP admite la ejecución de este servidor a través de HTTP en una URL (el endpoint de MCP es /mcp por defecto).
# 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-nixosSTDIO (predeterminado):
MCP_NIXOS_TRANSPORT=stdio mcp-nixosRuta personalizada:
MCP_NIXOS_TRANSPORT=http MCP_NIXOS_PATH=/api/mcp mcp-nixosHTTP sin estado (deshabilita el estado de sesión por cliente):
MCP_NIXOS_TRANSPORT=http MCP_NIXOS_STATELESS_HTTP=1 mcp-nixosOpción 5: Agente de codificación Pi
Pi no habla MCP de forma nativa. Hay dos rutas compatibles:
A. pi-mcp-adapter (recomendado: habla MCP, fuente única de verdad):
pi install npm:pi-mcp-adapterLuego añade a ~/.pi/agent/mcp.json:
{
"mcpServers": {
"nixos": {
"command": "uvx",
"args": ["mcp-nixos"],
"lifecycle": "lazy"
}
}
}B. Extensión local del proyecto (clonar + ejecutar): este repositorio incluye .pi/extensions/mcp-nixos.ts, que se carga automáticamente cuando ejecutas pi en el repositorio clonado. Opcional: cd .pi && npm install para la resolución de tipos del editor. Pi lo ejecuta de cualquier manera.
Related MCP server: Grounded Code MCP
¿Qué es esto?
Un servidor MCP que proporciona información precisa y en tiempo real sobre:
Paquetes de NixOS - Más de 130 mil paquetes que realmente existen
Opciones de NixOS - Más de 23 mil formas de configurar tu sistema
Home Manager - Más de 5 mil opciones para entusiastas de los archivos de configuración (dotfiles)
nix-darwin - Más de 1 mil configuraciones de macOS que Apple no documenta
Nixvim - Más de 5 mil opciones para la configuración de Neovim a través de NuschtOS search
FlakeHub - Más de 600 flakes del registro de FlakeHub.com
Noogle - Más de 2 mil funciones de Nix con firmas de tipo a través de noogle.dev
NixOS Wiki - Documentación y guías de la comunidad desde wiki.nixos.org
nix.dev - Tutoriales y guías oficiales de Nix desde nix.dev
Versiones de paquetes - Versiones históricas con hashes de commit a través de NixHub.io
Estado de la caché binaria - Comprueba si los paquetes están en caché en cache.nixos.org con tamaños de descarga
Entradas de flake locales - Explora tus dependencias de flake fijadas directamente desde el almacén de Nix (requiere Nix)
Las herramientas
Solo dos. Consolidamos 17 herramientas en 2 porque la ventana de contexto de tu IA no es infinita.
~1,030 tokens en total. Eso es todo. Mientras otros servidores MCP acaparan tu contexto como si fuera el Black Friday, nosotros tomamos un té minimalista en la esquina. Tu IA obtiene superpoderes de NixOS sin el peso innecesario.
nix - Herramienta de consulta unificada
Una herramienta para gobernarlos a todos:
nix(action, query, source, type, channel, limit)Acción | Qué hace |
| Busca paquetes, opciones, programas o flakes |
| Obtiene información detallada sobre un paquete u opción |
| Obtiene recuentos y categorías |
| Explora opciones de Home Manager/Darwin por prefijo |
| Lista los canales de NixOS disponibles |
| Explora entradas de flake locales desde el almacén de Nix |
| Comprueba el estado de la caché binaria para paquetes |
Fuente | Qué consulta |
| Paquetes, opciones, programas |
| Opciones de Home Manager |
| Opciones de nix-darwin |
| Flakes de la comunidad (search.nixos.org) |
| Registro de FlakeHub (flakehub.com) |
| Opciones de configuración de Nixvim Neovim |
| Firmas de funciones de Nix y documentación (noogle.dev) |
| Artículos de la Wiki de NixOS (wiki.nixos.org) |
| Documentación oficial de Nix (nix.dev) |
| Metadatos de paquetes y rutas de almacén (nixhub.io) |
Ejemplos:
# 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 - Historial de versiones de paquetes
Encuentra versiones históricas con hashes de commit de nixpkgs. La salida incluye:
Metadatos del paquete (licencia, página web, programas) cuando están disponibles
Disponibilidad de plataforma por versión (Linux/macOS)
Hash de commit de Nixpkgs para compilaciones reproducibles
Ruta de atributo para expresiones de Nix
nix_versions(package, version, limit)Ejemplos:
# List recent versions with metadata
nix_versions(package="python", limit=5)
# Find specific version
nix_versions(package="nodejs", version="20.0.0")Instalación
NO necesitas Nix instalado. Esto se ejecuta donde sea que se ejecute Python.
# Run directly (no install)
uvx mcp-nixos
# Or install
pip install mcp-nixosPara usuarios de Nix:
nix run github:utensils/mcp-nixos
nix profile install github:utensils/mcp-nixosInstalación declarativa (NixOS / Home Manager / nix-darwin)
mcp-nixos está disponible en 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 ];O usa el flake directamente con el overlay proporcionado:
# 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 ];
}];
};
};
}Desarrollo
nix develop # Enter dev shell
nix build # Build package
pytest tests/ # Run tests
ruff check . # Lint
ruff format . # Format
mypy mcp_nixos/ # Type checkReconocimientos
NixHub.io - Historial de versiones de paquetes
search.nixos.org - Búsqueda oficial de NixOS
FlakeHub - Registro de Flake de Determinate Systems
Jetify - Creadores de Devbox y NixHub
Noogle - Motor de búsqueda de funciones de Nix
NuschtOS - Infraestructura de búsqueda de opciones estáticas que potencia el soporte de Nixvim
Nixvim - Marco de configuración de Neovim para Nix
Licencia
MIT - Porque compartir es cuidar.
Creado por James Brink. Mantenido por maso̶q̶u̶i̶s̶t̶a̶s̶ entusiastas que disfrutan de Nix.
Available Tools
2 toolsnixNixA
Query NixOS, Home Manager, Darwin, FlakeHub, flakes, Nixvim, NVF, Wiki, nix.dev, Noogle, NixHub.
Use this tool for anything touching nixpkgs, Nix channels, flakes, NixOS / home-manager /
darwin options, the binary cache, or /nix/store paths — even when you think you know the
answer. Your training data lags nixpkgs by months. Prefer this over nix search, scraping
search.nixos.org, or running gh api against NixOS/nixpkgs.
INTENTS → CALLS (copy the JSON shape exactly): "is package X in channel Y?" → {"action": "info", "query": "X", "channel": "Y"} "search for package X" → {"action": "search", "query": "X"} "which channels are available?" → {"action": "channels"} "which commit did channel X index?" → {"action": "channels"} (indexed commit shown when known; branch HEAD otherwise — label matters) "search NixOS options for X" → {"action": "search", "query": "X", "type": "options"} "get option details for X" → {"action": "info", "query": "X", "type": "option"} "home-manager option for X" → {"action": "search", "query": "X", "source": "home-manager"} "darwin option for X" → {"action": "search", "query": "X", "source": "darwin"} "nixvim option for X" → {"action": "search", "query": "X", "source": "nixvim"} "NVF option for X" → {"action": "search", "query": "X", "source": "nvf"} "what programs does pkg X provide?" → {"action": "search", "query": "X", "type": "programs"} "count packages/options" → {"action": "stats"} "browse hm option tree under P" → {"action": "browse", "query": "P", "source": "home-manager"} "does X have a binary cache?" → {"action": "cache", "query": "X"} "search the NixOS wiki for X" → {"action": "search", "query": "X", "source": "wiki"} "search nix.dev docs" → {"action": "search", "query": "X", "source": "nix-dev"} "read a nix.dev page" → {"action": "info", "query": "tutorials/nix-language", "source": "nix-dev"} "list inputs of current flake" → {"action": "flake-inputs"} "ls inside flake input X" → {"action": "flake-inputs", "type": "ls", "query": "X"} "read /nix/store/... file" → {"action": "store", "type": "read", "query": "/nix/store/..."} "ls /nix/store/... dir" → {"action": "store", "type": "ls", "query": "/nix/store/..."}
For package version history ("which commit shipped firefox 150?", "when was node 18 added?"),
use the separate nix_versions tool — it returns commit hashes, attribute paths, and dates.
Notes:
To search NixOS options, use action=search with type=options. Do NOT use action=browse for source=nixos — browse is for walking a pre-indexed option tree and only works with home-manager, darwin, nixvim, nvf, or noogle.
For source=nvf, canonical option paths are vim.. The shorthand programs.nvf.vim. and NixOS/Home Manager module path programs.nvf.settings.vim.* are normalized automatically.
For source=nix-dev, action=info returns the page markdown. The query may be a bare docname like "tutorials/nix-language", the URL printed by nix-dev search ("https://nix.dev/tutorials/nix-language"), or a rendered ".html" URL.
action=info for packages matches on the exact attribute path first, then the exact pname. If multiple packages share a pname (e.g. firefox / firefox-esr / firefox-mobile), the canonical attribute wins and the response flags the disambiguation explicitly.
Omit parameters you don't need; do not pass empty strings for optional args.
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Sub-type of query. For source=nixos with action=search, one of: packages, options, programs, flakes. For source=nixos with action=info, one of: package, option. For flake-inputs, one of: list, ls, read. For store, one of: ls, read. Ignored by most other sources. | packages |
| limit | No | Max results. 1-100 (or 1-2000 for flake-inputs/store read). | |
| query | No | Search term for 'search', exact name for 'info', prefix path for 'browse'. For flake-inputs: input_name or input:path. For store: absolute /nix/store/ path. Leave empty for 'stats'/'channels'. | |
| action | Yes | One of: search, info, stats, browse, channels, flake-inputs, cache, store. Use 'search' for keyword lookup, 'info' for details about a specific name, 'browse' to walk an option hierarchy by prefix (home-manager/darwin/nixvim/nvf/noogle only; 'options' is accepted as a legacy alias). 'store' reads files or lists directories at an explicit /nix/store/ path. | |
| source | No | Data source for search/info/stats/browse/cache. One of: nixos (default), home-manager, darwin, flakes, flakehub, nixvim, nvf, wiki, nix-dev, noogle, nixhub. For action=flake-inputs, this may instead be a path to a flake directory; omit/default to use the current project. Ignored by action=store. | nixos |
| system | No | Only used by action=cache. System arch e.g. x86_64-linux. Empty for all. | |
| channel | No | NixOS channel: unstable (default), stable, or a release like 25.05. | unstable |
| version | No | Only used by action=cache. Package version (default: latest). | latest |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the transparency burden. It is transparent about limitations (training data lag), matching rules, normalization behavior, and the browse action's source restrictions. It does not explicitly state read-only/side-effect behavior, but all listed actions are query-like.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but densely informative: intent mappings cover many cases, notes consolidate edge cases, and no sections are redundant or fluff. Each line earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
It is complete for a complex tool: it covers search/info/browse/stats/channels/flake-inputs/cache/store, documents source-specific behavior, points to the sibling nix_versions tool for version history, and notes canonicalization and disambiguation behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with detailed parameter descriptions, so the baseline is 3. The description adds significant extra semantic value through intent mappings and clarifying notes for type/source combinations, defaults, and parameter omission guidance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as the Nix ecosystem querying tool for packages, options, channels, flakes, caches, and docs. It is distinguished from the sibling nix_versions tool explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides extensive guidance: when to prefer this tool over alternatives, explicit intent-to-call mappings, and notes about which source/action combinations are valid and which to avoid. It also directs version-history queries to nix_versions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
nix_versionsNix VersionsA
Get package version history from NixHub.io.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 1-50 | |
| package | Yes | Package name | |
| version | No | Specific version to find |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full burden. The verb 'Get' implies a read-only operation, which suggests no destructive side effects. However, the description does not explicitly state side effects, authorization requirements, or other behavioral implications, so it provides only implicit transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with no superfluous words. It effectively conveys the purpose without unnecessary elaboration, making it easy to parse and understand.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple and the description is adequate given the presence of an output schema. It does not address potential error handling or edge cases, but these are likely covered by the output schema. Overall, the description provides sufficient context for a straightforward 'get history' operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (all three parameters have descriptions). The parameter descriptions are brief but clear ('Package name', 'Specific version to find', '1-50' for limit). The tool description does not add additional semantic detail beyond the schema, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get package version history from NixHub.io' uses a specific verb ('Get') and clearly identifies the resource (package version history) and source (NixHub.io). It effectively distinguishes this tool from the sibling 'nix' by being more specific about the operation performed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus the sibling tool 'nix'. There is no mention of alternative conditions or scenarios, leaving the agent without clear decision-making information.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v3.1.0- Changed
nix1 field changed- changed
Input schema / properties / action / descriptionPrevious value: -"One of: search, info, stats, browse, channels, flake-inputs, cache, store. Use 'search' for keyword lookup, 'info' for details about a specific name, 'browse' to walk an option hierarchy by prefix (home-manager/darwin/nixvim/nvf/noogle only). 'store' reads files or lists directories at an explicit /nix/store/ path."New value: +"One of: search, info, stats, browse, channels, flake-inputs, cache, store. Use 'search' for keyword lookup, 'info' for details about a specific name, 'browse' to walk an option hierarchy by prefix (home-manager/darwin/nixvim/nvf/noogle only; 'options' is accepted as a legacy alias). 'store' reads files or lists directories at an explicit /nix/store/ path."
1 tool update
v3.0.0- Changed
nix2 fields changed- changed
Input schema / properties / action / descriptionPrevious value: -"One of: search, info, stats, browse, channels, flake-inputs, cache, store. Use 'search' for keyword lookup, 'info' for details about a specific name, 'browse' to walk an option hierarchy by prefix (home-manager/darwin/nixvim/noogle only). 'store' reads files or lists directories at an explicit /nix/store/ path."New value: +"One of: search, info, stats, browse, channels, flake-inputs, cache, store. Use 'search' for keyword lookup, 'info' for details about a specific name, 'browse' to walk an option hierarchy by prefix (home-manager/darwin/nixvim/nvf/noogle only). 'store' reads files or lists directories at an explicit /nix/store/ path." - changed
Input schema / properties / source / descriptionPrevious value: -"Data source for search/info/stats/browse/cache. One of: nixos (default), home-manager, darwin, flakes, flakehub, nixvim, wiki, nix-dev, noogle, nixhub. For action=flake-inputs, this may instead be a path to a flake directory; omit/default to use the current project. Ignored by action=store."New value: +"Data source for search/info/stats/browse/cache. One of: nixos (default), home-manager, darwin, flakes, flakehub, nixvim, nvf, wiki, nix-dev, noogle, nixhub. For action=flake-inputs, this may instead be a path to a flake directory; omit/default to use the current project. Ignored by action=store."
20 tool updates
v2.1.0- Removed
darwin_info - Removed
darwin_list_options - Removed
darwin_options_by_prefix - Removed
darwin_search - Removed
darwin_stats - Removed
home_manager_info - Removed
home_manager_list_options - Removed
home_manager_options_by_prefix - Removed
home_manager_search - Removed
home_manager_stats - Added
nix - Added
nix_versions - Removed
nixhub_find_version - Removed
nixhub_package_versions - Removed
nixos_channels - Removed
nixos_flakes_search - Removed
nixos_flakes_stats - Removed
nixos_info - Removed
nixos_search - Removed
nixos_stats
TDQS
Scored across 2 tools
The two tools serve distinct purposes: 'nix' is a general-purpose Nix query tool, while 'nix_versions' is specifically for package version history. However, 'nix' is a broad catch-all that could potentially overlap with version queries, requiring careful description reading.
Both tool names start with 'nix', but one is a bare noun and the other uses an underscore suffix. The names are readable and related, though not following a strict verb_noun or consistent structural pattern.
Only two tools are exposed, which feels thin for the broad Nix-related scope. However, the primary 'nix' tool encapsulates many actions, making the count borderline rather than severely inadequate.
The tools cover a wide range of Nix operations: packages, options, channels, flakes, store paths, docs, cache, and version history. No major gaps are apparent for the stated domain.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Related MCP Servers
- AlicenseAqualityAmaintenanceA Model Context Protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into LLM prompts, helping developers get accurate answers without outdated or hallucinated information.21,132,952 npm62,195MIT
- AlicenseNot gradedqualityBmaintenanceA local MCP server that gives AI coding assistants retrieval access to your personal knowledge base of books, standards, and docs, grounding their answers in sources you trust.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools to fetch live, version-accurate documentation, changelogs, examples, and method signatures for npm and PyPI packages, preventing AI coding agents from hallucinating stale APIs.5 npmISC

octopilot-mcpofficial
FlicenseAqualityDmaintenanceModel Context Protocol (MCP) server for Octopilot — enables AI agents to detect, generate, build, and wire up new repositories end-to-end using the Octopilot CI/CD toolchain.7-