AI Hints
Home›MCP Tutorial›Streamable HTTP
MCP · Lesson 67 of 120

Streamable HTTP

Servers on the web.

⏱ 2 min read▶ Video at 59:25🎓 Free
Watch this lesson in the MCP courseWatch on YouTube ↗Full MCP course

Standard IO works for servers on your own machine. To share a server with many users, or run it in the cloud, we use streamable HTTP. The server listens on a web address, and clients connect by URL.

Streamable HTTP
From the video: Streamable HTTP
  • stdio: one machine
  • HTTP: the web
  • Connect by URL

http_server.py

Switching transports is one line. We import the same Northwind server, and run it with the streamable HTTP transport, on port eight thousand. Clients then connect to slash MCP on that port.

http_server.pypython
from northwind import mcp

if __name__ == "__main__":
    mcp.run(transport="streamable-http", port=8000)
    # clients connect to http://localhost:8000/mcp

How it works

Every client message is an HTTP post to one endpoint. The server answers with JSON, or with a stream of events for long jobs. Many clients can connect at the same time.

keyvalue
Endpoint/mcp
RequestsHTTP POST
RepliesJSON or a stream
Clientsmany at once

Summary

Streamable HTTP puts your server on the web, at one endpoint. Next, connecting by URL.

Key takeaways
  • streamable-http
  • port 8000
  • /mcp
Next up: Connecting by URL — the HTTP client