Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Update deprecation message

Jeremiah Lowinf0b47376c4ed
diff --git a/src/fastmcp/server/server.py b/src/fastmcp/server/server.py
index 8d7cf4ab6..b17b4ecf0 100644
--- a/src/fastmcp/server/server.py
+++ b/src/fastmcp/server/server.py
@@ -119,9 +119,9 @@ class FastMCP(Generic[LifespanResultT]):
if settings:
# TODO: remove settings. Deprecated since 2.3.4
warnings.warn(
- "Passing transport-specific and other runtime settings as kwargs "
+ "Passing runtime and transport-specific settings as kwargs "
"to the FastMCP constructor is deprecated (as of 2.3.4), "
- "including most transport settings. Provide settings when calling "
+ "including most transport settings. If possible, provide settings when calling "
"run() instead.",
DeprecationWarning,
stacklevel=2,
diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py
index 8085c6e3c..a28bcc4b7 100644
--- a/tests/test_deprecated.py
+++ b/tests/test_deprecated.py
@@ -13,7 +13,7 @@ def test_fastmcp_kwargs_settings_deprecation_warning():
"""Test that passing settings as kwargs to FastMCP raises a deprecation warning."""
with pytest.warns(
DeprecationWarning,
- match="Passing settings as kwargs to the FastMCP constructor is deprecated",
+ match="Passing runtime and transport-specific settings as kwargs to the FastMCP constructor is deprecated",
):
server = FastMCP("TestServer", host="127.0.0.2", port=8001)
assert server.settings.host == "127.0.0.2"