Skip to content

Deprecate transport-specific methods on FastMCP server #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2025

Conversation

jlowin
Copy link
Owner

@jlowin jlowin commented May 10, 2025

This adds run_http_async() and http_app() methods to the FastMCP instance, with a transport kwarg, and adds related deprecation notices to run_sse_async(), run_streamable_http_async(), sse_app(), and streamable_http_app() (which still function).

Related to discussion in #396

@Copilot Copilot AI review requested due to automatic review settings May 10, 2025 15:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR deprecates multiple transport‐specific methods on the FastMCP server and introduces a unified API via run_http_async() and http_app() with a transport keyword to select the desired behavior. Key changes include updated tests to use the new API, server-side refactoring of async run methods with deprecation wrappers, and corresponding documentation updates.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

File Description
tests/* Update tests to use http_app() and run_http_async()
src/fastmcp/server/server.py Refactor run_async methods; add run_http_async(); deprecate run_sse_async/run_streamable_http_async
docs/* Adjust deprecation notices, usage examples, and transport descriptions

@jlowin jlowin added documentation Improvements or additions to documentation enhancement New feature or request labels May 10, 2025
@jlowin jlowin merged commit aa6dde4 into main May 10, 2025
5 checks passed
@jlowin jlowin deleted the deprecate-methods branch May 10, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant