Streamable HTTP
local graph
Chapter 5 — Streamable HTTP
Section titled “Chapter 5 — Streamable HTTP”In Chapter 4, we discussed building MCP servers with the Server-Sent Events (SSE) transport. In that chapter, you learned that if you want users to access your MCP server on the web, you can’t use STDIO, but instead you need to use a transport such as SSE or, as described in this chapter, Streamable HTTP.
So, in this chapter, you will learn about the following:
- The Streamable HTTP transport
- Why this transport should be used over SSE
- How to work with concepts such as notifications and resumability
The chapter covers the following topics:
- Streamable HTTP versus SSE, and why it is the new standard
- Streamable HTTP in MCP
- Resumability
- Notifications
- Creating and testing a server with Streamable HTTP
- Testing the server
- Testing resumability
Streamable HTTP versus SSE, and why it is the new standard
Section titled “Streamable HTTP versus SSE, and why it is the new standard”The differences between SSE and Streamable HTTP are important to understand when choosing the right technology for your application.
There are some key distinctions. The first reason is that SSE in MCP is considered deprecated; you should be using Streamable HTTP instead.
So, why is there a chapter called SSE in this book? The reason is that this book is written for you as both a developer of MCP servers and also as a consumer of servers, where you might be writing a client toward an existing server that might be using SSE. In short, you should know how to deal with both types of transport due to there being legacy code that you might be asked to work with. In fact, the article at https://github.com/modelcontextprotocol/modelcontextprotocol/discussions/308 states that 20 reference servers, over 50 official integrations, and 186 community-developed servers and clients were using SSE when it was announced that it was deprecated. This means when you develop for MCP, ensure you keep in mind that you need to handle both SSE and Streamable HTTP, even if you develop new servers in Streamable HTTP.
Okay, but why the deprecation decision? Well, there are several reasons why Streamable HTTP is a better choice:
- Single endpoint simplicity: Clients and servers communicate via a single endpoint (e.g.,
/mcp), supporting bothPOSTandGETmethods. This simplifies implementation and reduces connection overhead. - Resumability support: Streamable HTTP supports resumable sessions using headers such as
Last-Event-IDandMcp-Session-ID, allowing clients to reconnect and resume streams reliably. This is a powerful feature where, when clients lose connection, they can resume connection and start receiving data from where they were before the disconnect rather than starting from the beginning. - Better compatibility: It works seamlessly with modern HTTP infrastructure—load balancers, proxies, and API gateways—where SSE often fails or requires workarounds.
- Bidirectional communication: While SSE is unidirectional, Streamable HTTP can be upgraded to support bidirectional flows, making it more versatile for agent-to-agent or client-server interactions.
- Future-proofing: Streamable HTTP aligns with evolving MCP standards and community best practices. It’s modular, extensible, and designed for stateless or session-based models. Stateless servers are more lightweight and easier to construct, and being able to choose the right model for the right scenario is a compelling argument.
Streamable HTTP in MCP
Section titled “Streamable HTTP in MCP”Okay, so normally when we’re talking about streaming, some of you might think of how you divide up files in chunks or how you have AI models return their response in smaller parts. However, in the context of MCP, streaming is more about how we transmit data over HTTP while following the streamable standard, meaning that clients using Streamable HTTP typically send the following Accept header: Accept: application/json, text/event-stream.
This tells the server the client can handle both batch JSON responses and streamed events (via SSE). The server can choose the appropriate response mode based on the request type and context.
Is that it, streaming that just sends simple responses? There’s a bit more to it, namely, resumability.
Resumability
Section titled “Resumability”Resumability is a concept that means that, if a client loses connection with a server while data is being transferred, upon reconnecting with the server, it can resume the data exchange where it was, rather than starting from the beginning. For long-running operations, this can be a game-changer. Technically, resumability can be achieved by both SSE and Streamable HTTP, but within the context of the MCP protocol, it’s only supported for Streamable HTTP.
Let’s illustrate it with a diagram:

Figure 5.1 – Resumability
Figure 5.1 – Resumability
As you can see from the preceding diagram, the client doesn’t have to restart from the beginning but can resume where they were. This works because the client, upon reconnecting, sends mcp-session-id and last-event-id headers. It’s important to note that upon disconnecting, the client needs to do so gracefully, so it stores these two headers for later use.
What needs to be done on the server side to support this, though? Well, the server needs to do the following for resumability to work:
- Create a session store, which is where produced messages are placed.
- Set up a middleware that handles incoming requests and outgoing responses to ensure messages are properly stored and can be retrieved for resuming sessions. Exactly how this happens differs between frameworks:
# 1. Creates an in-memory store, you should use a persistent store in a production scenarioevent_store = InMemoryEventStore()# 2. Create the session manager with our app and event storesession_manager = StreamableHTTPSessionManager(app=app,event_store=event_store, # Enable resumabilityjson_response=json_response,)# 3. Starts a session manager@contextlib.asynccontextmanagerasync def lifespan(app: Starlette) -> AsyncIterator[None]:"""Context manager for managing sessionmanager lifecycle."""async with session_manager.run():logger.info("Application started withStreamableHTTP session manager!")try:yieldfinally:logger.info("Application shutting down…")# 4. Creating the web server and assigning a lifespan handlerstarlette_app = Starlette(debug=True,routes=[Mount("/mcp", app=handle_streamable_http),],lifespan=lifespan,)
(1) to quickly copy code into your coding environment, or click the Explain button
(2) to get the AI assistant to explain a block of code to you.

A white background with a black text AI-generated content may be incorrect.
Let’s break down this code:
- We start by creating a session store that will help store and retrieve messages.
- Then, we create a session manager that controls the access to the store of the
StreamableHTTPSessionManagertype. - We start the session manager and create the web server with the appropriate lifespan handler.
- Finally, we create the web server and assign the lifespan handler.
There, everything is set up, and any client can now connect to the server and start a session.
Okay, now that we understand a bit more about how resumability can really improve the user experience, as the client can get messages where they were when the disconnect happened, let’s talk about another concept, namely, notifications.
Notifications
Section titled “Notifications”Notifications are not a concept unique to Streamable HTTP but can also be used in SSE. However, paired with resumability, they suddenly become very powerful. Let’s describe what they are first and then discuss how they relate to resumability.
Notifications come in many different forms to communicate that something important has happened. They are real-time updates and, for the sake of the SDK, are handled as a separate thing. That means the SDK provides a special way to listen to notifications by implementing a handler for them, as you will soon see.
Here are some scenarios where notifications make sense:
- Status updates
- Progress notifications
- Error messages
- Informational messages
For example, the final message sent from the client to the server is a notification called notifications/initialized and signals that the client and the server can exchange non-handshake messages and more normal operations such as listing tools, reading a resource, and so on. The following is the JSON-RPC shape of the notifications/initialized message:
{ "jsonrpc": "2.0", "method": "notifications/initialized"}Producing a notification
Section titled “Producing a notification”How do we produce a notification? Well, a notification is nothing more than a JSON-RPC message, and your SDK usually has a dedicated method to make it easier to send notifications. As there are different types of notifications, it’s more a matter of using the right method with the appropriate parameters.
To produce a notification, we need a reference to the context object, which we can add as an input parameter in our tool, for example. Once we have that reference, we can call specific notification methods such as debug, info, warning, and error. Each method has its own purpose, such as sending debug info, informational messages, warning messages, and error messages:
from mcp.server.session import ServerSession# 1. Get a hold of the context object@mcp.tool(description="A simple tool returning file content")async def echo(message: str, ctx: ctx: Context[ServerSession, None]) -> str: # 2. Select the appropriate method for sending the correct notification type await ctx.debug(f"Debug: Processing '{data}'") await ctx.info("Info: Starting processing") await ctx.warning("Warning: This is experimental") await ctx.error("Error: (This is just a demo)") return "Final result"In this code, the echo tool will produce four different notifications and a final result.
Handling a notification
Section titled “Handling a notification”When you consume notifications as a client, they show up in a different place than where you would normally expect them. Instead of being part of the regular message flow, they are handled separately with their own callbacks:
# 1. Define the message handlerdef message_handler( message: RequestResponder[types.ServerRequest, types.ClientResult] | types.ServerNotification | Exception,) -> None: print("Received message:", message) if isinstance(message, Exception): raise message else: if isinstance(message, types.ServerNotification): print("NOTIFICATION:", message) elif isinstance(message, RequestResponder): print("REQUEST_RESPONDER:", message) else: print("SERVER_REQUEST:", message)# 2. Create the client session and assign message handler to message_handler propertyasync with ClientSession( read_stream, write_stream,
message_handler=message_handler,) as session: await session.initialize() print("Session initialized, ready to call tools.") # Call a tool tool_result = await session.call_tool("echo", {"message": "hello"})In this client, we do the following:
- Define the message handler; the handler is capable of taking different types of messages and processing them accordingly.
- Create the client session and assign a message handler to the
message_handlerproperty.
We also observe that normal feature responses, such as calling a tool or reading a resource, are handled the normal way, whereas notifications are dealt with via the message handler, message_handler.
Notifications in the Inspector tool
Section titled “Notifications in the Inspector tool”Great, now that we have a sense for how to set up sending notifications and receiving them, let’s see how notifications appear in our Inspector tool, as we need to learn to look for them in the right place.
If you start the Inspector tool in a visual mode, you will see a screen like this:

Figure 5.2 – Inspector tool
Figure 5.2 – Inspector tool
Now, if you run a tool, you will see the tool result, and you will see an area below it showing notifications, like so:

Figure 5.3 – Notifications
Figure 5.3 – Notifications
Notifications with resumability
Section titled “Notifications with resumability”As we said before, notifications can be sent with SSE and Streamable HTTP, but with the latter, it becomes extra important. Imagine you have a client that disconnects a number of times due to a spotty internet connection, but thanks to logic in the client performing reconnects and resumability support in the server, the end user still has a good experience, as they won’t miss out on either notifications or normal messages, such as a tool response, for example.
Now, let’s move on to creating a server.
Creating and testing a server with Streamable HTTP
Section titled “Creating and testing a server with Streamable HTTP”Let’s create a server, and in doing so, we’ll also integrate notifications. After the server is built, in the next section, we’ll try testing it out with the different tools we have at our disposal, such as writing our own client, using the Inspector tool, and testing with cURL.
To create the server code, there are a few things we need to do:
- Set up the transport as Streamable HTTP.
- Add features.
- Add code that sends notifications when a tool is called.
Great, now that we have our plan in place, let’s implement it. Here’s an attempt to implement the first two points of our plan:
from mcp.server.fastmcp import FastMCP, Contextfrom typing import Optional, Dict, Any, List, AsyncGeneratorfrom mcp.types import ( LoggingMessageNotificationParams, TextContent)# Create an MCP servermcp = FastMCP("Streamable DEMO")# 2. Adding features@mcp.tool(description="A simple tool returning file content")async def echo(message: str, ctx: Context) -> str: return f"Here's the file content: {message}"# 1. Set up the transport as streamable HTTP.mcp.run(transport="streamable-http")To add sending notifications, we need to add the Context object to our method signature, like so:
@mcp.tool(description="A simple tool returning file content")async def echo(message: str, ctx: Context) -> str:Let’s finally add the part in the tool where it produces a notification using the Context object:
@mcp.tool(description="A simple tool returning file content")async def echo(message: str, ctx: Context) -> str: # 3. Send a notification await ctx.info(f"Processing file 1/3:") await ctx.info(f"Processing file 2/3:") await ctx.info(f"Processing file 3/3:") return f"Here's the file content: {message}"Our full code now looks like this:
from mcp.server.fastmcp import FastMCP, Contextfrom typing import Optional, Dict, Any, List, AsyncGeneratorfrom mcp.types import ( LoggingMessageNotificationParams, TextContent)# Create an MCP servermcp = FastMCP("Streamable DEMO")# 2. Adding features@mcp.tool(description="A simple tool returning file content")async def echo(message: str, ctx: Context) -> str: # 3. Send a notification await ctx.info(f"Processing file 1/3:") await ctx.info(f"Processing file 2/3:") await ctx.info(f"Processing file 3/3:") return f"Here's the file content: {message}"# 1. Set up the transport as streamable HTTP.mcp.run(transport="streamable-http")Let’s look at testing our server next.
Testing the server
Section titled “Testing the server”As always, we have different choices to try out the server functionality:
- Creating a client
- Using the Inspector tool
- Testing with cURL
Let’s try out each of these options.
Using the Inspector tool
Section titled “Using the Inspector tool”We covered the Inspector tool earlier in this chapter, but let’s quickly remind ourselves how it works with our newly created server. We can call the Inspector tool like so to start up a web server. Select the following fields:
- Transport Type: HTTP
- Server URL:
http://localhost:8000/mcp(adjust the port if necessary)
Click the Connect button to connect to the server so you can use its features and then enter the following:
npx @modelcontextprotocol/inspectorAs you can see, it’s very similar to testing SSE servers; just change the transport type and make sure your URL has /mcp at the end instead of /sse.
Testing with cURL
Section titled “Testing with cURL”We introduced cURL in the previous chapter; we can use it here as well. To get a session ID, you will need to send an initialize message. The message should contain what capabilities you support, such as tools, for example.
Here’s the message you need to send:
curl -X POST "http://127.0.0.1:8000/mcp" -H "Accept: text/event-stream, application/json" -H "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-03-26", "capabilities": { "tools": {} }, "clientInfo": { "name": "ExampleClient", "version": "1.0.0" } }}'Note that you need to send Accept headers and content type. Make a note of the session ID returned, as you will use it for all remaining calls.
Create a second terminal window and then run the following command, but replace the mcp-session-id value with the session ID you got back in the previous step:
curl -X POST "http://127.0.0.1:8000/mcp" -H "Content-Type: application/json" -H "Accept: text/event-stream, application/json" -H "mcp-session-id: 39a0b504364140ce97d8eded79b1c244" -d '{ "jsonrpc": "2.0", "method": "notifications/initialized"}'Note how the session ID isn’t a query parameter called session_id anymore, but a header value called mcp-session-id. The message you sent was a notification of the notifications/initialized type, meaning it’s the last message of the handshake process. After this message, we can now do more normal things, such as listing tools, calling them, and so on, so let’s do that next.
Replace the value for mcp-session-id and keep using the second terminal window, and then run the following command:
curl -X POST "http://127.0.0.1:8000/mcp" -H "Content-Type: application/json" -H "Accept: text/event-stream, application/json" -H "mcp-session-id: 39a0b504364140ce97d8eded79b1c244" -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "echo", "arguments": { "message": "chris" } }}'In this message of the tools/call type, we call a specific tool, echo, with the chris argument, and we should see a tool response similar to the following:
event: messagedata: {"method":"notifications/message","params":{"level":"info","data":"Processing file 1/3:"},"jsonrpc":"2.0"}event: messagedata: {"method":"notifications/message","params":{"level":"info","data":"Processing file 2/3:"},"jsonrpc":"2.0"}event: messagedata: {"method":"notifications/message","params":{"level":"info","data":"Processing file 3/3:"},"jsonrpc":"2.0"}event: messagedata: {"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"Here's the file content: chris"}],"structuredContent":{"result":"Here's the file content: chris"},"isError":false}}This response, in the second terminal window, says we got three notifications and a final tool response, which shows that our MCP server works as intended.
As you can see, both Inspector and cURL are good tools to use for testing out your server. Building a client, however, might be how we end up integrating our MCP server in a working solution, so let’s look at that in our next section.
Creating a client to handle notifications
Section titled “Creating a client to handle notifications”Let’s talk about the client. Clients generally need to be instructed to also handle notifications. This is something that’s seen as an extra thing needed in addition to the normal features. Let’s work out an implementation plan next. Let’s define our plan first:
- Create a streamable HTTP transport and client.
- Set up a notification handler.
- Call a tool.
Addressing the first point in our plan, our code looks like so:
# 1. Create a streamable HTTP transport and clientasync with streamablehttp_client(f"http://localhost:{port}/mcp") as ( read_stream, write_stream, session_callback, ): # Create a session using the client streams async with ClientSession( read_stream, write_stream ) as session:Here, we use the streamablehttp_client function to create a Streamable HTTP client. Thereafter, we create a client instance by initiating ClientSession.
To support incoming notifications, we need to configure the client session by assigning it a function to a property called message_handler, like so:
# 2. Set up a notification handlerasync def message_handler( message: RequestResponder[types.ServerRequest, types.ClientResult] | types.ServerNotification | Exception, ) -> None: print("Received message:", message) if isinstance(message, Exception): raise message else: if isinstance(message, types.ServerNotification): print("NOTIFICATION:", message) elif isinstance(message, RequestResponder): print("REQUEST_RESPONDER:", message) else: print("SERVER_REQUEST:", message)# omitted code for brevityasync with ClientSession( read_stream, write_stream, message_handler=message_handler, ) as session:Note how message_handler is assigned to ClientSession and how it points to a function called message_handler. The said function handles incoming messages and prints them out.
That’s it, that’s all we need to create a Streamable HTTP client and also support incoming notifications. Let’s have a look at the full code:
from mcp.client.streamable_http import streamablehttp_clientfrom mcp import ClientSessionimport asynciofrom typing import Optional, Dict, Any, Listimport mcp.types as typesfrom mcp.types import ( LoggingMessageNotificationParams, TextContent,)from mcp.shared.session import RequestResponderport = 8000# I get normal messages, notifications, and exceptions# 2. Set up a notification handlerasync def message_handler( message: RequestResponder[types.ServerRequest, types.ClientResult] | types.ServerNotification | Exception, ) -> None: print("Received message:", message) if isinstance(message, Exception): raise messageasync def main(): print("Starting client...")
# 1. Create a streamable HTTP transport and client async with streamablehttp_client(f"http://localhost:{port}/mcp") as ( read_stream, write_stream, session_callback, ): # 2. Set up a notification handler async with ClientSession( read_stream, write_stream, message_handler=message_handler, ) as session: # Initialize the connection await session.initialize()
# 3. Call a tool results = [] tool_result = await session.call_tool("echo", {"message": "hello"}) print("Tool result:", tool_result)
asyncio.run(main())Now, if we run the client, it will tell us that the notifications are indeed notifications:
NOTIFICATION: root=LoggingMessageNotification(method='notifications/message', params=LoggingMessageNotificationParams(meta=None, level='info', logger=None, data='Processing file 3/3:'), jsonrpc='2.0')The conclusion is that by using the message_handler method, we can capture all messages, notifications, and exceptions that are sent from the server. This allows us to handle them appropriately and provide feedback to the user.
Testing out resumability
Section titled “Testing out resumability”There’s actually an example implementation in the SDK for resumability. Let’s try that code out and see how it differs. You can find a simplified version of it at https://github.com/PacktPublishing/Learn-Model-Context-Protocol-with-Python/blob/main/Chapter05/solutions/resumability/README.md.
What the code does is define a server with one tool, process-files. Upon calling the tool, you get three notifications and one final response. The easiest way to test the server out is by using cURL. With cURL, we can perform the handshake process, call a tool, and even do the needed bespoke request so it replays events. Let’s take it step by step:
- Start the server first.
- Start a second terminal and call
curlwith the following payload to exchange what features the client and the server both have:curl -X POST "http://127.0.0.1:8000/mcp" -H "Accept: text/event-stream, application/json" -H "Content-Type: application/json" -d '{"jsonrpc": "2.0","id": 1,"method": "initialize","params": { "protocolVersion": "2025-03-26", "capabilities": { "tools": {}, "logging": {} }, "clientInfo": { "name": "ExampleClient", "version": "1.0.0" } }}'
Check the terminal response in the first terminal window. You should see the server display session ID; copy that field for later use.
- End the server-client handshake by sending an
initializednotification; replace themcp-session-idvalue with the value you just copied in the previous step:curl -X POST "http://127.0.0.1:8000/mcp" -H "Content-Type: application/json" -H "Accept: text/event-stream, application/json" -H "mcp-session-id: 957f11af-4766-4c1c-a1f2-5bd6776cca6a" -d '{"jsonrpc": "2.0","method": "notifications/initialized"}' - Call the tool by pasting the following command in the second terminal window, making sure to replace the
"mcp-session-id"value first:curl -X POST "http://127.0.0.1:8000/mcp" -H "Content-Type: application/json" -H "Accept: text/event-stream, application/json" -H "mcp-session-id: 957f11af-4766-4c1c-a1f2-5bd6776cca6a" -d '{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "process-files","arguments": { "message": "chris" }}}'
At this point, you should see a bunch of notifications and the final result in the second terminal window, like so:
event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976937_z6m5xbycdata: {"method":"notifications/message","params":{"level":"info","data":"sales1.csv processed"},"jsonrpc":"2.0"}event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976940_meh2n52fdata: {"method":"notifications/message","params":{"level":"info","data":"sales2.csv processed"},"jsonrpc":"2.0"}event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976943_e3v55tmndata: {"method":"notifications/message","params":{"level":"info","data":"sales3.csv processed"},"jsonrpc":"2.0"}event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976946_sgpvardtdata: {"result":{"content":[{"type":"text","text":"Files processed: 3"}]},"jsonrpc":"2.0","id":1}Let’s focus on the following message, a notification that says we’re on file 2/3. Imagine we went into a tunnel and lost network connection. Make note of the ID, as this ID is the last you saw before losing connection:
event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976940_meh2n52fdata: {"method":"notifications/message","params":{"level":"info","data":"sales2.csv processed"},"jsonrpc":"2.0"}- In our final step, we need to send a
GETrequest to the/mcpendpoint with the session ID and last event ID passed in the headers. That should lead to the server replaying all messages that we missed out on, which should be thesales3.csvfile notification and the final tool result. Remember to replace bothmcp-session-idandlast-event-idbefore you paste the following in the second terminal window:curl "http://127.0.0.1:8000/mcp" -H "Content-Type: application/json" -H "Accept: text/event-stream, application/json" -H "mcp-session-id: 957f11af-4766-4c1c-a1f2-5bd6776cca6a" -H "last-event-id: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976940_meh2n52f"
Pasting this result means you should see the following in the second terminal window:
event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976943_e3v55tmndata: {"method":"notifications/message","params":{"level":"info","data":"sales3.csv processed"},"jsonrpc":"2.0"}event: messageid: 3a9d76c3-36d8-45f3-bd6e-8b9c82826de8_1757284976946_sgpvardtdata: {"result":{"content":[{"type":"text","text":"Files processed: 3"}]},"jsonrpc":"2.0","id":1}Our one missing notification and the tool result! Isn’t that great? We didn’t lose any messages.
It should be said, though, that if you write code that can leverage replayability, you should listen to browser events when you lose network connection, so you have a chance to save the session ID and last event ID, and remember to call the server with GET /mcp rather than POST /mcp, as the latter would start a new session.
Also, if you use the event store I’m using, remember it’s not good for production and that it would need to persist the message in a database or similar to be deemed production-ready.
Summary
Section titled “Summary”In this chapter, we explored the concept of Streamable HTTP and how it differs from SSE. We learned that streaming allows for real-time data transmission, which is beneficial for applications that require immediate access to data, such as live events or large files.
Additionally, we implemented an MCP server that supports Streamable HTTP and demonstrated how to consume streaming data using the MCP SDK. We also discussed the importance of notifications in providing real-time updates to clients and how to handle them effectively.
In the next chapter, we’ll explain how you can use a low-level server API, as there are some use cases where you might want to do that.
Assignment
Section titled “Assignment”For this assignment, we’ll again focus on e-commerce. Imagine you have CSV files on the server that need processing. Processing happens when all CSV files on a server are sent one by one as input to a web API. The idea is that this process will be kicked off by calling a tool. Imagine the following program output:
Type command> process-filesNotification: info - sales.csv processedNotification: info - sales.csv processedNotification: info - sales.csv processedFiles processed: 3Type command> process-filesFiles processed: 0The point of this assignment is to learn how to use notifications. The files can be a list of in-memory entries that get removed as they’re processed. You will need to create both a server, where the files to process are, and a client that can process input commands.
Solution
Section titled “Solution”You can access the solution at https://github.com/PacktPublishing/Learn-Model-Context-Protocol-with-Python/blob/main/Chapter05/solutions/README.md.
What is the primary benefit of using Streamable HTTP?
- A: It allows for faster access to data
- B: It requires fewer server resources
- C: It is more secure than other protocols
How does Streamable HTTP differ from SSE?
- A: Streamable HTTP uses a text-based format, while SSE uses JSON.
- B: Streamable HTTP can send binary data, while SSE is limited to text.
- C: Streamable HTTP is unidirectional, while SSE is bidirectional.
You can access the solution at https://github.com/PacktPublishing/Learn-Model-Context-Protocol-with-Python/blob/main/Chapter05/solutions/solution-quiz.md.
References
Section titled “References”- Streaming transport: https://mcp-framework.com/docs/Transports/http-stream-transport/