Skip to content

docs: clarify streamable_http_path configuration when mounting servers #1172

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felixweinberger
Copy link
Contributor

Motivation and Context

Context: #1007 from @tewatia

  • Add StreamableHTTP servers section mirroring SSE servers structure
  • Start with simple mounting examples, then explain path composition
  • Document how to configure streamable_http_path for different scenarios
  • Add inline comments in Starlette mounting example

This addresses confusion around endpoint paths when mounting
FastMCP servers as sub-applications in ASGI frameworks.

How Has This Been Tested?

N/A docs change only

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@felixweinberger felixweinberger force-pushed the docs/streamable-http-path-configuration branch 2 times, most recently from ea3ddeb to a02af0e Compare July 18, 2025 16:33
@felixweinberger felixweinberger marked this pull request as ready for review July 18, 2025 16:36
@felixweinberger felixweinberger requested a review from a team as a code owner July 18, 2025 16:36
@felixweinberger felixweinberger requested a review from Kludex July 18, 2025 16:36
- Add StreamableHTTP servers section mirroring SSE servers structure
- Start with simple mounting examples, then explain path composition
- Document how to configure streamable_http_path for different scenarios
- Add inline comments in Starlette mounting example

This addresses confusion around endpoint paths when mounting
FastMCP servers as sub-applications in ASGI frameworks.
@felixweinberger felixweinberger force-pushed the docs/streamable-http-path-configuration branch from a02af0e to 9392faa Compare July 18, 2025 16:37
Comment on lines +1045 to +1046
# or dynamically mount as host
app.router.routes.append(Host("mcp.acme.corp", app=mcp.streamable_http_app()))
Copy link
Member

Choose a reason for hiding this comment

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

Include the Host above please. No one should include the routes manually as this line.


You can mount the StreamableHTTP server to an existing ASGI server using the `streamable_http_app` method. This allows you to integrate the StreamableHTTP server with other ASGI applications.

<!-- snippet-source examples/snippets/servers/streamable_http_mounting.py -->
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is supposed to be a single big file. There are many examples with different applications here. Can we split them?

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