Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:8beeeaaat Touchdesigner mcp Stateless Streamable HTTP

From Leeroopedia
Knowledge Sources
Domains HTTP_Transport, Server_Lifecycle
Last Updated 2026-10-28 00:00 GMT

Overview

A stateless HTTP transport pattern where every MCP request is served by a fresh server instance from a factory, with no protocol-level sessions or session IDs, and with DNS-rebinding protection built into the Express app.

Description

Under MCP protocol revision 2026-07-28, protocol-level sessions were removed: there is no Mcp-Session-Id header, and GET/DELETE on the endpoint return 405. The stateless streamable HTTP pattern embraces this by creating a new McpServer per request via a factory, served by createMcpHandler which speaks the 2026-07-28 revision and transparently falls back to stateless 2025-era serving on the same endpoint. The Express app is created by the SDK's createMcpExpressApp which adds DNS-rebinding protection for localhost. The manager owns the HTTP server lifecycle: start mounts the handler on `/mcp` and a health check on `/health`; stop closes the MCP handler first (ending open subscription streams) then the HTTP server.

Usage

Use this principle when serving MCP over HTTP and you want horizontal scalability (any request can go to any worker) without session affinity.

Theoretical Basis

// Abstract algorithm (NOT real implementation)
async function start(config, factory, logger) {
  handler = createMcpHandler(() => factory()); // per-request server
  app = createMcpExpressApp({ host: config.host }); // DNS rebinding guard
  app.all(config.endpoint, (req, res) => handler(req, res, req.body));
  app.get("/health", (_, res) => res.json({ status: "ok" }));
  server = app.listen(config.port, config.host);
}
async function stop() {
  await handler.close();  // end subscription streams first
  await server.close();
}

Key properties:

  • No session state: every request is independent.
  • Protocol-era fallback: 2026 and 2025 clients share one endpoint.
  • Graceful shutdown: handler closed before HTTP server.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment