Skip to content

Conversation

PeterRodenkirchAA
Copy link

@PeterRodenkirchAA PeterRodenkirchAA commented Sep 12, 2025

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

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.

1 participant