[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.
This commit is contained in:
Koichi ITO 2025-07-26 14:50:35 +09:00
commit d2ca47be19

View file

@ -326,16 +326,17 @@ config.instrumentation_callback = ->(data) {
### Server Protocol Version
The server's protocol version can be overridden using the `protocol_version` class method:
The server's protocol version can be overridden using the `protocol_version` keyword argument:
```ruby
MCP::Server.protocol_version = "2024-11-05"
configuration = MCP::Configuration.new(protocol_version: "2024-11-05")
MCP::Server.new(name: "test_server", configuration: configuration)
```
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`:
```ruby
MCP::Server.protocol_version = nil
MCP::Configuration.new(protocol_version: nil)
```
If an invalid `protocol_version` value is set, an `ArgumentError` is raised.