Skip to content

Commit e8445e2

Browse files
committed
recommend npx mcp-remote with mcp_tools()
1 parent cf161cb commit e8445e2

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

R/client.R

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,38 @@ the$mcp_servers <- list()
6666
#' }
6767
#' ```
6868
#'
69+
#' @section Connecting to remote (http) servers:
70+
#' `mcp_tools()`, which supports using R as an MCP _client_ via ellmer, only
71+
#' implements the local (stdio) protocol. However, some MCP _servers_ only
72+
#' implement the http protocol.
73+
#'
74+
#' In that case, we recommend using
75+
#' [mcp-remote](https://www.npmjs.com/package/mcp-remote), a local (stdio)
76+
#' MCP server that supports connecting to remote (http) servers using the
77+
#' stdio protocol, with fully-featured authentication. In other words,
78+
#' `mcp-remote` converts remote MCP servers to mcptools-compatible local ones.
79+
#'
80+
#' To connect to remote (http) MCP servers when using ellmer as a client, use
81+
#' the command `npx` with the args `mcp-remote` and the URL provided by the
82+
#' remote server. For example, you might write:
83+
#'
84+
#' ```
85+
#' {
86+
#' "mcpServers": {
87+
#' "remote-example": {
88+
#' "command": "npx",
89+
#' "args": [
90+
#' "mcp-remote",
91+
#' "https://remote.mcp.server/sse"
92+
#' ]
93+
#' }
94+
#' }
95+
#' }
96+
#' ```
97+
#'
98+
#' mcp-remote's [homepage](https://www.npmjs.com/package/mcp-remote) has many
99+
#' examples for various authentication schemes.
100+
#'
69101
#' @returns
70102
#' * `mcp_tools()` returns a list of ellmer tools that can be passed directly
71103
#' to the `$set_tools()` method of an [ellmer::Chat] object. If the file at

man/client.Rd

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)