Build, test and ship MCP servers as R packages.
Status: proof of concept, not yet released. The documentation describes what the package does today; the roadmap lists what is planned.
The idea in one paragraph
mordew does for MCP servers what golem does for Shiny apps: an MCP server is an R package. Each tool is an R function of the package, documented with roxygen and tested with testthat. mordew scaffolds the package, turns the roxygen documentation into an MCP tool registry, serves that registry to any MCP client (Claude Code, Claude Desktop, Codex, Copilot…), and provides the testing, security and deployment conventions needed to run all this in production. mordew does not ship a chat: a chat is a separate product, which talks to a mordew server through MCP like any other client.
The examples use runlog, a toy package that answers questions about a (fake) running log: dates, types of run, distances and durations.
# create the package, with its dev/ scripts
mordew::create_mordew(
path = "runlog"
)
# dev/02_dev.R: creates R/tool_summarise_runs.R and its test file
mordew::add_tool(
name = "summarise_runs"
)
# dev/02_dev.R: creates R/resource_surfaces.R and its test file
mordew::add_resource(
name = "surfaces"
)
# try the tools with a model, from the R console
mordew::run_dev(
chat = ellmer::chat_anthropic()
)
# dev/02_dev.R: creates dev/evals.R and a CI workflow that runs it
mordew::use_evals()
# run the MCP server: stdio by default, transport = "http" for several users
runlog::run_mcp_server()What {mordew} gives
- scaffolding:
create_mordew(),add_tool(),add_resource(),add_prompt(),add_skill(),use_evals(),dev/scripts - a roclet, an extension of roxygen that runs with
devtools::document(), which turns documentation into a registry of tools, resources and prompts - the MCP specification, revisions 2025-11-25 and 2026-07-28, over stdio and HTTP, with a worker pool and limits
- a testing toolkit covering three levels: unit, contract, behaviour, plus security
- an SDK API: servers written in a script, and a stdio client
- deployment helpers: Docker and Posit Connect
Documentation
- Get started: create a package, add a tool, try it, serve it
- Writing tools: tags, types and return conventions
- Resources, prompts and skills
- MCP Apps: pages that the client shows with the result of a tool
- Tasks, progress, logs and questions
- Servers in a script, and the client
- Connecting clients and the HTTP transport
- Testing, Security and Deployment
- MCP specification coverage
-
Why
{mordew}: the design, its prior art and its decisions
Roadmap and task list
Phases 0 to 5 are built: the proof of concept (tools over stdio and HTTP, the testing toolkit, deployment to Docker and Posit Connect), then the coverage of the specification and the SDK API, then MCP Apps and skills. What is left to publish the proof of concept comes first; what follows is a direction, not a commitment. The aim is to make mordew an MCP SDK as well as a framework.