diff --git a/pkgs/development/python-modules/fastapi-mcp/default.nix b/pkgs/development/python-modules/fastapi-mcp/default.nix new file mode 100644 index 000000000000..60ec0fa3f8ec --- /dev/null +++ b/pkgs/development/python-modules/fastapi-mcp/default.nix @@ -0,0 +1,74 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + hatchling, + tomli, + + # dependencies + fastapi, + httpx, + mcp, + pydantic, + pydantic-settings, + requests, + rich, + typer, + uvicorn, + + # tests + coverage, + pytest-asyncio, + pytest-cov-stub, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "fastapi-mcp"; + version = "0.3.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tadata-org"; + repo = "fastapi_mcp"; + tag = "v${version}"; + hash = "sha256-t6p/jXQjbhUmIlwoqszRj3GGSrLS0Gcoh1BtizNaw8o="; + }; + + build-system = [ + hatchling + tomli + ]; + + dependencies = [ + fastapi + httpx + mcp + pydantic + pydantic-settings + requests + rich + tomli + typer + uvicorn + ]; + + pythonImportsCheck = [ "fastapi_mcp" ]; + + nativeCheckInputs = [ + coverage + pytest-asyncio + pytest-cov-stub + pytestCheckHook + ]; + + meta = { + description = "Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth"; + homepage = "https://github.com/tadata-org/fastapi_mcp"; + changelog = "https://github.com/tadata-org/fastapi_mcp/blob/v${version}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 91f1fb0c6de2..85461c1feb53 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4803,6 +4803,8 @@ self: super: with self; { fastapi-mail = callPackage ../development/python-modules/fastapi-mail { }; + fastapi-mcp = callPackage ../development/python-modules/fastapi-mcp { }; + fastapi-sso = callPackage ../development/python-modules/fastapi-sso { }; fastavro = callPackage ../development/python-modules/fastavro { };