python3Packages.mcp: 1.9.4 -> 1.12.2, and fix dependent packages build failures (#428733)

authored by Gaétan Lepage and committed by GitHub 3f3dc789 a18142f9

+118 -38
+12
pkgs/by-name/mc/mcp-proxy/package.nix
··· 28 pytest-asyncio 29 ]; 30 31 meta = { 32 description = "MCP server which proxies other MCP servers from stdio to SSE or from SSE to stdio"; 33 homepage = "https://github.com/sparfenyuk/mcp-proxy";
··· 28 pytest-asyncio 29 ]; 30 31 + disabledTests = [ 32 + # AssertionError: expected call not found. 33 + # Expected: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value')) 34 + # Actual: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value'), None) 35 + "test_call_tool[server-AsyncMock]" 36 + "test_call_tool[proxy-AsyncMock]" 37 + "test_complete[server-AsyncMock]" 38 + "test_complete[proxy-AsyncMock]" 39 + ]; 40 + 41 + __darwinAllowLocalNetworking = true; 42 + 43 meta = { 44 description = "MCP server which proxies other MCP servers from stdio to SSE or from SSE to stdio"; 45 homepage = "https://github.com/sparfenyuk/mcp-proxy";
+1
pkgs/by-name/ot/oterm/package.nix
··· 29 "pydantic" 30 "textual" 31 "typer" 32 ]; 33 34 build-system = with python3Packages; [ hatchling ];
··· 29 "pydantic" 30 "textual" 31 "typer" 32 + "fastmcp" 33 ]; 34 35 build-system = with python3Packages; [ hatchling ];
+7 -2
pkgs/development/python-modules/fastapi-mcp/default.nix
··· 27 28 buildPythonPackage rec { 29 pname = "fastapi-mcp"; 30 - version = "0.3.4"; 31 pyproject = true; 32 33 src = fetchFromGitHub { 34 owner = "tadata-org"; 35 repo = "fastapi_mcp"; 36 tag = "v${version}"; 37 - hash = "sha256-t6p/jXQjbhUmIlwoqszRj3GGSrLS0Gcoh1BtizNaw8o="; 38 }; 39 40 build-system = [ ··· 62 pytest-asyncio 63 pytest-cov-stub 64 pytestCheckHook 65 ]; 66 67 __darwinAllowLocalNetworking = true;
··· 27 28 buildPythonPackage rec { 29 pname = "fastapi-mcp"; 30 + version = "0.3.7"; 31 pyproject = true; 32 33 src = fetchFromGitHub { 34 owner = "tadata-org"; 35 repo = "fastapi_mcp"; 36 tag = "v${version}"; 37 + hash = "sha256-WQ+Y/TM5fz0lHjCKvEuYGY6hzxo2ePcgRnq7piNC+KQ="; 38 }; 39 40 build-system = [ ··· 62 pytest-asyncio 63 pytest-cov-stub 64 pytestCheckHook 65 + ]; 66 + 67 + disabledTestPaths = [ 68 + # Flaky, would try to allocate a port on Darwin 69 + "tests/test_sse_real_transport.py" 70 ]; 71 72 __darwinAllowLocalNetworking = true;
+32 -5
pkgs/development/python-modules/fastmcp/default.nix
··· 10 11 # dependencies 12 authlib, 13 exceptiongroup, 14 httpx, 15 mcp, 16 openapi-pydantic, 17 python-dotenv, 18 rich, 19 - typer, 20 21 # tests 22 dirty-equals, 23 fastapi, 24 pytest-httpx, 25 pytestCheckHook, 26 }: 27 28 buildPythonPackage rec { 29 pname = "fastmcp"; 30 - version = "2.8.0"; 31 pyproject = true; 32 33 src = fetchFromGitHub { 34 owner = "jlowin"; 35 repo = "fastmcp"; 36 tag = "v${version}"; 37 - hash = "sha256-FleJkqdUIhGsV+DVYv/Nf5IORntH/aFq9abKn2r/6Is="; 38 }; 39 40 postPatch = '' ··· 49 50 dependencies = [ 51 authlib 52 exceptiongroup 53 httpx 54 mcp 55 openapi-pydantic 56 python-dotenv 57 rich 58 - typer 59 ]; 60 61 pythonImportsCheck = [ "fastmcp" ]; 62 63 nativeCheckInputs = [ 64 dirty-equals 65 fastapi 66 pytest-httpx 67 pytestCheckHook 68 writableTmpDirAsHomeHook 69 - ]; 70 71 disabledTests = [ 72 # AssertionError: assert 'INFO' == 'DEBUG' 73 "test_temporary_settings" 74 ]; 75 76 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
··· 10 11 # dependencies 12 authlib, 13 + cyclopts, 14 exceptiongroup, 15 httpx, 16 mcp, 17 openapi-pydantic, 18 + pydantic, 19 + pyperclip, 20 python-dotenv, 21 rich, 22 23 # tests 24 dirty-equals, 25 + email-validator, 26 fastapi, 27 + pytest-asyncio, 28 pytest-httpx, 29 pytestCheckHook, 30 }: 31 32 buildPythonPackage rec { 33 pname = "fastmcp"; 34 + version = "2.10.6"; 35 pyproject = true; 36 37 src = fetchFromGitHub { 38 owner = "jlowin"; 39 repo = "fastmcp"; 40 tag = "v${version}"; 41 + hash = "sha256-Wxugk2ocuur710WZLG7xph2R/n02Y9BvH7Lf4BuEMYs="; 42 }; 43 44 postPatch = '' ··· 53 54 dependencies = [ 55 authlib 56 + cyclopts 57 exceptiongroup 58 httpx 59 mcp 60 openapi-pydantic 61 + pyperclip 62 python-dotenv 63 rich 64 ]; 65 66 pythonImportsCheck = [ "fastmcp" ]; 67 68 nativeCheckInputs = [ 69 dirty-equals 70 + email-validator 71 fastapi 72 + pydantic 73 + pytest-asyncio 74 pytest-httpx 75 pytestCheckHook 76 writableTmpDirAsHomeHook 77 + ] 78 + ++ pydantic.optional-dependencies.email; 79 80 disabledTests = [ 81 # AssertionError: assert 'INFO' == 'DEBUG' 82 "test_temporary_settings" 83 + 84 + # RuntimeError: Client failed to connect: Connection close 85 + "test_keep_alive_maintains_session_across_multiple_calls" 86 + "test_keep_alive_false_starts_new_session_across_multiple_calls" 87 + "test_keep_alive_starts_new_session_if_manually_closed" 88 + "test_keep_alive_maintains_session_if_reentered" 89 + "test_close_session_and_try_to_use_client_raises_error" 90 + 91 + # RuntimeError: Client failed to connect: Timed out while waiting for response 92 + "test_timeout" 93 + "test_timeout_tool_call_overrides_client_timeout_even_if_lower" 94 + 95 + # assert 0 == 2 96 + "test_multi_client" 97 + 98 + # fastmcp.exceptions.ToolError: Unknown tool 99 + "test_multi_client_with_logging" 100 + "test_multi_client_with_elicitation" 101 ]; 102 103 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
+3 -3
pkgs/development/python-modules/gradio/default.nix
··· 75 76 buildPythonPackage rec { 77 pname = "gradio"; 78 - version = "5.38.0"; 79 pyproject = true; 80 81 src = fetchFromGitHub { 82 owner = "gradio-app"; 83 repo = "gradio"; 84 tag = "gradio@${version}"; 85 - hash = "sha256-NbVRbwqHUSwyG+v+cDKCrVtzjj6ThxGRfO+xjqXOy5I="; 86 }; 87 88 pnpmDeps = pnpm_9.fetchDeps { 89 inherit pname version src; 90 fetcherVersion = 1; 91 - hash = "sha256-E6dBajJoKzaJF67KRrSB/LNAyLDmT78mCmTar5G6P6g="; 92 }; 93 94 pythonRelaxDeps = [
··· 75 76 buildPythonPackage rec { 77 pname = "gradio"; 78 + version = "5.38.2"; 79 pyproject = true; 80 81 src = fetchFromGitHub { 82 owner = "gradio-app"; 83 repo = "gradio"; 84 tag = "gradio@${version}"; 85 + hash = "sha256-zKAH/tbF1S+LIi1i+BuKBUWDSI0+Ii5FhsZ3sQaFtto="; 86 }; 87 88 pnpmDeps = pnpm_9.fetchDeps { 89 inherit pname version src; 90 fetcherVersion = 1; 91 + hash = "sha256-sIEsolHffX3cpAJU79w+ndRY4vvmWLxp2efTryv+j38="; 92 }; 93 94 pythonRelaxDeps = [
+52 -18
pkgs/development/python-modules/mcp/default.nix
··· 11 anyio, 12 httpx, 13 httpx-sse, 14 pydantic, 15 pydantic-settings, 16 python-multipart, ··· 28 websockets, 29 30 # tests 31 inline-snapshot, 32 pytest-asyncio, 33 pytest-examples, ··· 38 39 buildPythonPackage rec { 40 pname = "mcp"; 41 - version = "1.9.4"; 42 pyproject = true; 43 44 src = fetchFromGitHub { 45 owner = "modelcontextprotocol"; 46 repo = "python-sdk"; 47 tag = "v${version}"; 48 - hash = "sha256-VXbu/wHbXGS+cISJVUgCVEpTmZc0VfckNRoMj3GDi/A="; 49 }; 50 51 postPatch = '' 52 substituteInPlace pyproject.toml \ 53 --replace-fail ', "uv-dynamic-versioning"' "" \ 54 --replace-fail 'dynamic = ["version"]' 'version = "${version}"' 55 ''; 56 57 build-system = [ hatchling ]; ··· 64 anyio 65 httpx 66 httpx-sse 67 pydantic 68 pydantic-settings 69 python-multipart ··· 88 pythonImportsCheck = [ "mcp" ]; 89 90 nativeCheckInputs = [ 91 inline-snapshot 92 pytest-asyncio 93 pytest-examples ··· 96 requests 97 ] 98 ++ lib.flatten (lib.attrValues optional-dependencies); 99 - 100 - pytestFlags = [ 101 - "-Wignore::pydantic.warnings.PydanticDeprecatedSince211" 102 - ]; 103 104 disabledTests = [ 105 # attempts to run the package manager uv 106 "test_command_execution" 107 108 - # performance-dependent test 109 - "test_messages_are_executed_concurrently" 110 - 111 # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 112 - "test_client_session_version_negotiation_failure" 113 114 - # AttributeError: 'coroutine' object has no attribute 'client_metadata' 115 - "TestOAuthClientProvider" 116 117 - # inline_snapshot._exceptions.UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts 118 - "test_build_metadata" 119 - ] 120 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ 121 - # Flaky: ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 122 "test_notification_validation_error" 123 ]; 124 125 __darwinAllowLocalNetworking = true; ··· 129 description = "Official Python SDK for Model Context Protocol servers and clients"; 130 homepage = "https://github.com/modelcontextprotocol/python-sdk"; 131 license = lib.licenses.mit; 132 - maintainers = with lib.maintainers; [ josh ]; 133 }; 134 }
··· 11 anyio, 12 httpx, 13 httpx-sse, 14 + jsonschema, 15 pydantic, 16 pydantic-settings, 17 python-multipart, ··· 29 websockets, 30 31 # tests 32 + dirty-equals, 33 inline-snapshot, 34 pytest-asyncio, 35 pytest-examples, ··· 40 41 buildPythonPackage rec { 42 pname = "mcp"; 43 + version = "1.12.2"; 44 pyproject = true; 45 46 src = fetchFromGitHub { 47 owner = "modelcontextprotocol"; 48 repo = "python-sdk"; 49 tag = "v${version}"; 50 + hash = "sha256-K3S+2Z4yuo8eAOo8gDhrI8OOfV6ADH4dAb1h8PqYntc="; 51 }; 52 53 postPatch = '' 54 substituteInPlace pyproject.toml \ 55 --replace-fail ', "uv-dynamic-versioning"' "" \ 56 --replace-fail 'dynamic = ["version"]' 'version = "${version}"' 57 + '' 58 + + lib.optionalString stdenv.buildPlatform.isDarwin '' 59 + # time.sleep(0.1) feels a bit optimistic and it has been flaky whilst 60 + # testing this on macOS under load. 61 + substituteInPlace \ 62 + "tests/client/test_stdio.py" \ 63 + "tests/server/fastmcp/test_integration.py" \ 64 + "tests/shared/test_ws.py" \ 65 + "tests/shared/test_sse.py" \ 66 + "tests/shared/test_streamable_http.py" \ 67 + --replace-fail "time.sleep(0.1)" "time.sleep(1)" 68 ''; 69 70 build-system = [ hatchling ]; ··· 77 anyio 78 httpx 79 httpx-sse 80 + jsonschema 81 pydantic 82 pydantic-settings 83 python-multipart ··· 102 pythonImportsCheck = [ "mcp" ]; 103 104 nativeCheckInputs = [ 105 + dirty-equals 106 inline-snapshot 107 pytest-asyncio 108 pytest-examples ··· 111 requests 112 ] 113 ++ lib.flatten (lib.attrValues optional-dependencies); 114 115 disabledTests = [ 116 # attempts to run the package manager uv 117 "test_command_execution" 118 119 # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 120 + "test_lifespan_cleanup_executed" 121 122 + # AssertionError: Child process should be writing 123 + "test_basic_child_process_cleanup" 124 125 + # AssertionError: parent process should be writing 126 + "test_nested_process_tree" 127 + 128 + # AssertionError: Child should be writing 129 + "test_early_parent_exit" 130 + 131 + # pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ... 132 + "test_list_tools_returns_all_tools" 133 + 134 + # AssertionError: Server startup marker not created 135 + "test_stdin_close_triggers_cleanup" 136 + 137 + # pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function St.. 138 + "test_resource_template_client_interaction" 139 + 140 + # Flaky: https://github.com/modelcontextprotocol/python-sdk/pull/1171 141 "test_notification_validation_error" 142 + 143 + # Flaky: httpx.ConnectError: All connection attempts failed 144 + "test_sse_security_" 145 + "test_streamable_http_" 146 + 147 + # This just feels a bit optimistic... 148 + # assert duration < 3 * _sleep_time_seconds 149 + # AssertionError: assert 0.0733884589999434 < (3 * 0.01) 150 + "test_messages_are_executed_concurrently" 151 + 152 + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 153 + "test_tool_progress" 154 ]; 155 156 __darwinAllowLocalNetworking = true; ··· 160 description = "Official Python SDK for Model Context Protocol servers and clients"; 161 homepage = "https://github.com/modelcontextprotocol/python-sdk"; 162 license = lib.licenses.mit; 163 + maintainers = with lib.maintainers; [ 164 + bryanhonof 165 + josh 166 + ]; 167 }; 168 }
+2 -10
pkgs/development/python-modules/openai-agents/default.nix
··· 1 { 2 lib, 3 - nix-update-script, 4 buildPythonPackage, 5 fetchPypi, 6 hatchling, ··· 15 16 buildPythonPackage rec { 17 pname = "openai-agents"; 18 - version = "0.0.13"; 19 pyproject = true; 20 21 src = fetchPypi { 22 inherit version; 23 pname = "openai_agents"; 24 - hash = "sha256-a4AxXnXAa1MCxfKtui+eo4RflGFdrtRwa/uHF0D1YaU="; 25 }; 26 27 - # OpenAI 1.76.0 seems to not build currently 28 - postPatch = '' 29 - substituteInPlace pyproject.toml --replace-fail "openai>=1.76.0" "openai" 30 - ''; 31 - 32 build-system = [ 33 hatchling 34 ]; ··· 46 pythonImportsCheck = [ 47 "agents" 48 ]; 49 - 50 - passthru.updateScript = nix-update-script { }; 51 52 meta = { 53 changelog = "https://github.com/openai/openai-agents-python/releases/tag/${version}";
··· 1 { 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 hatchling, ··· 14 15 buildPythonPackage rec { 16 pname = "openai-agents"; 17 + version = "0.2.3"; 18 pyproject = true; 19 20 src = fetchPypi { 21 inherit version; 22 pname = "openai_agents"; 23 + hash = "sha256-ldStGUxcDPGkADjLcB7ujs2q92mNh7sT48LFz/gMS00="; 24 }; 25 26 build-system = [ 27 hatchling 28 ]; ··· 40 pythonImportsCheck = [ 41 "agents" 42 ]; 43 44 meta = { 45 changelog = "https://github.com/openai/openai-agents-python/releases/tag/${version}";
+5
pkgs/development/python-modules/smolagents/default.nix
··· 141 142 pythonImportsCheck = [ "smolagents" ]; 143 144 disabledTests = [ 145 # Missing dependencies 146 "test_cleanup"
··· 141 142 pythonImportsCheck = [ "smolagents" ]; 143 144 + disabledTestPaths = [ 145 + # ImportError: cannot import name 'require_soundfile' from 'transformers.testing_utils' 146 + "tests/test_types.py" 147 + ]; 148 + 149 disabledTests = [ 150 # Missing dependencies 151 "test_cleanup"
+4
pkgs/servers/home-assistant/default.nix
··· 147 tag = "v${version}"; 148 hash = "sha256-Z2NN6k4mD6NixDON1MUOELpBZW9JvMvFErcCbFPdg2o="; 149 }; 150 }); 151 152 notifications-android-tv = super.notifications-android-tv.overridePythonAttrs (oldAttrs: rec {
··· 147 tag = "v${version}"; 148 hash = "sha256-Z2NN6k4mD6NixDON1MUOELpBZW9JvMvFErcCbFPdg2o="; 149 }; 150 + pytestFlagsArray = [ 151 + "-W" 152 + "ignore::pydantic.warnings.PydanticDeprecatedSince211" 153 + ]; 154 }); 155 156 notifications-android-tv = super.notifications-android-tv.overridePythonAttrs (oldAttrs: rec {