diff --git a/hosts/jupiter/configuration.nix b/hosts/jupiter/configuration.nix index ae51e38..e907941 100644 --- a/hosts/jupiter/configuration.nix +++ b/hosts/jupiter/configuration.nix @@ -24,6 +24,7 @@ ../../services/media/seerr.nix ../../services/media/immich.nix ../../services/dev/gitea.nix + ../../services/dev/gitea-mcp.nix ../../services/dev/obsidian-livesync.nix ]; diff --git a/services/dev/gitea-mcp.nix b/services/dev/gitea-mcp.nix new file mode 100644 index 0000000..c2e56af --- /dev/null +++ b/services/dev/gitea-mcp.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: + +# gitea-mcp in HTTP mode, tailnet-only at http://jupiter.orbit.sol:8093/mcp. +# It holds no token: each client sends its own PAT as `Authorization: Bearer +# `, so an unauthenticated request can only see what anonymous gitea +# users can. +{ + systemd.services.gitea-mcp = { + description = "Gitea MCP server"; + after = [ "gitea.service" ]; + wants = [ "gitea.service" ]; + wantedBy = [ "multi-user.target" ]; + environment.GITEA_HOST = "http://localhost:3000"; + serviceConfig = { + # Binds every interface (no listen-address flag); tailnet-only because + # tailscale0 is trusted and 8093 stays closed on the LAN. + ExecStart = "${pkgs.gitea-mcp-server}/bin/gitea-mcp -t http -p 8093"; + DynamicUser = true; + Restart = "on-failure"; + ProtectSystem = "strict"; + ProtectHome = true; + PrivateTmp = true; + NoNewPrivileges = true; + }; + }; +}