Package: mcpr 0.0.2.9000

John Coene

mcpr: Model Context Protocol for R

Create, run, and connect to Model Context Protocol (MCP) servers, and clients in R. The package provides a framework for implementing MCP-compatible servers with tools, resources, and prompts capabilities, as well as client functionality to interact with MCP servers. It includes a JSON-RPC 2.0 implementation for communication between clients and servers.

Authors:John Coene [aut, cre], Opifex [cph, fnd]

mcpr_0.0.2.9000.tar.gz
mcpr_0.0.2.9000.zip(r-4.7)mcpr_0.0.2.9000.zip(r-4.6)mcpr_0.0.2.9000.zip(r-4.5)
mcpr_0.0.2.9000.tgz(r-4.6-any)mcpr_0.0.2.9000.tgz(r-4.5-any)
mcpr_0.0.2.9000.tar.gz(r-4.7-any)mcpr_0.0.2.9000.tar.gz(r-4.6-any)
mcpr_0.0.2.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
mcpr/json (API)
NEWS

# Install 'mcpr' in R:
install.packages('mcpr', repos = c('https://devopifex.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/devopifex/mcpr/issues

Pkgdown/docs site:https://mcpr.opifex.org

On CRAN:

Conda:

6.51 score 62 stars 43 scripts 39 exports 1 dependencies

Last updated from:b734565e6d. Checks:7 ERROR, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64ERROR112
source / vignettesOK237
linux-release-x86_64ERROR117
macos-release-arm64ERROR74
macos-oldrel-arm64ERROR64
windows-develERROR71
windows-releaseERROR65
windows-oldrelERROR56
wasm-releaseOK103

Exports:add_capabilityellmer_to_mcpr_toolget_nameinitializemcp_rocletnew_client_ionew_mcpnew_promptnew_resourcenew_servernew_toolprompts_getprompts_listpropertiesproperty_arrayproperty_booleanproperty_enumproperty_numberproperty_objectproperty_stringreadregister_mcpr_toolsresources_listresources_readresponseresponse_audioresponse_errorresponse_fileresponse_imageresponse_itemresponse_resourceresponse_textresponse_videoschemaserve_httpserve_iotools_calltools_listwrite

Dependencies:yyjsonr

Getting Started with mcpr

Rendered fromget-started.Rmdusingknitr::rmarkdownon May 31 2026.

Last update: 2025-06-10
Started: 2025-06-09

Integrating mcpr with MCP Clients

Rendered fromclient-integration.Rmdusingknitr::rmarkdownon May 31 2026.

Last update: 2025-06-10
Started: 2025-06-09

Practical MCP Examples with R

Rendered frompractical-examples.Rmdusingknitr::rmarkdownon May 31 2026.

Last update: 2025-06-10
Started: 2025-06-09

Using the MCP Client

Rendered fromclient-usage.Rmdusingknitr::rmarkdownon May 31 2026.

Last update: 2025-06-11
Started: 2025-06-10

Readme and manuals

Help Manual

Help pageTopics
Add a capability to an MCP objectadd_capability
Create a new mcp IOclient new_client_http new_client_io
Convert ellmer tools to mcpr toolsellmer_to_mcpr_tool
Get the name of a clientget_name
Initialize the server with protocol informationinitialize
MCP Roclet for Generating MCP Serversmcp_roclet
Create a new promptnew_prompt
Create a new resourcenew_resource
Create a new MCP objectnew_mcp new_server
Create a new toolnew_tool
Get a prompt with the given parametersprompts_get
List all available promptsprompts_list
Create a new properties listproperties
Create an array property definitionproperty_array
Create a boolean property definitionproperty_boolean
Create an enum property with predefined valuesproperty_enum
Create a number property definitionproperty_number
Create an object property definitionproperty_object
Create a string property definitionproperty_string
Read a JSON-RPC response from a client providerread
Register MCPR tools with an ellmer chatregister_mcpr_tools
List all available resourcesresources_list
Read a resource with the given parametersresources_read
Create a response objectresponse response_audio response_error response_file response_image response_item response_resource response_text response_video
Generate MCP server outputroclet_output.roclet_mcp
Process blocks for MCP rocletroclet_process.roclet_mcp
Parse @mcp tagroxy_tag_parse.roxy_tag_mcp
Parse @type tagroxy_tag_parse.roxy_tag_type
Roxygen2 tag for @mcp This function is called by Roxygen2 to generate documentation for the @mcp tagroxy_tag_rd.roxy_tag_mcp
Roxygen2 tag handler for @type This function is called by Roxygen2 to generate documentation for the @typeroxy_tag_rd.roxy_tag_type
Create a new input schemaschema
Serve an MCP server over HTTP using ambiorixserve_http
Serve an MCP server using stdin/stdoutserve_io
Call a tool with the given parameterstools_call
List all available toolstools_list
Write a JSON-RPC request to a client providerwrite