r-coding-mcp
This MCP server helps an AI assistant detect, validate, explain, and scaffold R projects against best practices.
Detect the R workflow type from a directory path.
Validate an entire R project against best practices, with optional workflow, category, severity, and finding-count filters.
Validate a single R or Quarto file with similar filters.
Retrieve detailed guidance for a specific best practice by ID.
List and filter best practices by workflow, category, severity, tags, enforcement type, or free-text query.
Generate standard project-template file contents for a chosen R workflow, with optional project name and author details.
The server returns findings/templates but does not write files; the assistant writes them into the project.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@r-coding-mcp run R CMD check on my package and summarize the results"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
R Best Practices MCP Server
An MCP server for R projects. Your AI assistant can use it to check a project against R best practices, explain each practice, and create a standard project with you, step by step.
It works with Claude Code, Cursor and other MCP clients over stdio. It has no web interface, no REST API and no command-line tool: the server and the assistant are the whole product.
What it gives your assistant
Kind | Name | What it does |
Tool |
| Detects the project type (or uses the one you give) and returns the findings, with severity and suggestions. |
Tool |
| Explains one practice: why it matters, what is checked, good and bad examples, references. |
Tool |
| Returns the files of a standard project. The assistant writes them into your folder. |
Prompt |
| Guides you through a new R package. |
Prompt |
| Guides you through a new Shiny app. |
Prompt |
| Guides you through a Quarto or R Markdown project ( |
Prompt |
| Guides you through a data analysis project with |
Resource |
| One practice as Markdown. |
Resource |
| An index of all practices, grouped by project type. |
The knowledge base holds 73 practices for 12 project types. 62 are checked automatically, 11 are guidance only.
Related MCP server: github-analyzer-mcp
Install
The server is not published to npm or Docker Hub yet. Install it straight from GitHub.
Claude Code
claude mcp add --scope user r-practices -- npm exec --yes --package=github:alexseymer/r-best-practice-mcp -- r-best-practices-mcpOr add it to a project's .mcp.json:
{
"mcpServers": {
"r-practices": {
"command": "npm",
"args": ["exec", "--yes", "--package=github:alexseymer/r-best-practice-mcp", "--", "r-best-practices-mcp"]
}
}
}Cursor
Add the same entry to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project).
Docker
docker build -t r-practices https://github.com/alexseymer/r-best-practice-mcp.gitThen use docker run -i --rm r-practices as the command in your client's MCP configuration.
Updating
npm exec caches the package. To get a newer version, pin a commit (github:alexseymer/r-best-practice-mcp#<sha>) or
clear the npm cache.
Using it
Ask "check this project" with the path of the project folder. The assistant calls
check_project.Ask "explain
pkg-readme". The assistant callsget_practice, or readspractice://pkg-readme.Run a prompt, for example
/mcp__r-practices__neues-r-paketin Claude Code. The assistant asks for the project name, the author and an optional e-mail address, then writes the files into the folder you name.
The server never writes files itself. create_project only returns the file list, and the prompts tell the assistant to ask before it replaces an existing file.
Development
Requires Node.js 18 or newer.
npm install # also builds the server (prepare script)
npm run build # compile to dist/
npm test # unit and regression tests
npm run lintStart the server by hand for a quick check:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' \
| node dist/index.jsThe architecture, the rules for adding practices and templates, and the product specification are in SPEC.md and CLAUDE.md. Contribution rules are in CONTRIBUTING.md.
License
MIT. See LICENSE.
Available Tools
6 toolsdetect_workflowC
Detect the R workflow type from a directory path
Inputs: path (required).
generate_templateC
Generate a project template for a specific R workflow
Inputs: workflow (required), authorName, authorEmail, projectName.
get_practiceC
Get details about a specific best practice
Inputs: id (required).
list_practicesC
List best practices, optionally filtered by workflow, category, minimum severity, tags, enforcement type (automated check or guidance only) or free-text query
Inputs: tags, limit, query, category, +3 more.
validate_fileA
Validate a single R or Quarto file. Optional filters narrow the returned findings; the summary always counts all findings.
Inputs: path (required), categories, maxFindings, minSeverity.
validate_projectA
Validate an R project against best practices. Optional filters narrow the returned findings; the summary always counts all findings. If no project type is detected the result has no findings and a warnings array: that means no checks ran, not that the project is clean.
Inputs: path (required), workflow, categories, maxFindings, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct target: detect_workflow (identify type), validate_file vs validate_project (different scopes of validation), get_practice vs list_practices (single vs collection), and generate_template. No two tools could reasonably be confused for one another.
All six tools follow a consistent verb_noun snake_case convention (detect_workflow, validate_file, validate_project, get_practice, list_practices, generate_template). The pattern is predictable throughout with no deviations.
Six tools is well-scoped for an R best-practices/validation server, with no redundancy. Each tool covers a distinct capability (detection, validation, practice lookup, template generation).
The surface covers the core lifecycle: detection, validation at file and project level, practice discovery, and template generation. Some gaps remain, such as auto-fix/remediation of findings, but the essential workflows are covered.
Maintenance
Related MCP Connectors
Package, dependency, CI and config safety checks for coding agents. Pay per call.
Live SEO workflow tools for Claude Code, Codex, and AI agents.
Build, validate, test-run and publish AIOS workflows from Claude Code, Codex, Cursor or VS Code.
Run UX research from Claude — create card sort studies, list studies, pull headline stats.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude to access and manage GitHub repositories dynamically at runtime, including private repos, with tools for browsing files, searching code, and viewing commits, pull requests, and issues.111ISC
- AlicenseNot gradedqualityDmaintenanceEnables Claude to analyze GitHub repositories with tools for health scoring, contributor analysis, issue tracking, code search, and more.MIT
- AlicenseBqualityBmaintenanceEnables Claude to take a project from an empty folder to a published GitHub repository and npm, PyPI, or crates.io package. It automates preflight checks, scaffolding, quality checks, publishing, trusted-publishing setup, tagging, and release workflows, leaving only sign-in, 2FA, and approval clicks to the user.1928 npm2MIT
- AlicenseCqualityFmaintenanceProvides read-only, source-attributed access to current CRAN and Bioconductor package metadata, dependencies, function documentation, vignettes, and version compatibility checks for AI assistants. It also enables retrieval of official Shiny, Quarto, Positron, and visualization docs alongside static analysis of R, ggplot2, and Quarto source code without executing it.32MIT