Skip to content

Commit 3192978

Browse files
authored
Merge pull request #90 from koic/doc_fix_incorrect_example_for_configuring_protocol_version
[Doc] Fix incorrect example for configuring protocol version
2 parents 7a9a6e4 + d2ca47b commit 3192978

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)