MCP server exposing stats-compass-core tools to LLMs like ChatGPT, Claude, and Gemini
Project description
stats-compass-mcp
A stateful, MCP-compatible toolkit of pandas-based data tools for AI-powered data analysis.
stats-compass-mcp
MCP server that exposes stats-compass-core tools to LLMs like ChatGPT, Claude, and Gemini.
What is this?
This package turns the stats-compass-core toolkit into an MCP (Model Context Protocol) server. Once running, any MCP-compatible client (ChatGPT, Claude, Cursor, VS Code, etc.) can use your data analysis tools directly.
Installation
pip install stats-compass-mcp
⚠️ Important Note on Data Loading
Drag-and-drop file uploads are NOT supported. To load data, you must provide the absolute file path to the file on your local machine.
- ✅ "Load the file at
/Users/me/data.csv" - ❌ Dragging
data.csvinto the chat window
Quick Start
Start the server
stats-compass-mcp serve
Configure your MCP client
1. Claude Desktop (Recommended)
You can configure Claude Desktop automatically:
# Install the package
pip install stats-compass-mcp
# Run the auto-configuration
stats-compass-mcp install
Or manually add this to your claude_desktop_config.json:
{
"mcpServers": {
"stats-compass": {
"command": "uvx",
"args": ["stats-compass-mcp", "serve"]
}
}
}
2. VS Code (Roo Code / Cline)
If you use the Roo Code (formerly Cline) extension in VS Code:
# Install the package
pip install stats-compass-mcp
# Run the auto-configuration
stats-compass-mcp install-vscode
Or manually add this to your mcp_settings.json:
{
"mcpServers": {
"stats-compass": {
"command": "uvx",
"args": ["stats-compass-mcp", "serve"]
}
}
}
3. Claude Code (CLI)
To use Stats Compass with the Claude CLI:
claude mcp add stats-compass -- uvx stats-compass-mcp serve
Available Tools
Once connected, the following tools are available to LLMs:
Data Loading & Management
load_csv- Load CSV files into stateload_dataset- Load built-in sample datasetslist_dataframes- List all DataFrames in stateget_schema- Get column types and infoget_sample- Preview rows from a DataFrame
Data Cleaning
dropna- Remove missing valuesapply_imputation- Fill missing valuesdedupe- Remove duplicate rowshandle_outliers- Detect and handle outliers
Transforms
filter_dataframe- Filter rows by conditiongroupby_aggregate- Group and aggregate datapivot- Pivot tablesadd_column- Add calculated columnsrename_columns- Rename columnsdrop_columns- Remove columns
EDA & Statistics
describe- Summary statisticscorrelations- Correlation matrixhypothesis_tests- T-tests, chi-square, etc.data_quality- Data quality report
Visualization
histogram- Distribution plotsscatter_plot- Scatter plotsbar_chart- Bar chartslineplot- Line plots
Machine Learning
train_linear_regression- Linear regressiontrain_logistic_regression- Logistic regressiontrain_random_forest_classifier- Random forest classificationtrain_random_forest_regressor- Random forest regressionevaluate_model- Model evaluation metrics
Time Series (ARIMA)
check_stationarity- ADF/KPSS testsfit_arima- Fit ARIMA modelsforecast_arima- Generate forecastsfind_optimal_arima- Auto parameter search
How It Works
┌─────────────────────────────────────────────────────────────┐
│ MCP Client │
│ (ChatGPT, Claude, Cursor, VS Code) │
└─────────────────────────┬───────────────────────────────────┘
│ MCP Protocol
▼
┌─────────────────────────────────────────────────────────────┐
│ stats-compass-mcp │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ MCP Server (this package) │ │
│ │ • Registers tools from stats-compass-core │ │
│ │ • Manages DataFrameState per session │ │
│ │ • Converts tool results to MCP responses │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ stats-compass-core (PyPI) │ │
│ │ • DataFrameState (server-side state) │ │
│ │ • 40+ deterministic tools │ │
│ │ • Pydantic schemas for all inputs/outputs │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Contributing
Architecture Overview
If you want to contribute to stats-compass-mcp, it helps to understand how the pieces fit together:
- Entry Point: The
pyproject.tomldefines the scriptstats-compass-mcp = "stats_compass_mcp.cli:main". This is what runs when you execute the command. - CLI (
cli.py): Parses command-line arguments and launches the server. - Server (
server.py):- Initializes a
DataFrameState(fromstats-compass-core) to hold data in memory during the session. - Discovers tools dynamically using
registry.auto_discover()andget_all_tools(). - Registers
list_toolsandcall_toolhandlers to communicate with the MCP client. - Executes tools by injecting the session
stateinto the function calls.
- Initializes a
- Communication: Uses
stdiotransport to exchange JSON-RPC messages with the client (Claude, etc.).
Local Development
-
Clone and Install:
git clone https://github.com/oogunbiyi21/stats-compass-mcp.git cd stats-compass-mcp poetry install
-
Configure for Development: You can automatically configure your MCP clients to use your local development version (instead of the published PyPI version):
# For Claude Desktop poetry run stats-compass-mcp install --dev # For VS Code (Roo Code) poetry run stats-compass-mcp install-vscode --dev
-
Run the Server:
poetry run stats-compass-mcp serve
-
Test with MCP Inspector: You can use the MCP Inspector to test the server interactively:
npx @modelcontextprotocol/inspector poetry run stats-compass-mcp serve
Related Projects
- stats-compass-core - The underlying toolkit
- stats-compass - Streamlit chat UI for data analysis
License
MIT
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 stats_compass_mcp-0.1.8.tar.gz.
File metadata
- Download URL: stats_compass_mcp-0.1.8.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.5 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4399eaec5641fc3edf9ed2126c1ece24354bbcbb233d422852f76c483241fb9e
|
|
| MD5 |
1c7b6374e534534d347fcf3259e87836
|
|
| BLAKE2b-256 |
8bf890bfbc2b8704d1c6c5a01dc23aa3711796618c80772df58adb2ab1629daa
|
File details
Details for the file stats_compass_mcp-0.1.8-py3-none-any.whl.
File metadata
- Download URL: stats_compass_mcp-0.1.8-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.5 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839a987e9f6d3ffe9a23233668c77368fa72802fa23ab9a55e6543932ddfa23f
|
|
| MD5 |
95ea51e30329487bd10e6898469ebcd5
|
|
| BLAKE2b-256 |
c7c556cf7f24e6e84943dccba01ed54df36a2121c7d7edae689220ac55dabf7b
|