Comprehensive Model Context Protocol server with 44 statistical analysis tools, flexible configuration, and HTTP transport
Project description
RMCP: Statistical Analysis through Natural Conversation
Turn conversations into comprehensive statistical analysis - A Model Context Protocol (MCP) server with 44 statistical analysis tools across 11 categories. 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)
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 โ | ๐ง 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"
๐ 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 packages: Install all at once:
install.packages(c(
"jsonlite", "plm", "lmtest", "sandwich", "AER", "dplyr",
"forecast", "vars", "urca", "tseries", "nortest", "car",
"rpart", "randomForest", "ggplot2", "gridExtra", "tidyr",
"rlang", "knitr", "broom"
))
Install RMCP
# 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:
{
"mcpServers": {
"rmcp": {
"command": "rmcp",
"args": ["start"]
}
}
}
Command Line Usage
# 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:
# 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 โ
๐ฅ Key Features
- ๐ฏ Natural Conversation: Ask questions in plain English, get statistical analysis
- ๐ 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: Controlled R execution with configurable permissions
๐ Documentation
| Resource | Description |
|---|---|
| Quick Start Guide | Copy-paste ready examples with real data |
| Economic Research Examples | Panel data, time series, advanced econometrics |
| Time Series Examples | ARIMA, forecasting, decomposition |
| Image Display Examples | Inline visualizations in Claude |
| API Documentation | 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!
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 for detailed guidelines.
๐ License
MIT License - see LICENSE file for details.
๐ ๏ธ Quick Troubleshooting
R not found?
# macOS: brew install r
# Ubuntu: sudo apt install r-base
R --version
Missing R packages?
rmcp check-r-packages # Check what's missing
MCP connection issues?
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | rmcp start
๐ Need more help? Check the examples directory for working code.
๐ Support
- ๐ Issues: GitHub Issues
- ๐ Examples: Working examples
Ready to turn conversations into statistical insights? Install RMCP and start analyzing data through AI assistants today! ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rmcp-0.4.2.tar.gz.
File metadata
- Download URL: rmcp-0.4.2.tar.gz
- Upload date:
- Size: 180.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acea390b2823ee7b166dbf3496e806b07ab6db2ccda416e1c24c8eb4e1c61334
|
|
| MD5 |
963355cc232932544068206efb59108c
|
|
| BLAKE2b-256 |
4d714acaa9514e2a62fcc6317f302a628602879f814606bd9e0704bcc420c36f
|
Provenance
The following attestation bundles were made for rmcp-0.4.2.tar.gz:
Publisher:
python-publish.yml on finite-sample/rmcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rmcp-0.4.2.tar.gz -
Subject digest:
acea390b2823ee7b166dbf3496e806b07ab6db2ccda416e1c24c8eb4e1c61334 - Sigstore transparency entry: 622377781
- Sigstore integration time:
-
Permalink:
finite-sample/rmcp@0b7fa1200ae80c52bc1da531fc9ff6196450e1e7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/finite-sample
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0b7fa1200ae80c52bc1da531fc9ff6196450e1e7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file rmcp-0.4.2-py3-none-any.whl.
File metadata
- Download URL: rmcp-0.4.2-py3-none-any.whl
- Upload date:
- Size: 237.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a336516b8414e8b22df44b2c773bf4072d066d6074ab7d13be8fdc2c3f2d9fe0
|
|
| MD5 |
88381890ce45aea82a364879a6a542e2
|
|
| BLAKE2b-256 |
3695c92667f7b561a6add908e1265755d4c1c48ec01a59c1a52f33d319633342
|
Provenance
The following attestation bundles were made for rmcp-0.4.2-py3-none-any.whl:
Publisher:
python-publish.yml on finite-sample/rmcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rmcp-0.4.2-py3-none-any.whl -
Subject digest:
a336516b8414e8b22df44b2c773bf4072d066d6074ab7d13be8fdc2c3f2d9fe0 - Sigstore transparency entry: 622377782
- Sigstore integration time:
-
Permalink:
finite-sample/rmcp@0b7fa1200ae80c52bc1da531fc9ff6196450e1e7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/finite-sample
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0b7fa1200ae80c52bc1da531fc9ff6196450e1e7 -
Trigger Event:
workflow_dispatch
-
Statement type: