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: src/examples/README.md
+57-40Lines changed: 57 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -2,24 +2,37 @@
2
2
3
3
This directory contains example implementations of MCP clients and servers using the TypeScript SDK.
4
4
5
+
## Table of Contents
6
+
7
+
-[Streamable HTTP Servers - Single Node Deployment](#streamable-http---single-node-deployment-with-basic-session-state-management)
8
+
-[Simple Server with Streamable HTTP](#simple-server-with-streamable-http-transport-serversimplestreamablehttpts)
9
+
-[Server Supporting SSE via GET](#server-supporting-with-sse-via-get-serverstandalonessewithgetstreamablehttpts)
10
+
-[Server with JSON Response Mode](#server-with-json-response-mode-serverjsonresponsestreamablehttpts)
11
+
-[Client Example - Streamable HTTP](#client-clientsimplestreamablehttpts)
12
+
5
13
## Streamable HTTP - single node deployment with basic session state management
6
14
7
-
Multi node with stete management example will be added soon after we add support.
15
+
Multi node with state management example will be added soon after we add support.
8
16
9
-
### Server with JSON response mode (`server/jsonResponseStreamableHttp.ts`)
10
17
11
-
A simple MCP server that uses the Streamable HTTP transport with JSON response mode enabled, implemented with Express. The server provides a simple `greet` tool that returns a greeting for a name.
18
+
### Simple Server with Streamable Http transport (`server/simpleStreamableHttp.ts`)
19
+
20
+
A simple MCP server that uses the Streamable HTTP transport, implemented with Express. The server provides:
21
+
22
+
- A simple `greet` tool that returns a greeting for a name
23
+
- A `greeting-template` prompt that generates a greeting template
Note that in this example, we're using plain JSON response mode by setting `Accept: application/json` header.
63
+
### Server supporting with SSE via GET (`server/standaloneSseWithGetStreamableHttp.ts`)
64
64
65
-
### Server (`server/simpleStreamableHttp.ts`)
65
+
An MCP server that demonstrates how to support SSE notifications via GET requests using the Streamable HTTP transport with Express. The server dynamically adds resources at regular intervals and supports notifications for resource list changes (server notifications are available through the standalone SSE connection established by GET request).
66
66
67
-
A simple MCP server that uses the Streamable HTTP transport, implemented with Express. The server provides:
67
+
#### Running the server
68
68
69
-
- A simple `greet` tool that returns a greeting for a name
70
-
- A `greeting-template` prompt that generates a greeting template
The server will start on port 3000 and automatically create new resources every 5 seconds.
74
+
75
+
### Server with JSON response mode (`server/jsonResponseStreamableHttp.ts`)
76
+
77
+
This is not recommented way to use the transport, as its quite limiting and not supporting features like logging and progress notifications on tool execution.
78
+
A simple MCP server that uses the Streamable HTTP transport with JSON response mode enabled, implemented with Express. The server provides a simple `greet` tool that returns a greeting for a name.
0 commit comments