docs: update MCP config for nixpkgs-options and add nixpkgs-packages
Some checks failed
Run nix flake check / flake-check (push) Failing after 14m50s

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 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 20:50:36 +01:00
parent e3ced5bcda
commit 4ceee04308
2 changed files with 24 additions and 8 deletions

View File

@@ -1,10 +1,17 @@
{ {
"mcpServers": { "mcpServers": {
"nixos-options": { "nixpkgs-options": {
"command": "nix", "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": { "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"
} }
} }
} }

View File

@@ -71,21 +71,30 @@ To copy text to the clipboard, pipe to `wl-copy` (Wayland):
echo "text" | wl-copy 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 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") - `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_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 - `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. This ensures documentation matches the exact nixpkgs version (currently NixOS 25.11) used by this flake.
## Architecture ## Architecture