Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
9 changes: 8 additions & 1 deletion R/client.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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() {
Expand Down