Python MCP server (fastmcp + httpx) that exposes the Pinchflat REST API as MCP tools. Covers sources, media items, media profiles, tasks, and settings endpoints. Tested against live Pinchflat instance — 28 sources, search, app info all working via stdio transport.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
makeWrapper,
|
||||
python3,
|
||||
}:
|
||||
|
||||
let
|
||||
python = python3.withPackages (
|
||||
ps: with ps; [
|
||||
fastmcp
|
||||
httpx
|
||||
]
|
||||
);
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "pinchflat-mcp";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./server.py;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/pinchflat-mcp $out/bin
|
||||
cp $src $out/lib/pinchflat-mcp/server.py
|
||||
|
||||
makeWrapper ${python}/bin/python $out/bin/pinchflat-mcp \
|
||||
--add-flags "$out/lib/pinchflat-mcp/server.py" \
|
||||
--set-default PINCHFLAT_MCP_TRANSPORT stdio
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "MCP server for Pinchflat media downloader";
|
||||
homepage = "https://gitea.bueso.eu/hermes-agent/pinchflat";
|
||||
license = licenses.mit;
|
||||
mainProgram = "pinchflat-mcp";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user