This repository has been archived on 2026-03-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
labmcp/flake.nix
Torjus Håkestad 1755364bba feat: add lab-monitoring MCP server for Prometheus and Alertmanager
New MCP server that queries live Prometheus and Alertmanager HTTP APIs
with 8 tools: list_alerts, get_alert, search_metrics, get_metric_metadata,
query (PromQL), list_targets, list_silences, and create_silence.

Extends the MCP core with ModeCustom and NewGenericServer for servers
that don't require a database. Includes CLI with direct commands
(alerts, query, targets, metrics), NixOS module, and comprehensive
httptest-based tests.

Bumps existing binaries to 0.2.1 due to shared internal/mcp change.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 23:11:53 +01:00

91 lines
3.0 KiB
Nix

{
description = "LabMCP - Collection of MCP servers";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
lib = nixpkgs.lib;
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = lib.genAttrs supportedSystems;
pkgsFor = system: nixpkgs.legacyPackages.${system};
in
{
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
nixos-options = pkgs.callPackage ./nix/package.nix { src = ./.; };
hm-options = pkgs.callPackage ./nix/package.nix {
src = ./.;
pname = "hm-options-mcp";
subPackage = "cmd/hm-options";
mainProgram = "hm-options";
description = "MCP server for Home Manager options search and query";
};
nixpkgs-search = pkgs.callPackage ./nix/package.nix {
src = ./.;
pname = "nixpkgs-search";
subPackage = "cmd/nixpkgs-search";
mainProgram = "nixpkgs-search";
description = "Search nixpkgs options and packages";
};
lab-monitoring = pkgs.callPackage ./nix/package.nix {
src = ./.;
pname = "lab-monitoring";
subPackage = "cmd/lab-monitoring";
mainProgram = "lab-monitoring";
description = "MCP server for Prometheus and Alertmanager monitoring";
};
default = self.packages.${system}.nixpkgs-search;
});
devShells = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_24
gopls
gotools
go-tools
golangci-lint
govulncheck
postgresql
sqlite
];
shellHook = ''
echo "LabMCP development shell"
echo "Go version: $(go version)"
'';
};
});
nixosModules = {
nixpkgs-search-mcp = { pkgs, ... }: {
imports = [ ./nix/nixpkgs-search-module.nix ];
services.nixpkgs-search.package = lib.mkDefault self.packages.${pkgs.system}.nixpkgs-search;
};
nixos-options-mcp = { pkgs, ... }: {
imports = [ ./nix/module.nix ];
services.nixos-options-mcp.package = lib.mkDefault self.packages.${pkgs.system}.nixos-options;
};
hm-options-mcp = { pkgs, ... }: {
imports = [ ./nix/hm-options-module.nix ];
services.hm-options-mcp.package = lib.mkDefault self.packages.${pkgs.system}.hm-options;
};
lab-monitoring-mcp = { pkgs, ... }: {
imports = [ ./nix/lab-monitoring-module.nix ];
services.lab-monitoring.package = lib.mkDefault self.packages.${pkgs.system}.lab-monitoring;
};
default = self.nixosModules.nixpkgs-search-mcp;
};
};
}