Skip to content

Commit 20b7b7c

Browse files
add: MCP Doc Refresh for Streamable HTTP (#219)
* add streamable http info * update what-is-mcp * update using guide
1 parent a21f35b commit 20b7b7c

File tree

5 files changed

+155
-53
lines changed

5 files changed

+155
-53
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.

docs/features/mcp/using-mcp-in-roo.mdx

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ Both files use a JSON format with a `mcpServers` object containing named server
7373
}
7474
```
7575
*Example of MCP Server config in Roo Code (STDIO Transport)*
76-
76+
7777
### Understanding Transport Types
78-
79-
MCP supports two transport types for server communication:
80-
78+
79+
MCP supports three transport types for server communication: STDIO for local servers, Streamable HTTP (recommended for new remote servers), and SSE (for legacy remote servers).
80+
8181
#### STDIO Transport
82-
82+
8383
Used for local servers running on your machine:
84-
84+
8585
* Communicates via standard input/output streams
8686
* Lower latency (no network overhead)
8787
* Better security (no network exposure)
8888
* Simpler setup (no HTTP server needed)
8989
* Runs as a child process on your machine
90-
90+
9191
For more in-depth information about how STDIO transport works, see [STDIO Transport](/features/mcp/server-transports#stdio-transport).
92-
92+
9393
STDIO configuration parameters:
9494

9595
* `command` (required): The executable to run (e.g., `node`, `python`, `npx`, or an absolute path).
@@ -116,48 +116,87 @@ Both files use a JSON format with a `mcpServers` object containing named server
116116
}
117117
}
118118
```
119-
120-
#### SSE Transport
121-
122-
Used for remote servers accessed over HTTP/HTTPS:
123-
124-
* Communicates via Server-Sent Events protocol
119+
#### Streamable HTTP Transport
120+
121+
This is the **modern standard** for remote servers accessed over HTTP/HTTPS, offering more flexibility and replacing the legacy SSE transport for new implementations.
122+
123+
* Communicates via HTTP POST/GET to a single MCP endpoint
124+
* Optionally uses Server-Sent Events (SSE) for streaming
125+
* Can be hosted on a different machine
126+
* Supports multiple client connections
127+
* Requires network access
128+
* Allows centralized deployment and management
129+
130+
For more in-depth information about how Streamable HTTP transport works, see [Streamable HTTP Transport](/features/mcp/server-transports#streamable-http-transport).
131+
132+
Streamable HTTP configuration parameters:
133+
134+
* `type` (required): Must be set to `"streamable-http"`.
135+
* `url` (required): The full URL of the remote MCP server's single endpoint (e.g., `https://your-server.com/mcp`).
136+
* `headers` (optional): An object containing custom HTTP headers to send with requests (e.g., for authentication tokens).
137+
* `alwaysAllow` (optional): An array of tool names from this server to automatically approve.
138+
* `disabled` (optional): Set to `true` to disable this server configuration.
139+
140+
Streamable HTTP configuration example:
141+
```json
142+
{
143+
"mcpServers": {
144+
"modern-remote-server": {
145+
"type": "streamable-http",
146+
"url": "https://your-modern-server.com/api/mcp-endpoint",
147+
"headers": {
148+
"X-API-Key": "your-secure-api-key"
149+
},
150+
"alwaysAllow": ["newToolA", "newToolB"],
151+
"disabled": false
152+
}
153+
}
154+
}
155+
```
156+
157+
#### SSE Transport (Legacy)
158+
159+
Used for older remote servers accessed over HTTP/HTTPS. **For new remote server implementations, [Streamable HTTP Transport](#streamable-http-transport) is recommended.**
160+
161+
* Communicates via Server-Sent Events protocol (typically requires separate endpoints for client-to-server and server-to-client communication)
125162
* Can be hosted on a different machine
126163
* Supports multiple client connections
127164
* Requires network access
128165
* Allows centralized deployment and management
129-
130-
For more in-depth information about how SSE transport works, see [SSE Transport](/features/mcp/server-transports#sse-transport).
131-
132-
SSE configuration parameters:
133166

134-
* `url` (required): The full URL endpoint of the remote MCP server (e.g., `https://your-server.com/mcp`).
167+
For more in-depth information about how legacy SSE transport works, see [SSE Transport (Legacy)](/features/mcp/server-transports#sse-transport-legacy).
168+
169+
SSE (Legacy) configuration parameters:
170+
171+
* `type` (optional, but recommended for clarity): Should be set to `"sse"` if providing a `url` for an SSE server, to distinguish from Streamable HTTP. If `url` is present and `type` is omitted, Roo Code might try to infer, but explicit declaration is safer.
172+
* `url` (required): The base URL for the remote MCP server. For legacy SSE, this usually implies separate paths like `/events` (for SSE stream) and `/message` (for POST requests) will be derived or expected by the server.
135173
* `headers` (optional): An object containing custom HTTP headers to send with requests (e.g., for authentication tokens).
136174
* `alwaysAllow` (optional): An array of tool names from this server to automatically approve.
137175
* `disabled` (optional): Set to `true` to disable this server configuration.
138176

139-
SSE configuration example:
177+
SSE (Legacy) configuration example:
140178
```json
141179
{
142180
"mcpServers": {
143-
"remote-server": {
144-
"url": "https://your-server-url.com/mcp",
181+
"legacy-remote-server": {
182+
"type": "sse", // Explicitly define as SSE
183+
"url": "https://your-legacy-server-url.com/mcp-base", // Base URL
145184
"headers": {
146-
"Authorization": "Bearer your-token" // Example: Authentication header
185+
"Authorization": "Bearer your-legacy-token"
147186
},
148-
"alwaysAllow": ["tool3"],
187+
"alwaysAllow": ["oldToolX"],
149188
"disabled": false
150189
}
151190
}
152191
}
153192
```
154-
193+
155194
## Enabling or Disabling MCP Servers
156195

157196
Disabling your MCP Servers here will remove all MCP related logic and definitions from your system prompt, reducing your token usage. This will prevent Roo Code from connecting to any MCP servers, and the `use_mcp_tool` and `access_mcp_resource` tools will not be available. Check this off if you don't intend to use MCP Servers. This is on by default.
158197

159198
1. Click the <Codicon name="server" /> icon in the top navigation of the Roo Code pane
160-
2. Check/Uncheck `Enable MCP Servers`
199+
2. Check/Uncheck `Enable MCP Servers`
161200

162201
<img src="/img/using-mcp-in-roo/using-mcp-in-roo-2.png" alt="Enable MCP Servers toggle" width="400" />
163202

@@ -166,7 +205,7 @@ Disabling your MCP Servers here will remove all MCP related logic and definition
166205
Disabling your MCP Server Creation here will just remove the instructions from your system prompt that Roo Code uses to write MCP servers while not removing the context related to operating them. This reduces token usage. This is on by default.
167206

168207
1. Click the <Codicon name="server" /> icon in the top navigation of the Roo Code pane
169-
2. Check/Uncheck `Enable MCP Server Creation`
208+
2. Check/Uncheck `Enable MCP Server Creation`
170209

171210
<img src="/img/using-mcp-in-roo/using-mcp-in-roo-3.png" alt="Enable MCP Server Creation toggle" width="400" />
172211

docs/features/mcp/what-is-mcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Ready to dig deeper? Check out these guides:
4646
- [MCP Overview](/features/mcp/overview) - A quick glance at the MCP documentation structure
4747
- [Using MCP in Roo Code](/features/mcp/using-mcp-in-roo) - Get started with MCP in Roo, including creating simple servers
4848
- [MCP vs API](/features/mcp/mcp-vs-api) - Technical advantages compared to traditional APIs
49-
- [STDIO & SSE Transports](/features/mcp/server-transports) - Local vs. hosted deployment models
49+
- [STDIO & Streamable HTTP & SSE Transports](/features/mcp/server-transports) - Local vs. hosted deployment models

0 commit comments

Comments
 (0)