A skill that turns an R package into a small, self-contained MCP knowledge server — an MCP an AI assistant can query for the package's functions, arguments, datasets, dependencies, and examples, so it can look the API up instead of guessing.
It reads documentation from the package's own .Rd files (via R's tools::Rd_db) into a
knowledge.json, then serves it through a generic FastMCP
server. The server needs no R at runtime; pair it with an R runtime if you also want to run code.
- R with
RscriptonPATH(for extraction) - uv — runs the generated server and the tests; it provisions
Python and the
mcppackage itself, so nothing else to install
# 1. extract the package's docs into knowledge.json
Rscript scripts/extract_rpkg.R <package> <package>_knowledge.json --install
# 2. assemble the server
python scripts/build_server.py <package>_knowledge.json <package>-mcp
# 3. test it — protocol (tools respond) and content (examples run)
uv run scripts/test_server.py <package>-mcp
Rscript scripts/check_examples.R <package>The build step also writes a paste-ready registration snippet (mcp.config.json). See
SKILL.md for the full workflow and options (e.g. --update to match the current
CRAN version instead of a stale local install).
package_overview, search_functions, get_function, list_functions, get_examples,
get_related, get_recipes, list_datasets, get_dataset, get_dependencies.
This is an agent skill: point a coding agent at SKILL.md (or drop this directory into your agent's skills folder) and ask it to build an MCP for an R package. The scripts can also be run directly, as shown above.
SKILL.md— the workflow an agent followsscripts/— extractor, builder, server template, and test/validate scriptsreferences/— theknowledge.jsonschema, extraction notes, and server/registration notes
MIT.