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
A client that connects to the STDIO server using the `MCP::Client::Stdio` transport.
21
+
This demonstrates how to use the SDK's built-in client classes to interact with a server subprocess.
22
+
23
+
**Usage:**
24
+
25
+
```console
26
+
$ ruby examples/stdio_client.rb
27
+
```
28
+
29
+
The client will automatically launch `stdio_server.rb` as a subprocess and demonstrate:
30
+
31
+
- Listing and calling tools
32
+
- Listing prompts
33
+
- Listing and reading resources
34
+
- Automatic MCP protocol initialization
35
+
- Transport cleanup on exit
36
+
37
+
### 3. HTTP Server (`http_server.rb`)
19
38
20
39
A standalone HTTP server built with Rack that implements the MCP Streamable HTTP transport protocol. This demonstrates how to create a web-based MCP server with session management and Server-Sent Events (SSE) support.
21
40
@@ -41,7 +60,7 @@ The server will start on `http://localhost:9292` and provide:
41
60
-**Prompts**: `ExamplePrompt` - echoes back arguments as a prompt
42
61
-**Resources**: `test_resource` - returns example content
43
62
44
-
### 3. HTTP Client Example (`http_client.rb`)
63
+
### 4. HTTP Client Example (`http_client.rb`)
45
64
46
65
A client that demonstrates how to interact with the HTTP server using all MCP protocol methods.
47
66
@@ -67,7 +86,7 @@ The client will demonstrate:
67
86
- Listing and reading resources
68
87
- Session cleanup
69
88
70
-
### 4. Streamable HTTP Server (`streamable_http_server.rb`)
89
+
### 5. Streamable HTTP Server (`streamable_http_server.rb`)
71
90
72
91
A specialized HTTP server designed to test and demonstrate Server-Sent Events (SSE) functionality in the MCP protocol.
0 commit comments