Skip to content

Commit c3222ef

Browse files
committed
add streamable http info
1 parent a21f35b commit c3222ef

File tree

3 files changed

+88
-25
lines changed

3 files changed

+88
-25
lines changed

docs/advanced-usage/available-tools/use-mcp-tool.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This tool allows Roo to access specialized functionality provided by external MC
2525
## Key Features
2626

2727
- Uses the standardized MCP protocol via the `@modelcontextprotocol/sdk` library
28-
- Supports multiple transport mechanisms (StdioClientTransport and SSEClientTransport)
28+
- Supports multiple transport mechanisms (StdioClientTransport, StreamableHTTPClientTransport and SSEClientTransport)
2929
- Validates arguments using Zod schema validation on both client and server sides
3030
- Processes multiple response content types: text, image, and resource references
3131
- Manages server lifecycle with automatic restarts when server code changes
@@ -69,6 +69,7 @@ When the `use_mcp_tool` tool is invoked, it follows this process:
6969
- The system selects the appropriate transport mechanism:
7070
- `StdioClientTransport`: For communicating with local processes via standard I/O
7171
- `SSEClientTransport`: For communicating with HTTP servers via Server-Sent Events
72+
- `StreamableHTTPClientTransport`: For communicating with HTTP servers via Streamable HTTP Events
7273
- A request is sent with validated server name, tool name, and arguments
7374
- Communication uses the `@modelcontextprotocol/sdk` library for standardized interactions
7475
- Request execution is tracked with timeout handling to prevent hanging operations

docs/features/mcp/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This documentation is organized into several sections:
1515

1616
* [**What is MCP?**](/features/mcp/what-is-mcp) - Clear explanation of the Model Context Protocol, its client-server architecture, and how it enables AI systems to interact with external tools.
1717

18-
* [**STDIO & SSE Transports**](/features/mcp/server-transports) - Detailed comparison of local (STDIO) and remote (SSE) transport mechanisms with deployment considerations for each approach.
18+
* [**STDIO, Streamable HTTP & SSE Transports**](/features/mcp/server-transports) - Detailed comparison of local (STDIO) and remote (Streamable HTTP & legacy SSE) transport mechanisms with deployment considerations for each approach.
1919

2020
* [**MCP vs API**](/features/mcp/mcp-vs-api) - Analysis of the fundamental distinction between MCP and REST APIs, explaining how they operate at different layers of abstraction for AI systems.
2121

docs/features/mcp/server-transports.md

Lines changed: 85 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: MCP Server Transports
3-
sidebar_label: STDIO & SSE Transports
3+
sidebar_label: STDIO, Streamable HTTP & SSE Transports
44
---
55

6-
# MCP Server Transports: STDIO & SSE
6+
# MCP Server Transports: STDIO, Streamable HTTP & SSE
77

8-
Model Context Protocol (MCP) supports two primary transport mechanisms for communication between Roo Code and MCP servers: Standard Input/Output (STDIO) and Server-Sent Events (SSE). Each has distinct characteristics, advantages, and use cases.
8+
Model Context Protocol (MCP) supports three primary transport mechanisms for communication between Roo Code and MCP servers: Standard Input/Output (STDIO), Streamable HTTP (the modern standard), and Server-Sent Events (SSE) (for legacy use). Each has distinct characteristics, advantages, and use cases.
99

1010
## STDIO Transport
1111

@@ -58,10 +58,71 @@ const server = new Server({name: 'local-server', version: '1.0.0'});
5858
const transport = new StdioServerTransport(server);
5959
transport.listen();
6060
```
61+
## Streamable HTTP Transport
6162

62-
## SSE Transport
63+
Streamable HTTP transport is the modern standard for remote MCP server communication, replacing the older HTTP+SSE transport. It operates over HTTP/HTTPS and allows for more flexible server implementations.
6364

64-
Server-Sent Events (SSE) transport runs on a remote server and communicates over HTTP/HTTPS.
65+
### How Streamable HTTP Transport Works
66+
67+
1. The server provides a single HTTP endpoint (MCP endpoint) that supports both POST and GET methods.
68+
2. The client (Roo Code) sends requests to this MCP endpoint using HTTP POST.
69+
3. The server processes the request and sends back a response.
70+
4. Optionally, the server can use Server-Sent Events (SSE) over the same connection to stream multiple messages or notifications to the client. This allows for basic request-response interactions as well as more advanced streaming and server-initiated communication.
71+
72+
```
73+
Client Server
74+
| |
75+
|---- HTTP POST /mcp_endpoint ---->| (client request)
76+
| | (processes request)
77+
|<--- HTTP Response / SSE Stream --| (server response / stream)
78+
| |
79+
```
80+
81+
### Streamable HTTP Characteristics
82+
83+
* **Modern Standard**: Preferred method for new remote MCP server implementations.
84+
* **Remote Access**: Can be hosted on a different machine from Roo Code.
85+
* **Scalability**: Can handle multiple client connections concurrently.
86+
* **Protocol**: Works over standard HTTP/HTTPS.
87+
* **Flexibility**: Supports simple request-response and advanced streaming.
88+
* **Single Endpoint**: Uses a single URL path for all MCP communication.
89+
* **Authentication**: Can use standard HTTP authentication mechanisms.
90+
* **Backwards Compatibility**: Servers can maintain compatibility with older HTTP+SSE clients.
91+
92+
### When to Use Streamable HTTP
93+
94+
Streamable HTTP transport is ideal for:
95+
96+
* All new remote MCP server developments.
97+
* Servers requiring robust, scalable, and flexible communication.
98+
* Integrations that might involve streaming data or server-sent notifications.
99+
* Public services or centralized tools.
100+
* Replacing legacy SSE transport implementations.
101+
102+
### Streamable HTTP Implementation Example
103+
104+
Configuration in `settings.json`:
105+
```json
106+
"mcp.servers": {
107+
"StreamableHTTPMCPName": {
108+
"type": "streamable-http",
109+
"url": "http://localhost:8080/mcp"
110+
}
111+
}
112+
```
113+
114+
For server-side implementation, refer to the MCP SDK documentation for `StreamableHTTPClientTransport`.
115+
116+
### Backwards Compatibility with HTTP+SSE
117+
118+
Clients and servers can maintain backwards compatibility with the deprecated HTTP+SSE transport (from protocol version 2024-11-05).
119+
120+
Servers wanting to support older clients should:
121+
* Continue to host both the SSE (`/events`) and POST (`/message`) endpoints of the old transport, alongside the new “MCP endpoint” defined for the Streamable HTTP transport.
122+
123+
## SSE Transport (Legacy)
124+
125+
Server-Sent Events (SSE) transport is a legacy method for remote server communication over HTTP/HTTPS. For new implementations, **Streamable HTTP transport is recommended.** SSE remains available for compatibility with older MCP servers.
65126

66127
### How SSE Transport Works
67128

@@ -145,9 +206,9 @@ A local file search tool using STDIO would:
145206
* Not require network configuration
146207
* Need to be installed alongside Roo Code or via a package manager
147208

148-
### SSE: Hosted Deployment Model
209+
### Streamable HTTP / SSE (Legacy): Hosted Deployment Model
149210

150-
SSE servers can be deployed to remote servers and accessed over the network:
211+
Streamable HTTP (recommended) and legacy SSE servers can be deployed to remote servers and accessed over the network:
151212

152213
* **Installation**: Installed once on a server, accessed by many users
153214
* **Distribution**: Single deployment serves multiple clients
@@ -175,22 +236,23 @@ Some scenarios benefit from a hybrid approach:
175236
2. **SSE with Local Commands**: A remote SSE server that can trigger operations on the client machine through callbacks
176237
3. **Gateway Pattern**: STDIO servers for local operations that connect to SSE servers for specialized functions
177238

178-
## Choosing Between STDIO and SSE
179-
180-
| Consideration | STDIO | SSE |
181-
|---------------|-------|-----|
182-
| **Location** | Local machine only | Local or remote |
183-
| **Clients** | Single client | Multiple clients |
184-
| **Performance** | Lower latency | Higher latency (network overhead) |
185-
| **Setup Complexity** | Simpler | More complex (requires HTTP server) |
186-
| **Security** | Inherently secure | Requires explicit security measures |
187-
| **Network Access** | Not needed | Required |
188-
| **Scalability** | Limited to local machine | Can distribute across network |
189-
| **Deployment** | Per-user installation | Centralized installation |
190-
| **Updates** | Distributed updates | Centralized updates |
191-
| **Resource Usage** | Uses client resources | Uses server resources |
192-
| **Dependencies** | Client-side dependencies | Server-side dependencies |
239+
## Choosing Between Transports
240+
241+
| Consideration | STDIO | Streamable HTTP | SSE (Legacy) |
242+
|---------------|-------|-----------------|--------------|
243+
| **Location** | Local machine only | Local or remote | Local or remote |
244+
| **Clients** | Single client | Multiple clients | Multiple clients |
245+
| **Performance** | Lower latency | Higher latency (network overhead) | Higher latency (network overhead) |
246+
| **Setup Complexity** | Simpler | More complex (requires HTTP server) | More complex (requires HTTP server, potentially two endpoints) |
247+
| **Security** | Inherently secure | Requires explicit security measures | Requires explicit security measures |
248+
| **Network Access** | Not needed | Required | Required |
249+
| **Scalability** | Limited to local machine | Can distribute across network | Can distribute across network |
250+
| **Deployment** | Per-user installation | Centralized installation | Centralized installation |
251+
| **Updates** | Distributed updates | Centralized updates | Centralized updates |
252+
| **Resource Usage** | Uses client resources | Uses server resources | Uses server resources |
253+
| **Dependencies** | Client-side dependencies | Server-side dependencies | Server-side dependencies |
254+
| **Recommendation** | Ideal for local, secure, single-client tools | **Modern standard for all new remote servers** | Legacy, for existing older servers |
193255

194256
## Configuring Transports in Roo Code
195257

196-
For detailed information on configuring STDIO and SSE transports in Roo Code, including example configurations, see the [Understanding Transport Types](/features/mcp/using-mcp-in-roo#understanding-transport-types) section in the Using MCP in Roo Code guide.
258+
For detailed information on configuring STDIO, Streamable HTTP, and SSE (Legacy) transports in Roo Code, including example configurations, see the [Understanding Transport Types](/features/mcp/using-mcp-in-roo#understanding-transport-types) section in the Using MCP in Roo Code guide.

0 commit comments

Comments
 (0)