Package MCP tools into store derivations and eliminate runtime network fetching #272

Closed
opened 2026-10-06 20:08:06 +01:00 by nimmo · 0 comments
Owner

Context & Problem

In modules/profiles/ai-agents.nix, several MCP launcher definitions invoke external runtime package fetchers:

  • beszelLauncher executes:
    exec uvx --from git+https://github.com/Red5d/beszel-mcp.git@25452bd7baaf3038b5e46b2d2b2b8f901d433c9a beszel-mcp
    
  • nixosMcpArgs executes:
    nix run github:utensils/mcp-nixos --
    

These bypass the Nix store, perform impure network downloads at runtime, and circumvent flake.lock.

Scope

  • modules/profiles/ai-agents.nix
  • modules/profiles/ai-runtime.nix
  • flake.nix inputs (if pinning upstream sources)
  • packages/ (for Nix package derivations)

Implementation Checklist

  • Add mcp-nixos to flake.nix as an explicit, locked input or package it reproducibly in packages/.
  • Package beszel-mcp with python3Packages.buildPythonApplication or equivalent in packages/ rather than relying on ambient uvx.
  • Update ai-agents.nix and ai-runtime.nix to execute store binaries directly.
  • Verify Codex, OpenCode, and Antigravity CLI can launch both MCP servers offline without network downloads.

Completion Criteria

  • No MCP launchers invoke uvx or unpinned nix run github:....
  • All MCP binaries resolve to paths in /nix/store.
  • nix flake check passes.
## Context & Problem In `modules/profiles/ai-agents.nix`, several MCP launcher definitions invoke external runtime package fetchers: - `beszelLauncher` executes: ```bash exec uvx --from git+https://github.com/Red5d/beszel-mcp.git@25452bd7baaf3038b5e46b2d2b2b8f901d433c9a beszel-mcp ``` - `nixosMcpArgs` executes: ```bash nix run github:utensils/mcp-nixos -- ``` These bypass the Nix store, perform impure network downloads at runtime, and circumvent `flake.lock`. ## Scope - `modules/profiles/ai-agents.nix` - `modules/profiles/ai-runtime.nix` - `flake.nix` inputs (if pinning upstream sources) - `packages/` (for Nix package derivations) ## Implementation Checklist - [ ] Add `mcp-nixos` to `flake.nix` as an explicit, locked input or package it reproducibly in `packages/`. - [ ] Package `beszel-mcp` with `python3Packages.buildPythonApplication` or equivalent in `packages/` rather than relying on ambient `uvx`. - [ ] Update `ai-agents.nix` and `ai-runtime.nix` to execute store binaries directly. - [ ] Verify Codex, OpenCode, and Antigravity CLI can launch both MCP servers offline without network downloads. ## Completion Criteria - No MCP launchers invoke `uvx` or unpinned `nix run github:...`. - All MCP binaries resolve to paths in `/nix/store`. - `nix flake check` passes.
nimmo closed this issue 2026-10-07 12:02:28 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#272
No description provided.