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
7 changes: 4 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# mcptools (development version)

`mcp_server()` gains logical argument `session_tools`, allowing users to opt-out of presenting R sessions tools to clients.
* `mcp_session()` now (invisibly) returns 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.

# mcptools 0.1.1

Addressed an issue in tests on `r-devel-linux-x86_64-fedora-clang`.
* Addressed an issue in tests on `r-devel-linux-x86_64-fedora-clang`.

# mcptools 0.1.0

Initial CRAN submission.
* Initial CRAN submission.

Before the initial release of the package, mcptools was called acquaint and supplied a default set of tools from btw, currently a GitHub-only package, when R was used as an MCP server. The direction of the dependency has been reversed; to use the same functionality from before, transition `acquaint::mcp_server()` to `btw::btw_mcp_server()` and `acquaint::mcp_session()` to `btw::btw_mcp_session()`.
6 changes: 4 additions & 2 deletions R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@
#' `mcp_session()`. Defaults to `TRUE`.
#'
#' @returns
#' `mcp_server()` and `mcp_session()` are both called primarily for side-effects.
#' `mcp_server()` and `mcp_session()` are both called primarily for their
#' side-effects.
#'
#' * `mcp_server()` blocks the R process it's called in indefinitely and isn't
#' intended for interactive use.
#' * `mcp_session()` makes the interactive R session it's called in available to
#' MCP servers. It returns a promise via [promises::promise()].
#' MCP servers. It returns the \pkg{nanonext} socket used for communicating
#' with the server. Call [close()] on the socket to stop the session.
#'
#' @seealso
#' - The "R as an MCP server" vignette at
Expand Down
3 changes: 2 additions & 1 deletion R/session.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ mcp_session <- function() {
i <- i + 1L
}
the$session <- i

schedule_handle_message_from_server()

the$session_socket
}

handle_message_from_server <- function(data) {
Expand Down
6 changes: 4 additions & 2 deletions man/server.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions pkgdown/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-session.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("mcp_session returns early when not interactive", {

test_that("mcp_session initializes appropriate globals", {
local_mocked_bindings(interactive = function() TRUE)
mcp_session()
expect_s3_class(mcp_session(), "nanoSocket")
expect_s3_class(the$session_socket, "nanoSocket")
expect_type(the$session, "integer")
})
Expand Down
Loading