diff --git a/README.md b/README.md index c88dfd78..111b3fd4 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ The server supports sending notifications to clients when lists of tools, prompt The server provides three notification methods: - `notify_tools_list_changed()` - Send a notification when the tools list changes -- `notify_prompts_list_changed()` - Send a notification when the prompts list changes +- `notify_prompts_list_changed()` - Send a notification when the prompts list changes - `notify_resources_list_changed()` - Send a notification when the resources list changes #### Notification Format @@ -119,7 +119,6 @@ end If you want to build a local command-line application, you can use the stdio transport: ```ruby -#!/usr/bin/env ruby require "mcp" require "mcp/server/transports/stdio_transport" @@ -157,7 +156,7 @@ transport.open You can run this script and then type in requests to the server at the command line. ```bash -$ ./examples/stdio_server.rb +$ ruby examples/stdio_server.rb {"jsonrpc":"2.0","id":"1","method":"ping"} {"jsonrpc":"2.0","id":"2","method":"tools/list"} ``` diff --git a/examples/README.md b/examples/README.md index f566f9c0..72a71544 100644 --- a/examples/README.md +++ b/examples/README.md @@ -9,7 +9,7 @@ A simple server that communicates over standard input/output. This is useful for **Usage:** ```bash -ruby examples/stdio_server.rb +$ ruby examples/stdio_server.rb {"jsonrpc":"2.0","id":0,"method":"tools/list"} ``` @@ -25,11 +25,11 @@ A standalone HTTP server built with Rack that implements the MCP Streamable HTTP **Usage:** ```bash -ruby examples/http_server.rb +$ ruby examples/http_server.rb ``` The server will start on `http://localhost:9292` and provide: -- **Tools**: +- **Tools**: - `ExampleTool` - adds two numbers - `echo` - echoes back messages - **Prompts**: `ExamplePrompt` - echoes back arguments as a prompt @@ -41,12 +41,12 @@ A client that demonstrates how to interact with the HTTP server using all MCP pr **Usage:** 1. Start the HTTP server in one terminal: ```bash - ruby examples/http_server.rb + $ ruby examples/http_server.rb ``` 2. Run the client example in another terminal: ```bash - ruby examples/http_client.rb + $ ruby examples/http_client.rb ``` The client will demonstrate: @@ -71,7 +71,7 @@ A specialized HTTP server designed to test and demonstrate Server-Sent Events (S **Usage:** ```bash -ruby examples/streamable_http_server.rb +$ ruby examples/streamable_http_server.rb ``` The server will start on `http://localhost:9393` and provide detailed instructions for testing SSE functionality. @@ -88,12 +88,12 @@ An interactive client that connects to the SSE stream and provides a menu-driven **Usage:** 1. Start the SSE test server in one terminal: ```bash - ruby examples/streamable_http_server.rb + $ ruby examples/streamable_http_server.rb ``` 2. Run the SSE test client in another terminal: ```bash - ruby examples/streamable_http_client.rb + $ ruby examples/streamable_http_client.rb ``` The client will: @@ -133,7 +133,7 @@ curl -X POST http://localhost:9393 \ The HTTP server implements the MCP Streamable HTTP transport protocol: -1. **Initialize Session**: +1. **Initialize Session**: - Client sends POST request with `initialize` method - Server responds with session ID in `Mcp-Session-Id` header diff --git a/examples/http_client.rb b/examples/http_client.rb index 992b9fd6..31baf3db 100644 --- a/examples/http_client.rb +++ b/examples/http_client.rb @@ -1,4 +1,3 @@ -#!/usr/bin/env ruby # frozen_string_literal: true require "net/http" diff --git a/examples/http_server.rb b/examples/http_server.rb index 811775cd..350875cd 100644 --- a/examples/http_server.rb +++ b/examples/http_server.rb @@ -1,4 +1,3 @@ -#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) diff --git a/examples/stdio_server.rb b/examples/stdio_server.rb old mode 100755 new mode 100644 index 19b28559..3c05ddb6 --- a/examples/stdio_server.rb +++ b/examples/stdio_server.rb @@ -1,4 +1,3 @@ -#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) diff --git a/examples/streamable_http_client.rb b/examples/streamable_http_client.rb index cd24ab37..5f8e11b2 100644 --- a/examples/streamable_http_client.rb +++ b/examples/streamable_http_client.rb @@ -1,4 +1,3 @@ -#!/usr/bin/env ruby # frozen_string_literal: true require "net/http" diff --git a/examples/streamable_http_server.rb b/examples/streamable_http_server.rb index 2ff9d962..1c0a286f 100644 --- a/examples/streamable_http_server.rb +++ b/examples/streamable_http_server.rb @@ -1,4 +1,3 @@ -#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))