Streamable HTTPトランスポート
MCPを単一のHTTPエンドポイント上で動作させる方法を学びます。
「Streamable HTTPトランスポート」はCoddyKit上の無料MCP Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはMCP Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 MCP Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Meet Streamable HTTP
MCP's modern remote transport is called Streamable HTTP. It lets your server live behind one web URL that any client on the internet can reach.
One Endpoint to Rule Them All
Unlike older designs, Streamable HTTP uses a single endpoint, often something like /mcp. Both requests and replies flow through that one path.
POST https://api.example.com/mcpClients POST Their Messages
To call a tool, the client sends a normal HTTP POST to the endpoint. The body is the same JSON-RPC message you already learned about. 📨
Two Ways to Answer
The server can reply in two shapes: a plain JSON response for quick calls, or an event stream when it wants to send results bit by bit.
The Accept Header Decides
The client's Accept header signals what it can handle. Listing both JSON and the event-stream type lets the server choose the best reply format.
Accept: application/json, text/event-streamIt Is Still JSON-RPC
The transport changed, but the language did not. Every message over HTTP is the same JSON-RPC request, response, or notification you met earlier.
Turning On HTTP in the SDK
With the Python SDK you flip one switch: run your server with the streamable-http transport instead of stdio. The tools stay exactly the same.
mcp.run(transport="streamable-http")It Speaks Plain HTTP
Because it is ordinary HTTP, it plays nicely with the whole web stack: load balancers, proxies, and TLS all work without anything special. 🌐
Stateful or Stateless
Streamable HTTP can run stateful, remembering a session, or stateless, treating each call fresh. You choose based on how your server holds context.
It Replaced an Older Transport
An earlier HTTP+SSE design used two separate paths and was clunkier. Streamable HTTP replaced it as the recommended way to serve MCP remotely.
Why It Matters
This single-endpoint design is what makes a remote MCP server practical to deploy and easy for any client to connect to from anywhere.
Quick Check
How does a client send a tool call over Streamable HTTP?
Recap: Streamable HTTP
Streamable HTTP serves MCP over one HTTP endpoint: clients POST JSON-RPC, and the server answers with JSON or a live event stream. Same logic, remote reach. 🚀
よくある質問
「Streamable HTTPトランスポート」レッスンは無料ですか?
はい。「Streamable HTTPトランスポート」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、MCP Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 MCP Academyコースには全4レッスンが含まれています。
「Streamable HTTPトランスポート」で何を学びますか?
MCPを単一のHTTPエンドポイント上で動作させる方法を学びます。 ブラウザで直接実行するハンズオンコードでMCP Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
MCP Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのMCP Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「Streamable HTTPトランスポート」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このMCP Academyレッスンでコードを書いて実行できますか?
はい。すべてのMCP Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- stdioだけでは不十分な理由
- Streamable HTTPトランスポート
- SSEでレスポンスをストリーミングする
- セッションと再接続