R Language MCP
Secure Docker-based MCP server for R statistical analysis. Run R code and create visualizations through natural language.

Overview
R Language MCP is a secure Docker-based MCP server built with Python and FastMCP. It enables conversational R data visualization and analysis. All code runs in isolated containers for security.
Features
- Natural Language Analysis: R operations through Claude conversations
- Docker Security: Isolated container execution for full security
- File Integration: Local directory mounting for direct data access
- Publication-Quality Visualizations: Create ggplot2 charts through conversation
- Package Management: On-demand R package installation
- Smart Caching: Instant results for repeated operations
- Persistent Containers: Reuse the same environment (no startup delay)
Installation
macOS
brew install r uv python@3.12 --cask docker
uvx --from git+https://github.com/saidsurucu/rlang-mcp-python rlang-mcp-python
Linux (Ubuntu/Debian)
sudo apt install r-base python3.12 docker.io
pip install uv
uvx --from git+https://github.com/saidsurucu/rlang-mcp-python rlang-mcp-python
Windows
Download R and Python 3.12+, then:
pip install uv
uvx --from git+https://github.com/saidsurucu/rlang-mcp-python rlang-mcp-python
Usage Examples
Data Mounting
"Mount ~/Documents/analysis directory as R working directory."
File Discovery
"List all Excel files and show available data."
Analysis
"Load sales_data.xlsx, show summary statistics, calculate monthly totals."
Visualization
"Create a publication-quality bar chart of monthly sales by category."
Security
- All R code runs in isolated Docker containers
- No access to host system
- Volume mounting for secure file sharing
- Resource usage limits
Supported R Packages
- Data Processing: dplyr, tidyr, data.table
- Visualization: ggplot2, plotly, lattice
- Statistics: stats, MASS, car
- File Handling: readxl, readr, haven
License
MIT License