Skip to content

Commit d2ca47b

Browse files
committed
[Doc] Fix incorrect example for configuring protocol version
`MCP::Server` does not have a `protocol_version=` method. ```console $ bin/console irb(main):001> MCP::Server.protocol_version = "2024-11-05" (irb):1:in '<main>': undefined method 'protocol_version=' for class MCP::Server (NoMethodError) from bin/console:15:in '<main>' ``` This PR fixes an incorrect example that causes the above error.
1 parent 6bace86 commit d2ca47b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,17 @@ config.instrumentation_callback = ->(data) {
326326

327327
### Server Protocol Version
328328

329-
The server's protocol version can be overridden using the `protocol_version` class method:
329+
The server's protocol version can be overridden using the `protocol_version` keyword argument:
330330

331331
```ruby
332-
MCP::Server.protocol_version = "2024-11-05"
332+
configuration = MCP::Configuration.new(protocol_version: "2024-11-05")
333+
MCP::Server.new(name: "test_server", configuration: configuration)
333334
```
334335

335336
This will make all new server instances use the specified protocol version instead of the default version. The protocol version can be reset to the default by setting it to `nil`:
336337

337338
```ruby
338-
MCP::Server.protocol_version = nil
339+
MCP::Configuration.new(protocol_version: nil)
339340
```
340341

341342
If an invalid `protocol_version` value is set, an `ArgumentError` is raised.

0 commit comments

Comments
 (0)