Port Python server to streamable HTTP, structured output #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request refactors the itinerary planning MCP server to use streamable HTTP instead of SSE, plus some tool function improvements.
Besides streamable change, key changes include replacing dictionary-based data structures with
@dataclassmodels, updating dependencies, and simplifying routing by consolidating routes intoapp.py.Dependency Updates:
mcp[cli]dependency from version1.3.0to1.10.1inpyproject.tomlto incorporate the latest features and improvements.Code Refactoring:
@dataclassmodels (Hotel,Flight,Airport, etc.) to improve type safety and readability inmcp_server.py. [1] [2] [3] [4] [5] [6] [7]suggest_hotelsandsuggest_flightsfunctions to use the newly introducedHotelSuggestionsandFlightSuggestionsdata classes. [1] [2]Routing Simplification:
app.pyby removingapp_routes.py. Simplified the route structure and added a homepage route for non-MCP requests. [1] [2]Logging Enhancements:
app.pyto enable better debugging and monitoring of the application.These changes collectively improve the codebase's structure and maintainability while ensuring compatibility with the latest MCP library features.
Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test