diff --git a/pkgs/development/python-modules/fastapi-mcp/default.nix b/pkgs/development/python-modules/fastapi-mcp/default.nix index 60ec0fa3f8ec..2d6e76197162 100644 --- a/pkgs/development/python-modules/fastapi-mcp/default.nix +++ b/pkgs/development/python-modules/fastapi-mcp/default.nix @@ -64,6 +64,8 @@ buildPythonPackage rec { pytestCheckHook ]; + __darwinAllowLocalNetworking = true; + meta = { description = "Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth"; homepage = "https://github.com/tadata-org/fastapi_mcp"; diff --git a/pkgs/development/python-modules/fastmcp/default.nix b/pkgs/development/python-modules/fastmcp/default.nix index d378c0fc9142..239176b8e6f4 100644 --- a/pkgs/development/python-modules/fastmcp/default.nix +++ b/pkgs/development/python-modules/fastmcp/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, @@ -7,6 +8,7 @@ hatchling, # dependencies + authlib, exceptiongroup, httpx, mcp, @@ -14,24 +16,24 @@ python-dotenv, rich, typer, - websockets, # tests dirty-equals, fastapi, + pytest-httpx, pytestCheckHook, }: buildPythonPackage rec { pname = "fastmcp"; - version = "2.4.0"; + version = "2.7.0"; pyproject = true; src = fetchFromGitHub { owner = "jlowin"; repo = "fastmcp"; tag = "v${version}"; - hash = "sha256-F4lgMm/84svLZo6SZ7AubsC73s4tffqjJcd9gvA7hGA="; + hash = "sha256-UQV/hIu96ukpJxUhOux0mos0o6j4kvsFp2NJHa47tbw="; }; postPatch = '' @@ -45,6 +47,7 @@ buildPythonPackage rec { ]; dependencies = [ + authlib exceptiongroup httpx mcp @@ -52,7 +55,6 @@ buildPythonPackage rec { python-dotenv rich typer - websockets ]; pythonImportsCheck = [ "fastmcp" ]; @@ -60,9 +62,28 @@ buildPythonPackage rec { nativeCheckInputs = [ dirty-equals fastapi + pytest-httpx pytestCheckHook ]; + disabledTests = [ + # AssertionError: assert 'INFO' == 'DEBUG' + "test_temporary_settings" + ]; + + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: Server failed to start after 10 attempts + "tests/auth/providers/test_bearer.py" + "tests/auth/test_oauth_client.py" + "tests/client/test_openapi.py" + "tests/client/test_sse.py" + "tests/client/test_streamable_http.py" + "tests/server/http/test_http_dependencies.py" + "tests/server/http/test_http_dependencies.py" + ]; + + __darwinAllowLocalNetworking = true; + meta = { description = "The fast, Pythonic way to build MCP servers and clients"; changelog = "https://github.com/jlowin/fastmcp/releases/tag/v${version}"; diff --git a/pkgs/development/python-modules/mcp/default.nix b/pkgs/development/python-modules/mcp/default.nix index 2603fcc4cfd5..ed05bed977be 100644 --- a/pkgs/development/python-modules/mcp/default.nix +++ b/pkgs/development/python-modules/mcp/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, @@ -27,22 +28,24 @@ websockets, # tests + inline-snapshot, pytest-asyncio, pytest-examples, + pytest-xdist, pytestCheckHook, requests, }: buildPythonPackage rec { pname = "mcp"; - version = "1.9.1"; + version = "1.9.3"; pyproject = true; src = fetchFromGitHub { owner = "modelcontextprotocol"; repo = "python-sdk"; tag = "v${version}"; - hash = "sha256-8u02/tHR2F1CpjcHXHC8sZC+/JrWz1satqYa/zdSGDw="; + hash = "sha256-3r7NG2AnxxKgAAd3n+tjjPTz4WJRmc7isfh3p21hUa0="; }; postPatch = '' @@ -85,8 +88,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "mcp" ]; nativeCheckInputs = [ + inline-snapshot pytest-asyncio pytest-examples + pytest-xdist pytestCheckHook requests ] ++ lib.flatten (lib.attrValues optional-dependencies); @@ -96,19 +101,27 @@ buildPythonPackage rec { "ignore::pydantic.warnings.PydanticDeprecatedSince211" ]; - disabledTests = [ - # attempts to run the package manager uv - "test_command_execution" + disabledTests = + [ + # attempts to run the package manager uv + "test_command_execution" - # performance-dependent test - "test_messages_are_executed_concurrently" + # performance-dependent test + "test_messages_are_executed_concurrently" - # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) - "test_client_session_version_negotiation_failure" + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_client_session_version_negotiation_failure" - # AttributeError: 'coroutine' object has no attribute 'client_metadata' - "TestOAuthClientProvider" - ]; + # AttributeError: 'coroutine' object has no attribute 'client_metadata' + "TestOAuthClientProvider" + + # inline_snapshot._exceptions.UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts + "test_build_metadata" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky: ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_notification_validation_error" + ]; __darwinAllowLocalNetworking = true;