Skip to main content
Glama

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

check_project

Detects the project type (or uses the one you give) and returns the findings, with severity and suggestions.

Tool

get_practice

Explains one practice: why it matters, what is checked, good and bad examples, references.

Tool

create_project

Returns the files of a standard project. The assistant writes them into your folder.

Prompt

neues-r-paket

Guides you through a new R package.

Prompt

neue-shiny-app

Guides you through a new Shiny app.

Prompt

neues-quarto-projekt

Guides you through a Quarto or R Markdown project (format argument: quarto or rmarkdown).

Prompt

neue-datenanalyse

Guides you through a data analysis project with renv.

Resource

practice://<id>

One practice as Markdown.

Resource

practices://all

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-mcp

Or 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.git

Then 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 calls get_practice, or reads practice://pkg-readme.

  • Run a prompt, for example /mcp__r-practices__neues-r-paket in 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 lint

Start 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.js

The 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 tools
detect_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

    A3.6/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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).

    Completeness4/5

    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

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      11
      1
      ISC
    • A
      license
      B
      quality
      B
      maintenance
      Enables 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.
      19
      28 npm
      2
      MIT
    • A
      license
      C
      quality
      F
      maintenance
      Provides 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.
      32
      MIT