From 9cc67eeb70e895670df484e5a09112e0ac4448c2 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sat, 31 May 2025 20:34:14 -0400 Subject: [PATCH] Update src/fastmcp/utilities/http.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/fastmcp/utilities/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fastmcp/utilities/http.py b/src/fastmcp/utilities/http.py index 22c165735..c1237d62e 100644 --- a/src/fastmcp/utilities/http.py +++ b/src/fastmcp/utilities/http.py @@ -3,6 +3,6 @@ import socket def find_available_port() -> int: """Find an available port by letting the OS assign one.""" - with socket.socket() as s: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind(("127.0.0.1", 0)) return s.getsockname()[1]