{ lib, buildNpmPackage, fetchzip, makeWrapper, python3, }: buildNpmPackage rec { pname = "n8n-mcp"; version = "2.87.0"; src = fetchzip { url = "https://registry.npmjs.org/${pname}/-/${pname}-${version}.tgz"; hash = "sha256-YEINthnVgy5nc0KPPHWhXBiiA5vR/ThKqie9lJ6d3co="; }; npmDepsHash = "sha256-oy3aR16bTuyztbY3rgTo2z66/4kCk2BNE4BLZjhtki8="; postPatch = '' cp ${./package-lock.json} package-lock.json ''; # dist/ and data/ are already built in the npm tarball dontNpmBuild = true; # better-sqlite3 needs python3 for node-gyp nativeBuildInputs = [ makeWrapper python3 ]; # Disable telemetry by default in Nix builds postInstall = '' wrapProgram $out/bin/${pname} \ --set N8N_MCP_TELEMETRY_DISABLED "true" ''; meta = with lib; { description = "MCP server providing AI assistants with access to n8n node documentation and workflow management"; homepage = "https://github.com/czlonkowski/n8n-mcp"; license = licenses.mit; mainProgram = pname; platforms = platforms.all; }; }