Update protocol version handling

This commit is contained in:
Justin Spahr-Summers 2024-10-21 14:50:44 +01:00
commit eb1024c654
No known key found for this signature in database

View file

@ -1,4 +1,4 @@
from mcp_python.types import ClientRequest, JSONRPCMessage, JSONRPCRequest
from mcp_python.types import LATEST_PROTOCOL_VERSION, ClientRequest, JSONRPCMessage, JSONRPCRequest
def test_jsonrpc_request():
@ -7,7 +7,7 @@ def test_jsonrpc_request():
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": 1,
"protocolVersion": LATEST_PROTOCOL_VERSION,
"capabilities": {"batch": None, "sampling": None},
"clientInfo": {"name": "mcp_python", "version": "0.1.0"},
},
@ -21,4 +21,4 @@ def test_jsonrpc_request():
assert request.root.id == 1
assert request.root.method == "initialize"
assert request.root.params is not None
assert request.root.params["protocolVersion"] == 1
assert request.root.params["protocolVersion"] == LATEST_PROTOCOL_VERSION