Remove 3.x deprecated module shims and dead parameters - #4447
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9617c9db2a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
|
|
||
| # Re-export from new canonical location | ||
| from fastmcp.server.providers.openapi import ( # noqa: E402 |
There was a problem hiding this comment.
Update tags example before dropping the OpenAPI shim
With this shim gone, a repo-wide search still finds examples/tags_example.py importing MCPType and RouteMap from fastmcp.server.openapi; in a normal dev/example environment with FastAPI installed, running that example now fails at import time because the module no longer exists. Please update the example to import from fastmcp.server.providers.openapi as part of this removal.
Useful? React with 👍 / 👎.
| from fastmcp.apps.config import AppConfig as AppConfig | ||
| from fastmcp.apps.config import ResourceCSP as ResourceCSP |
There was a problem hiding this comment.
Update QR app example before dropping the apps shim
After deleting this compatibility module, examples/apps/qr_server/qr_server.py still imports AppConfig and ResourceCSP from fastmcp.server.apps; once the example's declared qrcode dependency is installed, the server fails before startup with ModuleNotFoundError. Please switch that example to from fastmcp.apps import AppConfig, ResourceCSP before removing the shim.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f216142807
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| **Module import paths for proxy and OpenAPI** | ||
|
|
||
| The proxy and OpenAPI modules have moved under `providers` to reflect v3's provider-based architecture: | ||
| The proxy and OpenAPI modules moved under `providers` to reflect v3's provider-based architecture. The old `fastmcp.server.proxy` and `fastmcp.server.openapi` compatibility shims were **removed in 4.0** — import from the `providers` location instead: |
There was a problem hiding this comment.
Move removed shims out of deprecated features
This now documents fastmcp.server.proxy / fastmcp.server.openapi as removed, but it still lives under ### Deprecated Features, whose intro says these still work and only emit warnings. In a 4.0 upgrade those imports now raise ModuleNotFoundError, so readers can wrongly treat a required migration as optional cleanup; please move this subsection to a breaking/removed-features section or adjust the section intro.
Useful? React with 👍 / 👎.
Tier 2 aggressive-window removal: these shims were deprecated in 3.2, a shorter deprecation window than the usual policy. Canonical imports are fastmcp.apps / fastmcp.FastMCPApp.
Use the PromptsAsTools / ResourcesAsTools transforms instead. The non-deprecated ToolInjectionMiddleware base class is retained.
Tier 2 aggressive-window removal: the parameter was a deprecated no-op on the streamable-HTTP transport (the SDK v2 client no longer supports it). SSETransport still accepts sse_read_timeout.
f216142 to
14373cc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14373cc60b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ### `FastMCP` server methods and `mount()` kwargs | ||
|
|
||
| The following `FastMCP` methods and parameters, deprecated since 3.0, are removed: |
There was a problem hiding this comment.
Align removal notes with implemented removals
This says the FastMCP methods/kwargs are already hard-removed, but this tree still defines the deprecated implementations for add_tool_transformation, import_server, mount(prefix/as_proxy), and as_proxy in fastmcp_slim/fastmcp/server/server.py (and deprecated tests still exercise import_server). In the 4.0 upgrade notes this turns still-working warning-only APIs into mandatory migrations on paper, while the actual removals in this commit are limited to the shim modules/middleware/http arg; please either land these removals in this batch or keep this subsection as future/deprecated.
Useful? React with 👍 / 👎.
First batch of FastMCP 4.0 deprecation removals: the pure re-export shims and dead surface deprecated in the 3.x line, all with replacements long shipped. Removed: the
fastmcp.server.proxyshim (3.0 →fastmcp.server.providers.proxy), the fourfastmcp.server.openapishims including the deprecatedFastMCPOpenAPIclass (3.0 →OpenAPIProvider), the experimental openapi shims (2.14), thefastmcp.server.apps/server.appshims (3.2 →fastmcp.apps— a shorter deprecation window, noted deliberately for 4.0), the deprecatedPromptToolMiddleware/ResourceToolMiddlewarepair (3.1 →PromptsAsTools/ResourcesAsToolstransforms), and the no-opsse_read_timeoutparameter onStreamableHttpTransport.Two things the sweep surfaced along the way:
tool_injection.pyalso houses the non-deprecatedToolInjectionMiddlewarebase class, which stays (removal was scoped to the two deprecated subclasses), andmcp_config.pywas still passing the no-opsse_read_timeoutinto the streamable transport — that dead argument is gone too, while the SSE transport's legitimate use of the config field is untouched.Upgrade-guide entries now state the removals with their migration paths, and the v4 change register gained a "Removed in 4.0" section. Net: ~740 lines deleted.
Label: breaking change, v4.