Skip to content

Commit db98dbc

Browse files
Merge pull request #72 from koic/use_console_instead_of_bash
[Doc] Use `console` instead of `bash` for code block highlighting
2 parents 40e8b47 + 6335d21 commit db98dbc

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ gem 'mcp'
1212

1313
And then execute:
1414

15-
```bash
15+
```console
1616
$ bundle install
1717
```
1818

1919
Or install it yourself as:
2020

21-
```bash
21+
```console
2222
$ gem install mcp
2323
```
2424

@@ -155,7 +155,7 @@ transport.open
155155

156156
You can run this script and then type in requests to the server at the command line.
157157

158-
```bash
158+
```console
159159
$ ruby examples/stdio_server.rb
160160
{"jsonrpc":"2.0","id":"1","method":"ping"}
161161
{"jsonrpc":"2.0","id":"2","method":"tools/list"}

examples/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This directory contains examples of how to use the Model Context Protocol (MCP)
88
A simple server that communicates over standard input/output. This is useful for desktop applications and command-line tools.
99

1010
**Usage:**
11-
```bash
11+
```console
1212
$ ruby examples/stdio_server.rb
1313
{"jsonrpc":"2.0","id":0,"method":"tools/list"}
1414
```
@@ -24,7 +24,7 @@ A standalone HTTP server built with Rack that implements the MCP Streamable HTTP
2424
- Full MCP protocol compliance
2525

2626
**Usage:**
27-
```bash
27+
```console
2828
$ ruby examples/http_server.rb
2929
```
3030

@@ -40,12 +40,12 @@ A client that demonstrates how to interact with the HTTP server using all MCP pr
4040

4141
**Usage:**
4242
1. Start the HTTP server in one terminal:
43-
```bash
43+
```console
4444
$ ruby examples/http_server.rb
4545
```
4646

4747
2. Run the client example in another terminal:
48-
```bash
48+
```console
4949
$ ruby examples/http_client.rb
5050
```
5151

@@ -70,7 +70,7 @@ A specialized HTTP server designed to test and demonstrate Server-Sent Events (S
7070
- `echo` - Simple echo tool for basic testing
7171

7272
**Usage:**
73-
```bash
73+
```console
7474
$ ruby examples/streamable_http_server.rb
7575
```
7676

@@ -87,12 +87,12 @@ An interactive client that connects to the SSE stream and provides a menu-driven
8787

8888
**Usage:**
8989
1. Start the SSE test server in one terminal:
90-
```bash
90+
```console
9191
$ ruby examples/streamable_http_server.rb
9292
```
9393

9494
2. Run the SSE test client in another terminal:
95-
```bash
95+
```console
9696
$ ruby examples/streamable_http_client.rb
9797
```
9898

@@ -107,19 +107,19 @@ The client will:
107107
You can also test SSE functionality manually using cURL:
108108

109109
1. Initialize a session:
110-
```bash
110+
```console
111111
SESSION_ID=$(curl -D - -s -o /dev/null -X POST http://localhost:9393 \
112112
-H "Content-Type: application/json" \
113113
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl-test","version":"1.0"}}}' | grep -i "Mcp-Session-Id:" | cut -d' ' -f2- | tr -d '\r')
114114
```
115115

116116
2. Connect to SSE stream (in one terminal):
117-
```bash
117+
```console
118118
curl -i -N -H "Mcp-Session-Id: $SESSION_ID" http://localhost:9393
119119
```
120120

121121
3. Trigger notifications (in another terminal):
122-
```bash
122+
```console
123123
# Send immediate notification
124124
curl -i -X POST http://localhost:9393 \
125125
-H "Content-Type: application/json" \
@@ -151,22 +151,22 @@ The HTTP server implements the MCP Streamable HTTP transport protocol:
151151
### Example cURL Commands
152152

153153
Initialize a session:
154-
```bash
154+
```console
155155
curl -i -X POST http://localhost:9292 \
156156
-H "Content-Type: application/json" \
157157
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
158158
```
159159

160160
List tools (using the session ID from initialization):
161-
```bash
161+
```console
162162
curl -i -X POST http://localhost:9292 \
163163
-H "Content-Type: application/json" \
164164
-H "Mcp-Session-Id: YOUR_SESSION_ID" \
165165
-d '{"jsonrpc":"2.0","method":"tools/list","id":2}'
166166
```
167167

168168
Call a tool:
169-
```bash
169+
```console
170170
curl -i -X POST http://localhost:9292 \
171171
-H "Content-Type: application/json" \
172172
-H "Mcp-Session-Id: YOUR_SESSION_ID" \

0 commit comments

Comments
 (0)