# RMCP: Statistical Analysis through Natural Conversation
[](https://github.com/finite-sample/rmcp/actions/workflows/ci.yml)
[](https://pypi.org/project/rmcp/)
[](https://pepy.tech/project/rmcp)
[](https://finite-sample.github.io/rmcp/)
[](https://github.com/finite-sample/rmcp/blob/main/LICENSE)
**Turn conversations into comprehensive statistical analysis** - A Model Context Protocol (MCP) server with 44 statistical analysis tools across 11 categories and **429 R packages** from systematic CRAN task views. RMCP enables AI assistants to perform sophisticated statistical modeling, econometric analysis, machine learning, time series analysis, and data science tasks through natural conversation.
## ๐ Quick Start (30 seconds)
```bash
pip install rmcp
rmcp start
```
That's it! RMCP is now ready to handle statistical analysis requests via Claude Desktop or any MCP client.
**๐ฏ [Working examples โ](examples/quick_start_guide.md)** | **๐ง [Troubleshooting โ](#-quick-troubleshooting)**
## โจ What Can RMCP Do?
### ๐ **Regression & Economics**
Linear regression, logistic models, panel data, instrumental variables โ *"Analyze ROI of marketing spend"*
### โฐ **Time Series & Forecasting**
ARIMA models, decomposition, stationarity testing โ *"Forecast next quarter's sales"*
### ๐ง **Machine Learning**
Clustering, decision trees, random forests โ *"Segment customers by behavior"*
### ๐ **Statistical Testing**
T-tests, ANOVA, chi-square, normality tests โ *"Is my A/B test significant?"*
### ๐ **Data Analysis**
Descriptive stats, outlier detection, correlation analysis โ *"Summarize this dataset"*
### ๐ **Data Transformation**
Standardization, winsorization, lag/lead variables โ *"Prepare data for modeling"*
### ๐ **Professional Visualizations**
Inline plots in Claude: scatter plots, histograms, heatmaps โ *"Show me a correlation matrix"*
### ๐ **Smart File Operations**
CSV, Excel, JSON import with validation โ *"Load and analyze my sales data"*
### ๐ค **Natural Language Features**
Formula building, error recovery, example datasets โ *"Help me build a regression formula"*
**๐ [See working examples โ](examples/quick_start_guide.md)**
## ๐ Real Usage with Claude
### Business Analysis
**You:** *"I have sales data and marketing spend. Can you analyze the ROI?"*
**Claude:** *"I'll run a regression analysis to measure marketing effectiveness..."*
**Result:** *"Every $1 spent on marketing generates $4.70 in sales. The relationship is highly significant (p < 0.001) with Rยฒ = 0.979"*
### Economic Research
**You:** *"Test if GDP growth and unemployment follow Okun's Law using my country data"*
**Claude:** *"I'll analyze the correlation between GDP growth and unemployment..."*
**Result:** *"Strong support for Okun's Law: correlation r = -0.944. Higher GDP growth significantly reduces unemployment."*
### Customer Analytics
**You:** *"Predict customer churn using tenure and monthly charges"*
**Claude:** *"I'll build a logistic regression model for churn prediction..."*
**Result:** *"Model achieves 100% accuracy. Each additional month of tenure reduces churn risk by 11.3%. Higher charges increase churn risk by 3% per dollar."*
## ๐ฆ Installation
### Prerequisites
- **Python 3.10+**
- **R 4.4.0+** with **comprehensive package ecosystem**: RMCP uses a systematic 429-package whitelist from CRAN task views organized into 19+ categories:
```r
# Core packages (install these first)
install.packages(c(
"jsonlite", "dplyr", "ggplot2", "broom", "plm", "forecast",
"randomForest", "rpart", "caret", "AER", "vars", "mgcv"
))
# Full ecosystem automatically available: Machine Learning (61 packages),
# Econometrics (55 packages), Time Series (48 packages),
# Bayesian Analysis (32 packages), and more
```
**Package Selection**: Evidence-based using CRAN task views, download statistics, and 4-tier security assessment
### Install RMCP
```bash
# Standard installation
pip install rmcp
# With HTTP transport support
pip install rmcp[http]
# Development installation
git clone https://github.com/finite-sample/rmcp.git
cd rmcp
pip install -e ".[dev]"
```
### Claude Desktop Integration
Add to your Claude Desktop MCP configuration:
```json
{
"mcpServers": {
"rmcp": {
"command": "rmcp",
"args": ["start"]
}
}
}
```
### Command Line Usage
```bash
# Start MCP server (for Claude Desktop)
rmcp start
# Start HTTP server (for web apps)
rmcp serve-http --host 0.0.0.0 --port 8080
# Start HTTPS server (production ready)
rmcp serve-http --ssl-keyfile server.key --ssl-certfile server.crt --port 8443
# Quick HTTPS setup for development
./scripts/setup/setup_https_dev.sh && source certs/https-env.sh && rmcp serve-http
# Use configuration file
rmcp --config ~/.rmcp/config.json start
# Enable debug mode
rmcp --debug start
# Check installation
rmcp --version
```
### โ๏ธ Configuration
RMCP supports flexible configuration through environment variables, configuration files, and command-line options:
```bash
# Environment variables
export RMCP_HTTP_PORT=9000
export RMCP_R_TIMEOUT=180
export RMCP_LOG_LEVEL=DEBUG
rmcp start
# Configuration file (~/.rmcp/config.json)
{
"http": {"port": 9000},
"r": {"timeout": 180},
"logging": {"level": "DEBUG"}
}
# Docker with environment variables
docker run -e RMCP_HTTP_HOST=0.0.0.0 -e RMCP_HTTP_PORT=8000 rmcp:latest
```
**๐ [Complete Configuration Guide โ](docs/configuration/index.rst)** (auto-generated from code)
## ๐ฅ Key Features
- **๐ฏ Natural Conversation**: Ask questions in plain English, get statistical analysis
- **๐ Comprehensive Package Ecosystem**: 429 R packages from systematic CRAN task views with 4-tier security system
- **๐ Professional Output**: Formatted results with markdown tables and inline visualizations
- **๐ Production Ready**: Full MCP protocol compliance with HTTP transport and SSE
- **โ๏ธ Flexible Configuration**: Environment variables, config files, and CLI options
- **โก Fast & Reliable**: 100% test success rate across all scenarios
- **๐ Multiple Transports**: stdio (Claude Desktop) and HTTP (web applications)
- **๐ก๏ธ Secure**: Evidence-based package selection with security-conscious permission tiers
## ๐ Documentation
| Resource | Description |
|----------|-------------|
| **[Quick Start Guide](examples/quick_start_guide.md)** | Copy-paste ready examples with real data |
| **[Economic Research Examples](examples/economic_research_example.md)** | Panel data, time series, advanced econometrics |
| **[Time Series Examples](examples/advanced_time_series_example.md)** | ARIMA, forecasting, decomposition |
| **[Image Display Examples](examples/image_display_example.md)** | Inline visualizations in Claude |
| **[API Documentation](docs/)** | Auto-generated API reference |
## ๐งช Validation
RMCP has been tested with real-world scenarios achieving **100% success rate**:
- โ
**Business Analysts**: Sales forecasting with 97.9% Rยฒ, $4.70 ROI per marketing dollar
- โ
**Economists**: Macroeconomic analysis confirming Okun's Law (r=-0.944)
- โ
**Data Scientists**: Customer churn prediction with 100% accuracy
- โ
**Researchers**: Treatment effect analysis with significant results (p<0.001)
## ๐ค Contributing
We welcome contributions!
```bash
git clone https://github.com/finite-sample/rmcp.git
cd rmcp
pip install -e ".[dev]"
# Run tests
python tests/unit/test_new_tools.py
python tests/e2e/test_claude_desktop_scenarios.py
# Format code
black rmcp/
```
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
## ๐ License
MIT License - see [LICENSE](LICENSE) file for details.
## ๐ ๏ธ Quick Troubleshooting
**R not found?**
```bash
# macOS: brew install r
# Ubuntu: sudo apt install r-base
R --version
```
**Missing R packages?**
```bash
rmcp check-r-packages # Check what's missing
```
**MCP connection issues?**
```bash
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | rmcp start
```
**๐ Need more help?** Check the [examples](examples/) directory for working code.
## ๐ Support
- ๐ **Issues**: [GitHub Issues](https://github.com/finite-sample/rmcp/issues)
- ๐ **Examples**: [Working examples](examples/quick_start_guide.md)
---
**Ready to turn conversations into statistical insights?** Install RMCP and start analyzing data through AI assistants today! ๐
Raw data
{
"_id": null,
"home_page": null,
"name": "rmcp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "mcp, r, statistics, econometrics, model-context-protocol, data-analysis, http, fastapi, sse, configuration",
"author": "Gaurav Sood",
"author_email": "gsood07@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f1/51/ce1a936f95f71de606ce9a426cc33ecb96e9b35044b32252164311df484e/rmcp-0.5.1.tar.gz",
"platform": null,
"description": "# RMCP: Statistical Analysis through Natural Conversation\n\n[](https://github.com/finite-sample/rmcp/actions/workflows/ci.yml)\n[](https://pypi.org/project/rmcp/)\n[](https://pepy.tech/project/rmcp)\n[](https://finite-sample.github.io/rmcp/)\n[](https://github.com/finite-sample/rmcp/blob/main/LICENSE)\n\n**Turn conversations into comprehensive statistical analysis** - A Model Context Protocol (MCP) server with 44 statistical analysis tools across 11 categories and **429 R packages** from systematic CRAN task views. RMCP enables AI assistants to perform sophisticated statistical modeling, econometric analysis, machine learning, time series analysis, and data science tasks through natural conversation.\n\n## \ud83d\ude80 Quick Start (30 seconds)\n\n```bash\npip install rmcp\nrmcp start\n```\n\nThat's it! RMCP is now ready to handle statistical analysis requests via Claude Desktop or any MCP client.\n\n**\ud83c\udfaf [Working examples \u2192](examples/quick_start_guide.md)** | **\ud83d\udd27 [Troubleshooting \u2192](#-quick-troubleshooting)**\n\n## \u2728 What Can RMCP Do?\n\n### \ud83d\udcca **Regression & Economics** \nLinear regression, logistic models, panel data, instrumental variables \u2192 *\"Analyze ROI of marketing spend\"*\n\n### \u23f0 **Time Series & Forecasting**\nARIMA models, decomposition, stationarity testing \u2192 *\"Forecast next quarter's sales\"*\n\n### \ud83e\udde0 **Machine Learning** \nClustering, decision trees, random forests \u2192 *\"Segment customers by behavior\"*\n\n### \ud83d\udcc8 **Statistical Testing**\nT-tests, ANOVA, chi-square, normality tests \u2192 *\"Is my A/B test significant?\"*\n\n### \ud83d\udccb **Data Analysis**\nDescriptive stats, outlier detection, correlation analysis \u2192 *\"Summarize this dataset\"*\n\n### \ud83d\udd04 **Data Transformation**\nStandardization, winsorization, lag/lead variables \u2192 *\"Prepare data for modeling\"*\n\n### \ud83d\udcca **Professional Visualizations**\nInline plots in Claude: scatter plots, histograms, heatmaps \u2192 *\"Show me a correlation matrix\"*\n\n### \ud83d\udcc1 **Smart File Operations**\nCSV, Excel, JSON import with validation \u2192 *\"Load and analyze my sales data\"*\n\n### \ud83e\udd16 **Natural Language Features**\nFormula building, error recovery, example datasets \u2192 *\"Help me build a regression formula\"*\n\n**\ud83d\udc49 [See working examples \u2192](examples/quick_start_guide.md)**\n\n## \ud83d\udcca Real Usage with Claude\n\n### Business Analysis\n**You:** *\"I have sales data and marketing spend. Can you analyze the ROI?\"*\n\n**Claude:** *\"I'll run a regression analysis to measure marketing effectiveness...\"*\n\n**Result:** *\"Every $1 spent on marketing generates $4.70 in sales. The relationship is highly significant (p < 0.001) with R\u00b2 = 0.979\"*\n\n### Economic Research\n**You:** *\"Test if GDP growth and unemployment follow Okun's Law using my country data\"*\n\n**Claude:** *\"I'll analyze the correlation between GDP growth and unemployment...\"*\n\n**Result:** *\"Strong support for Okun's Law: correlation r = -0.944. Higher GDP growth significantly reduces unemployment.\"*\n\n### Customer Analytics \n**You:** *\"Predict customer churn using tenure and monthly charges\"*\n\n**Claude:** *\"I'll build a logistic regression model for churn prediction...\"*\n\n**Result:** *\"Model achieves 100% accuracy. Each additional month of tenure reduces churn risk by 11.3%. Higher charges increase churn risk by 3% per dollar.\"*\n\n## \ud83d\udce6 Installation\n\n### Prerequisites\n- **Python 3.10+** \n- **R 4.4.0+** with **comprehensive package ecosystem**: RMCP uses a systematic 429-package whitelist from CRAN task views organized into 19+ categories:\n\n```r\n# Core packages (install these first)\ninstall.packages(c(\n \"jsonlite\", \"dplyr\", \"ggplot2\", \"broom\", \"plm\", \"forecast\", \n \"randomForest\", \"rpart\", \"caret\", \"AER\", \"vars\", \"mgcv\"\n))\n\n# Full ecosystem automatically available: Machine Learning (61 packages), \n# Econometrics (55 packages), Time Series (48 packages), \n# Bayesian Analysis (32 packages), and more\n```\n\n**Package Selection**: Evidence-based using CRAN task views, download statistics, and 4-tier security assessment\n\n### Install RMCP\n\n```bash\n# Standard installation\npip install rmcp\n\n# With HTTP transport support\npip install rmcp[http]\n\n# Development installation\ngit clone https://github.com/finite-sample/rmcp.git\ncd rmcp\npip install -e \".[dev]\"\n```\n\n### Claude Desktop Integration\n\nAdd to your Claude Desktop MCP configuration:\n\n```json\n{\n \"mcpServers\": {\n \"rmcp\": {\n \"command\": \"rmcp\",\n \"args\": [\"start\"]\n }\n }\n}\n```\n\n### Command Line Usage\n\n```bash\n# Start MCP server (for Claude Desktop)\nrmcp start\n\n# Start HTTP server (for web apps)\nrmcp serve-http --host 0.0.0.0 --port 8080\n\n# Start HTTPS server (production ready)\nrmcp serve-http --ssl-keyfile server.key --ssl-certfile server.crt --port 8443\n\n# Quick HTTPS setup for development\n./scripts/setup/setup_https_dev.sh && source certs/https-env.sh && rmcp serve-http\n\n# Use configuration file\nrmcp --config ~/.rmcp/config.json start\n\n# Enable debug mode\nrmcp --debug start\n\n# Check installation\nrmcp --version\n```\n\n### \u2699\ufe0f Configuration\n\nRMCP supports flexible configuration through environment variables, configuration files, and command-line options:\n\n```bash\n# Environment variables\nexport RMCP_HTTP_PORT=9000\nexport RMCP_R_TIMEOUT=180\nexport RMCP_LOG_LEVEL=DEBUG\nrmcp start\n\n# Configuration file (~/.rmcp/config.json)\n{\n \"http\": {\"port\": 9000},\n \"r\": {\"timeout\": 180},\n \"logging\": {\"level\": \"DEBUG\"}\n}\n\n# Docker with environment variables\ndocker run -e RMCP_HTTP_HOST=0.0.0.0 -e RMCP_HTTP_PORT=8000 rmcp:latest\n```\n\n**\ud83d\udcd6 [Complete Configuration Guide \u2192](docs/configuration/index.rst)** (auto-generated from code)\n\n## \ud83d\udd25 Key Features\n\n- **\ud83c\udfaf Natural Conversation**: Ask questions in plain English, get statistical analysis\n- **\ud83d\udcda Comprehensive Package Ecosystem**: 429 R packages from systematic CRAN task views with 4-tier security system\n- **\ud83d\udcca Professional Output**: Formatted results with markdown tables and inline visualizations \n- **\ud83d\udd12 Production Ready**: Full MCP protocol compliance with HTTP transport and SSE\n- **\u2699\ufe0f Flexible Configuration**: Environment variables, config files, and CLI options\n- **\u26a1 Fast & Reliable**: 100% test success rate across all scenarios\n- **\ud83c\udf10 Multiple Transports**: stdio (Claude Desktop) and HTTP (web applications)\n- **\ud83d\udee1\ufe0f Secure**: Evidence-based package selection with security-conscious permission tiers\n\n## \ud83d\udcda Documentation\n\n| Resource | Description |\n|----------|-------------|\n| **[Quick Start Guide](examples/quick_start_guide.md)** | Copy-paste ready examples with real data |\n| **[Economic Research Examples](examples/economic_research_example.md)** | Panel data, time series, advanced econometrics |\n| **[Time Series Examples](examples/advanced_time_series_example.md)** | ARIMA, forecasting, decomposition |\n| **[Image Display Examples](examples/image_display_example.md)** | Inline visualizations in Claude |\n| **[API Documentation](docs/)** | Auto-generated API reference |\n\n## \ud83e\uddea Validation\n\nRMCP has been tested with real-world scenarios achieving **100% success rate**:\n\n- \u2705 **Business Analysts**: Sales forecasting with 97.9% R\u00b2, $4.70 ROI per marketing dollar\n- \u2705 **Economists**: Macroeconomic analysis confirming Okun's Law (r=-0.944) \n- \u2705 **Data Scientists**: Customer churn prediction with 100% accuracy\n- \u2705 **Researchers**: Treatment effect analysis with significant results (p<0.001)\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! \n\n```bash\ngit clone https://github.com/finite-sample/rmcp.git\ncd rmcp\npip install -e \".[dev]\"\n\n# Run tests\npython tests/unit/test_new_tools.py\npython tests/e2e/test_claude_desktop_scenarios.py\n\n# Format code\nblack rmcp/\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\n## \ud83d\udcc4 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## \ud83d\udee0\ufe0f Quick Troubleshooting\n\n**R not found?**\n```bash\n# macOS: brew install r\n# Ubuntu: sudo apt install r-base\nR --version\n```\n\n**Missing R packages?**\n```bash\nrmcp check-r-packages # Check what's missing\n```\n\n**MCP connection issues?**\n```bash\necho '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{}}' | rmcp start\n```\n\n**\ud83d\udcd6 Need more help?** Check the [examples](examples/) directory for working code.\n\n## \ud83d\ude4b Support\n\n- \ud83d\udc1b **Issues**: [GitHub Issues](https://github.com/finite-sample/rmcp/issues)\n- \ud83d\udcd6 **Examples**: [Working examples](examples/quick_start_guide.md)\n\n---\n\n**Ready to turn conversations into statistical insights?** Install RMCP and start analyzing data through AI assistants today! \ud83d\ude80\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Comprehensive Model Context Protocol server with 53 statistical analysis tools, universal operation approval system, and HTTP transport",
"version": "0.5.1",
"project_urls": {
"Documentation": "https://github.com/finite-sample/rmcp#readme",
"Homepage": "https://github.com/finite-sample/rmcp",
"Issues": "https://github.com/finite-sample/rmcp/issues",
"Repository": "https://github.com/finite-sample/rmcp"
},
"split_keywords": [
"mcp",
" r",
" statistics",
" econometrics",
" model-context-protocol",
" data-analysis",
" http",
" fastapi",
" sse",
" configuration"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c0e3a34870054d5afe0ab36d687cc0cc704d5449206cf3538d89d189cabe950d",
"md5": "5fbf1aa4c5fbe7debd67f2636901f53f",
"sha256": "df01e53d3ce3761167a6a5262037940afd36a2782caef350915c5d00cc188fc9"
},
"downloads": -1,
"filename": "rmcp-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5fbf1aa4c5fbe7debd67f2636901f53f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 255819,
"upload_time": "2025-10-20T23:00:23",
"upload_time_iso_8601": "2025-10-20T23:00:23.486790Z",
"url": "https://files.pythonhosted.org/packages/c0/e3/a34870054d5afe0ab36d687cc0cc704d5449206cf3538d89d189cabe950d/rmcp-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f151ce1a936f95f71de606ce9a426cc33ecb96e9b35044b32252164311df484e",
"md5": "c5c50fef72483134bcdeeb9ea0b6da84",
"sha256": "397913d04e38a5a02b2895df2002681678eb11906dcb007d4e4dbec0f10a0c9c"
},
"downloads": -1,
"filename": "rmcp-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "c5c50fef72483134bcdeeb9ea0b6da84",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 196118,
"upload_time": "2025-10-20T23:00:24",
"upload_time_iso_8601": "2025-10-20T23:00:24.920049Z",
"url": "https://files.pythonhosted.org/packages/f1/51/ce1a936f95f71de606ce9a426cc33ecb96e9b35044b32252164311df484e/rmcp-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-20 23:00:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "finite-sample",
"github_project": "rmcp#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rmcp"
}