Merge pull request #677 from jlowin/remove-deprecation

Remove deprecation notice
This commit is contained in:
Jeremiah Lowin 2025-06-02 18:21:51 -04:00 committed by GitHub
commit 181c5d7b9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 21 deletions

View file

@ -131,16 +131,6 @@ class FastMCP(Generic[LifespanResultT]):
tools: list[Tool | Callable[..., Any]] | None = None,
**settings: Any,
):
if settings:
# TODO: remove settings. Deprecated since 2.3.4
warnings.warn(
"Passing runtime and transport-specific settings as kwargs "
"to the FastMCP constructor is deprecated (as of 2.3.4), "
"including most transport settings. If possible, provide settings when calling "
"run() instead.",
DeprecationWarning,
stacklevel=2,
)
self.settings = fastmcp.settings.ServerSettings(**settings)
# If mask_error_details is provided, override the settings value

View file

@ -9,17 +9,6 @@ from starlette.applications import Starlette
from fastmcp import Client, FastMCP
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 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"
assert server.settings.port == 8001
def test_sse_app_deprecation_warning():
"""Test that sse_app raises a deprecation warning."""
server = FastMCP("TestServer")