001-mcp-server #3

Merged
jawz merged 5 commits from 001-mcp-server into main 2026-02-01 10:38:13 -06:00
Showing only changes of commit 703723b368 - Show all commits

53
modules/dev/mcp.nix Normal file
View File

@@ -0,0 +1,53 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
python = pkgs.python3.withPackages (
ps:
builtins.attrValues {
inherit (ps)
click
pytest
black
ruff
;
}
);
packages = builtins.attrValues {
inherit python;
inherit (pkgs) codex; # codex-cli from openai
};
in
{
options = {
my.dev.mcp = {
enable = lib.mkEnableOption "Install MCP tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install MCP packages for";
};
};
devShells.mcp = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "mcp-dev-shell";
shellHook = ''
export CODEX_HOME=$PWD/.codex
export PYTHONPATH=$PWD/scripts/mcp-server/src
alias mcp-run="python -m mcp_server.server"
echo "MCP shell ready: codex + python + PYTHONPATH set"
'';
};
description = "MCP + Codex shell for this repo";
};
};
config = lib.mkIf config.my.dev.mcp.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.mcp.users { inherit packages; };
};
}