diff --git a/pkgs/development/python-modules/mcp/default.nix b/pkgs/development/python-modules/mcp/default.nix index e0f9c268ac28..e68a6ef12382 100644 --- a/pkgs/development/python-modules/mcp/default.nix +++ b/pkgs/development/python-modules/mcp/default.nix @@ -1,44 +1,54 @@ { - anyio, + lib, buildPythonPackage, - coreutils, fetchFromGitHub, + + # build-system hatchling, + + # dependencies + anyio, httpx, httpx-sse, - lib, pydantic, pydantic-settings, + python-multipart, + sse-starlette, + starlette, + uvicorn, + + # optional-dependencies + # cli + python-dotenv, + typer, + # rich + rich, + # ws + websockets, + + # tests pytest-asyncio, pytest-examples, pytestCheckHook, - python-dotenv, - rich, - sse-starlette, - starlette, - typer, - uvicorn, - websockets, + requests, }: buildPythonPackage rec { pname = "mcp"; - version = "1.6.0"; + version = "1.9.0"; pyproject = true; src = fetchFromGitHub { owner = "modelcontextprotocol"; repo = "python-sdk"; tag = "v${version}"; - hash = "sha256-APm3x4tcDbp8D2ygW43wFyP0llJ6fXZiINHRYShp9ZY="; + hash = "sha256-UH91o2ElS0XLjH67R9QaJ/7AeX6oVkqqOc3588D4s0g="; }; postPatch = '' substituteInPlace pyproject.toml \ --replace-fail ', "uv-dynamic-versioning"' "" \ --replace-fail 'dynamic = ["version"]' 'version = "${version}"' - substituteInPlace tests/client/test_stdio.py \ - --replace '/usr/bin/tee' '${lib.getExe' coreutils "tee"}' ''; build-system = [ hatchling ]; @@ -53,6 +63,7 @@ buildPythonPackage rec { httpx-sse pydantic pydantic-settings + python-multipart sse-starlette starlette uvicorn @@ -77,6 +88,7 @@ buildPythonPackage rec { pytest-asyncio pytest-examples pytestCheckHook + requests ] ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ @@ -89,6 +101,9 @@ buildPythonPackage rec { "test_command_execution" # performance-dependent test "test_messages_are_executed_concurrently" + + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_client_session_version_negotiation_failure" ]; __darwinAllowLocalNetworking = true;