Skip to content

Port Python server to streamable HTTP, structured output #101

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 10 commits into from
Jul 23, 2025

Conversation

pamelafox
Copy link
Contributor

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 @dataclass models, updating dependencies, and simplifying routing by consolidating routes into app.py.

Dependency Updates:

  • Updated mcp[cli] dependency from version 1.3.0 to 1.10.1 in pyproject.toml to incorporate the latest features and improvements.

Code Refactoring:

  • Replaced dictionary-based data structures with @dataclass models (Hotel, Flight, Airport, etc.) to improve type safety and readability in mcp_server.py. [1] [2] [3] [4] [5] [6] [7]
  • Updated return types for suggest_hotels and suggest_flights functions to use the newly introduced HotelSuggestions and FlightSuggestions data classes. [1] [2]

Routing Simplification:

  • Consolidated all routing logic into app.py by removing app_routes.py. Simplified the route structure and added a homepage route for non-MCP requests. [1] [2]

Logging Enhancements:

  • Introduced a logger in app.py to 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?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • I tested with a local MCP client with a deployed Container App. I am still testing "azd up" with the full project.

@manekinekko manekinekko merged commit 18ac832 into main Jul 23, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy