You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/transports/transports.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ var builder = WebApplication.CreateBuilder(args);
186
186
builder.Services.AddMcpServer()
187
187
.WithHttpTransport(options=>
188
188
{
189
-
// SSE requires stateful mode (the default). Set explicitly for clarity.
189
+
// SSE requires stateful mode (the default). Set explicitly for forward compatibility.
190
190
options.Stateless=false;
191
191
})
192
192
.WithTools<MyTools>();
@@ -216,3 +216,35 @@ No additional configuration is needed. When a client connects using the SSE prot
216
216
| Best for | Local tools, IDE integrations | Remote servers, production deployments | Local HTTP debugging, server-to-client features | Legacy client compatibility |
217
217
218
218
For a detailed comparison of stateless vs. stateful mode — including deployment trade-offs, security considerations, and configuration — see [Sessions](xref:sessions).
219
+
220
+
### In-memory transport
221
+
222
+
The <xref:ModelContextProtocol.Server.StreamServerTransport> and <xref:ModelContextProtocol.Client.StreamClientTransport> types work with any `Stream`, including in-memory pipes. This is useful for testing, embedding an MCP server in a larger application, or running a client and server in the same process without network overhead.
223
+
224
+
The following example creates a client and server connected via `System.IO.Pipelines` (from the [InMemoryTransport sample](https://github.com/modelcontextprotocol/csharp-sdk/blob/51a4fde4d9cfa12ef9430deef7daeaac36625be8/samples/InMemoryTransport/Program.cs)):
0 commit comments