Skip to content

Commit 0b78a96

Browse files
Copilotsoftchris
andcommitted
Complete editorial fixes: remove numbered headers, convert h4 to h3, add lead-in sentences
Co-authored-by: softchris <4598064+softchris@users.noreply.github.com>
1 parent f03a98c commit 0b78a96

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

03-GettingStarted/06-http-streaming/README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ This chapter provides a comprehensive guide to implementing secure, scalable, an
44

55
---
66

7-
## 1. Transport Mechanisms and Streaming in MCP
7+
## Transport Mechanisms and Streaming in MCP
8+
9+
This section explores the different transport mechanisms available in MCP and their role in enabling streaming capabilities for real-time communication between clients and servers.
810

911
### What is a Transport Mechanism?
1012
A transport mechanism defines how data is exchanged between the client and server. MCP supports multiple transport types to suit different environments and requirements:
@@ -13,7 +15,7 @@ A transport mechanism defines how data is exchanged between the client and serve
1315
- **SSE (Server-Sent Events)**: Allows servers to push real-time updates to clients over HTTP. Good for web UIs, but limited in scalability and flexibility.
1416
- **Streamable HTTP**: Modern HTTP-based streaming transport, supporting notifications and better scalability. Recommended for most production and cloud scenarios.
1517

16-
#### Comparison Table
18+
### Comparison Table
1719
| Transport | Real-time Updates | Streaming | Scalability | Use Case |
1820
|-------------------|------------------|-----------|-------------|-------------------------|
1921
| stdio | No | No | Low | Local CLI tools |
@@ -24,20 +26,20 @@ A transport mechanism defines how data is exchanged between the client and serve
2426
2527
---
2628

27-
## 2. Streaming: Concepts and Motivation
29+
## Streaming: Concepts and Motivation
2830

2931
**Streaming** is a technique in network programming that allows data to be sent and received in small, manageable chunks or as a sequence of events, rather than waiting for an entire response to be ready. This is especially useful for:
3032

3133
- Large files or datasets
3234
- Real-time updates (e.g., chat, progress bars)
3335
- Long-running computations where you want to keep the user informed
3436

35-
#### Key Concepts
37+
### Key Concepts
3638
- Data is delivered progressively, not all at once
3739
- The client can process data as it arrives
3840
- Reduces perceived latency and improves user experience
3941

40-
#### Why use streaming?
42+
### Why use streaming?
4143
- Users get feedback immediately, not just at the end
4244
- Enables real-time applications and responsive UIs
4345
- More efficient use of network and compute resources
@@ -124,16 +126,18 @@ Based on what we've observed:
124126

125127
---
126128

127-
## 3. Streaming in MCP
129+
## Streaming in MCP
130+
131+
Understanding how streaming works within the MCP framework is essential for building responsive applications that provide real-time feedback to users during long-running operations.
128132

129133
In MCP, streaming is not about sending the main response in chunks, but about sending **notifications** to the client while a tool is processing a request. These notifications can include progress updates, logs, or other events.
130134

131-
#### Key differences from traditional streaming
135+
### Key differences from traditional streaming
132136
- The main result is still sent as a single response
133137
- Notifications are sent as separate messages during processing
134138
- The client must be able to handle and display these notifications
135139

136-
#### What is a Notification?
140+
### What is a Notification?
137141
A notification is a message sent from the server to the client to inform about progress, status, or other events during a long-running operation. Notifications improve transparency and user experience.
138142

139143
##### Why use notifications?
@@ -143,7 +147,9 @@ A notification is a message sent from the server to the client to inform about p
143147

144148
---
145149

146-
## 4. Implementing Notifications in MCP
150+
## Implementing Notifications in MCP
151+
152+
This section demonstrates how to implement real-time notifications in your MCP applications, covering both server-side notification sending and client-side message handling.
147153

148154
### Server-side: Sending Notifications
149155
To send notifications from your MCP tool, use the context object (usually `ctx`) to call methods like `ctx.info()` or `ctx.log()`. These send messages to the client as the server processes a request.
@@ -172,7 +178,9 @@ To enable notifications, ensure your server uses a streaming transport (like `st
172178

173179
---
174180

175-
## 5. Streamable HTTP Transport
181+
## Streamable HTTP Transport
182+
183+
This section provides detailed coverage of Streamable HTTP, the recommended transport mechanism for production MCP deployments, including its architecture, benefits, and implementation details.
176184

177185
### What is Streamable HTTP?
178186
Streamable HTTP is a transport mechanism in MCP that uses HTTP POST requests and supports streaming notifications (such as progress updates) from the server to the client. It is designed for modern web and cloud environments.
@@ -200,7 +208,9 @@ Streamable HTTP is a transport mechanism in MCP that uses HTTP POST requests and
200208

201209
---
202210

203-
## 6. Security Considerations
211+
## Security Considerations
212+
213+
When implementing MCP servers with HTTP-based transports, security becomes a paramount concern that requires careful attention to multiple attack vectors and protection mechanisms.
204214

205215
### Overview
206216
Security is critical when exposing MCP servers over HTTP. Streamable HTTP introduces new attack surfaces and requires careful configuration.
@@ -223,7 +233,7 @@ Security is critical when exposing MCP servers over HTTP. Streamable HTTP introd
223233

224234
---
225235

226-
## 7. Implementation Guide
236+
## Implementation Guide
227237

228238
This section provides a step-by-step guide to building, running, and understanding an MCP streaming server and client using the streamable HTTP transport.
229239

@@ -338,7 +348,9 @@ This section provides a step-by-step guide to building, running, and understandi
338348

339349
---
340350

341-
## 8. Upgrading from SSE to Streamable HTTP
351+
## Upgrading from SSE to Streamable HTTP
352+
353+
For applications currently using Server-Sent Events (SSE), migrating to Streamable HTTP provides enhanced capabilities and better long-term sustainability for your MCP implementations.
342354

343355
### Why Upgrade?
344356
- Streamable HTTP offers better scalability, compatibility, and richer notification support than SSE.
@@ -360,7 +372,7 @@ This section provides a step-by-step guide to building, running, and understandi
360372

361373
---
362374

363-
## 9. Progress Notifications & Scenarios
375+
## Progress Notifications & Scenarios
364376

365377
This section explains the concept of progress notifications in MCP, why they matter, and how to implement them using Streamable HTTP. You'll also find a practical assignment to reinforce your understanding.
366378

@@ -413,7 +425,9 @@ Build an MCP server and client where the server processes a list of items (e.g.,
413425

414426
You can use the code samples above as a starting point, or refer to the provided [server.py](./server.py) and [client.py](./client.py) in this chapter for a complete implementation.
415427

416-
## 10. Further Reading & What Next?
428+
## Further Reading & What Next?
429+
430+
To continue your journey with MCP streaming and expand your knowledge, this section provides additional resources and suggested next steps for building more advanced applications.
417431

418432
### Further Reading
419433
- [Microsoft: Introduction to HTTP Streaming](https://learn.microsoft.com/aspnet/core/fundamentals/http-requests?view=aspnetcore-8.0&WT.mc_id=%3Fwt.mc_id%3DMVP_452430#streaming)

0 commit comments

Comments
 (0)