
saidsurucu/rlang-mcp-python
Deployment & DevOpsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
MCP Server for Running R Language
Обзор
A secure, Docker-based Model Context Protocol (MCP) server for R data visualization and analysis, built with Python and FastMCP. This tool allows you to perform statistical analysis in R through natural language conversations with LLM models like Claude. All R code is executed in secure Docker containers, ensuring complete isolation and security. - 🗣️ : Chat with AI to perform complex statistical analyses - 🐳 : All R code runs in isolated containers with network disabled - 📊 : AI runs R code and returns results without you writing code - 📁 : Mount multiple local directories for R to access - 📈 : Plots automatically returned as base64 PNG images - 🔒 : Optional auto-redaction of personal data before it reaches the LLM - 💾 : R variables persist between calls - ⚡ : Configurable result caching for instant repeated operations - 📦 : Missing R packages automatically installed This project is inspired by gdbelvin's rlang-mcp-server but is a complete Python reimplementation using the...
README
Показан фрагмент оригинального README. Открыть оригинал.
Python R-Server MCP
A secure, Docker-based Model Context Protocol (MCP) server for R data visualization and analysis, built with Python and FastMCP.
What is this? This tool allows you to perform statistical analysis in R through natural language conversations with LLM models like Claude. All R code is executed in secure Docker containers, ensuring complete isolation and security.
Key Benefits:
- 🗣️ Natural Language Interface: Chat with AI to perform complex statistical analyses
- 🐳 Secure Docker Execution: All R code runs in isolated containers with network disabled
- 📊 Automatic R Execution: AI runs R code and returns results without you writing code
- 📁 Multiple Directory Mounting: Mount multiple local directories for R to access
- 📈 Inline Plot Capture: Plots automatically returned as base64 PNG images
- 🔒 PII Protection: Optional auto-redaction of personal data before it reaches the LLM
- 💾 Session Persistence: R variables persist between calls
- ⚡ Smart Caching: Configurable result caching for instant repeated operations
- 📦 Auto Library Detection: Missing R packages automatically installed
🌐 Türkçe | English
Overview
This project is inspired by gdbelvin’s rlang-mcp-server but is a complete Python reimplementation using the FastMCP framework. While the original Go version provided basic R visualization tools, this Python version extends the functionality with comprehensive security, file management, and data privacy features.
Features
🎨 Visualization & Analysis
- ggplot2 Rendering: Execute R code with ggplot2 commands and return publication-ready visualizations
- Inline Plot Capture: Plots automatically detected and returned as base64 PNG
- R Script Execution: Run any R script with smart file handling and return formatted output
- Session Persistence: R variables and workspace persist between calls via
.RData
📁 File Management
- Multiple Directory Mounting: Mount multiple local directories with custom mount points
- Smart File Discovery: Use R scripts to explore and analyze files in mounted directories
- Unmount Support: Cleanly unmount directories when done
📦 Package Management
- Auto Library Detection:
library()andrequire()calls parsed, missing packages auto-installed - Package Installation: Install R packages on-demand with version control
- Automatic Dependencies: Smart package dependency resolution
- Temporary Network: Network temporarily enabled only during package installation
🛡️ Security & Isolation
- Mandatory Docker: All R code execution in isolated containers
- Network Disabled by Default: Container cannot access internet during R execution
- Resource Limits: Configurable memory (default 2GB) and CPU limits
Установка
uvx --from git+https://github.com/saidsurucu/rlang-mcp-python rlang-mcp-pythonКонфигурация
{
"mcpServers": {
"r-server-python": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/saidsurucu/rlang-mcp-python",
"rlang-mcp-python"
]
}
}
}