From 4ceee04308d654ee4225d1a4f8bf1a6fb3dddf7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Wed, 4 Feb 2026 20:50:36 +0100 Subject: [PATCH] docs: update MCP config for nixpkgs-options and add nixpkgs-packages Rename nixos-options to nixpkgs-options and add new nixpkgs-packages server for package search functionality. Update CLAUDE.md to document both MCP servers and their available tools. Co-Authored-By: Claude Opus 4.5 --- .mcp.json | 13 ++++++++++--- CLAUDE.md | 19 ++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.mcp.json b/.mcp.json index 01c6a16..80f0818 100644 --- a/.mcp.json +++ b/.mcp.json @@ -1,10 +1,17 @@ { "mcpServers": { - "nixos-options": { + "nixpkgs-options": { "command": "nix", - "args": ["run", "git+https://git.t-juice.club/torjus/labmcp#nixos-options", "--", "serve"], + "args": ["run", "git+https://git.t-juice.club/torjus/labmcp#nixpkgs-search", "--", "options", "serve"], "env": { - "NIXOS_OPTIONS_DATABASE": "sqlite:///run/user/1000/labmcp/nixos-options.db" + "NIXPKGS_SEARCH_DATABASE": "sqlite:///run/user/1000/labmcp/nixpkgs-search.db" + } + }, + "nixpkgs-packages": { + "command": "nix", + "args": ["run", "git+https://git.t-juice.club/torjus/labmcp#nixpkgs-search", "--", "packages", "serve"], + "env": { + "NIXPKGS_SEARCH_DATABASE": "sqlite:///run/user/1000/labmcp/nixpkgs-search.db" } } } diff --git a/CLAUDE.md b/CLAUDE.md index d104e6b..c04fa25 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -71,21 +71,30 @@ To copy text to the clipboard, pipe to `wl-copy` (Wayland): echo "text" | wl-copy ``` -### NixOS Options Lookup +### NixOS Options and Packages Lookup -An MCP server is available for searching and looking up NixOS option documentation. This is useful when configuring new services or options for hosts. +Two MCP servers are available for searching NixOS options and packages: -**Session Setup:** At the start of each session, index the nixpkgs revision from `flake.lock` to ensure option documentation matches the project's nixpkgs version: +- **nixpkgs-options** - Search and lookup NixOS configuration option documentation +- **nixpkgs-packages** - Search and lookup Nix packages from nixpkgs + +**Session Setup:** At the start of each session, index the nixpkgs revision from `flake.lock` to ensure documentation matches the project's nixpkgs version: 1. Read `flake.lock` and find the `nixpkgs` node's `rev` field -2. Call `index_revision` with that git hash +2. Call `index_revision` with that git hash (both servers share the same index) -**Usage Examples:** +**Options Tools (nixpkgs-options):** - `search_options` - Search for options by name or description (e.g., query "nginx" or "postgresql") - `get_option` - Get full details for a specific option (e.g., `services.loki.configuration`) - `get_file` - Fetch the source file from nixpkgs that declares an option +**Package Tools (nixpkgs-packages):** + +- `search_packages` - Search for packages by name or description (e.g., query "nginx" or "python") +- `get_package` - Get full details for a specific package by attribute path (e.g., `firefox`, `python312Packages.requests`) +- `get_file` - Fetch the source file from nixpkgs that defines a package + This ensures documentation matches the exact nixpkgs version (currently NixOS 25.11) used by this flake. ## Architecture