Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add stateless streamable http mode (#8) #15

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
PeterRodenkirchAA wants to merge 1 commit into pydantic:main
base: main
Choose a base branch
Loading
from PeterRodenkirchAA:feat/stateless-streamable-http-mode

Conversation

Copy link

@PeterRodenkirchAA PeterRodenkirchAA commented Sep 12, 2025
edited
Loading

Related Issue: #8

Why?

The overhead of a stateful streamable HTTP mode might not be necessary for a lot of use cases that submit a simple code execution task via POST request.
We observed some issue with the stateful mode concerning pending GET requests and supporting a stateless mode would simplify the MCP server integration.

What?

  • New mode: streamable_http_stateless

    • Stateless per-request handling: a new MCP server and transport are created for each POST /mcp.
    • GET /mcp and DELETE /mcp return 405 -> server-to-client notifications are not supported.
    • The stateful mode is unaffected
  • CLI and Python API

    • adds streamable-http-stateless as a mode:
      • uvx mcp-run-python streamable-http-stateless --port 3001
  • TypeScript part:

    • runStreamableHttp delegates to:
      • createStatefulHttpServer(...)
      • createStatelessHttpServer(...)
    • Refactored path matching into shared helpers:
      • createPathMatcher(req, url) and pathMatch(req, url)

Usage

  • Stateful:
uvx mcp-run-python streamable-http --port 3001
  • Stateless:
uvx mcp-run-python streamable-http-stateless --port 3001

tradeqvest reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /