From 0e90529c38fd028286d31fcc2c203324384d1f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Fory=C5=9B?= Date: Thu, 16 Oct 2025 11:05:37 +0200 Subject: [PATCH 1/2] Add nitialized message. --- R/client.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/client.R b/R/client.R index 74004e5..a5ffa24 100644 --- a/R/client.R +++ b/R/client.R @@ -195,6 +195,7 @@ error_no_mcp_config <- function(call) { add_mcp_server <- function(process, name) { response_initialize <- send_and_receive(process, mcp_request_initialize()) + send_and_receive(process, mcp_request_initialized()) response_tools_list <- send_and_receive(process, mcp_request_tools_list()) the$mcp_servers[[name]] <- list( @@ -419,7 +420,13 @@ mcp_request_initialize <- function() { } # step 2: send initialized notification -# This is a MAY in the protocol, so omitting. +mcp_request_initialized <- function() { + list( + jsonrpc = "2.0", + method = "notifications/initialized" + ) +} + # step 3: request the list of tools mcp_request_tools_list <- function() { From 0f2f40e1430973934a2ebf8902f1e683d3f84bd0 Mon Sep 17 00:00:00 2001 From: simonpcouch Date: Sun, 19 Oct 2025 13:01:47 -0400 Subject: [PATCH 2/2] add NEWS entry --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index d1288da..0d117da 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # mcptools (development version) +* `mcp_tools()` now sends and receives a `"notifications/initialized"` (#77 by @galachad). * `mcp_session()` now returns invisibly the nanonext socket used for communicating with the server. * `mcp_server()` gains logical argument `session_tools`, allowing users to opt-out of presenting R sessions tools to clients.