Skip to main content

MCP server exposing stats-compass-core tools to LLMs like ChatGPT, Claude, and Gemini

Project description

Stats Compass Logo

stats-compass-mcp

A stateful, MCP-compatible toolkit of pandas-based data tools for AI-powered data analysis.

PyPI version Python 3.11+ License: MIT

⚠️ Status: Early developer release (v0.2)
Optimized for Claude models
Gemini and GPT tool calling may be inconsistent.

stats-compass-mcp

Demo 1: Loading and exploring data

Stats Compass MCP turns the stats-compass-core toolkit into an MCP server that AI agents can call in a reproducible, stateful way across workflows.

What is this?

This package turns the stats-compass-core toolkit into an MCP (Model Context Protocol) server. Once running, any MCP-compatible client can use your data analysis tools directly.

Client Compatibility

Client Status Notes
Claude Desktop ✅ Supported Recommended. Best tool selection.
VS Code Copilot Chat ✅ Supported Native MCP integration.
Cursor ⚠️ Experimental Pending official MCP release.
GPT / ChatGPT ⚠️ Partial Tool calling may be inconsistent with large toolsets.
Gemini ⚠️ Unstable May throw errors with complex schemas.

Installation

pip install stats-compass-mcp

Prerequisite: The MCP configurations below use uvx, which requires uv to be installed.

⚠️ 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.csv into the chat window

Quick Start

Local Mode (Recommended for most users)

Start the server via stdio for direct use with Claude Desktop or VS Code:

stats-compass-mcp run

Remote/HTTP Mode (For Docker/hosting)

Start the server as an HTTP endpoint:

stats-compass-mcp serve --port 8000

Configure Your MCP Client

Claude Desktop

Auto-configure:

stats-compass-mcp install --client claude

To also add a remote server config:

stats-compass-mcp install --client claude --remote-url http://localhost:8000/mcp

Or manually add to claude_desktop_config.json:

{
  "mcpServers": {
    "stats-compass": {
      "command": "uvx",
      "args": ["stats-compass-mcp", "run"]
    }
  }
}

VS Code (GitHub Copilot)

Auto-configure:

stats-compass-mcp install --client vscode

To also add a remote server config:

stats-compass-mcp install --client vscode --remote-url http://localhost:8000/mcp

Or manually add to your VS Code mcp.json:

{
  "servers": {
    "stats-compass": {
      "command": "uvx",
      "args": ["stats-compass-mcp", "run"]
    }
  }
}

Claude Code (CLI)

claude mcp add stats-compass -- uvx stats-compass-mcp run

Remote Server Mode

For multi-client setups, Docker deployments, or running the server on a different machine, use HTTP mode:

stats-compass-mcp serve --port 8000

Docker

docker build -t stats-compass-mcp .
docker run -p 8000:8000 stats-compass-mcp

Configure Clients for Remote Mode

VS Code (Direct HTTP)

VS Code can connect directly to HTTP MCP servers:

{
  "servers": {
    "stats-compass": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Claude Desktop (via mcp-proxy)

Claude Desktop only supports stdio. Use mcp-proxy to bridge:

{
  "mcpServers": {
    "stats-compass": {
      "command": "uvx",
      "args": ["mcp-proxy", "--transport", "streamablehttp", "http://localhost:8000/mcp"]
    }
  }
}

Remote Server Benefits

  • Session isolation: Each client gets its own isolated session
  • Multi-client support: Multiple clients can connect simultaneously
  • Deployment flexibility: Run on a remote machine or container

Environment Variables

Variable Default Description
STATS_COMPASS_PORT 8000 Server port
STATS_COMPASS_HOST 0.0.0.0 Server host
STATS_COMPASS_MAX_SESSIONS 100 Maximum concurrent sessions
STATS_COMPASS_MEMORY_LIMIT_MB 500 Memory limit per session (MB)

Available Tools

Demo 2: Cleaning and transforming data

Once connected, 30+ tools are available:

Data Loading & Management

  • load_csv - Load CSV files
  • load_excel - Load Excel files
  • load_dataset - Load built-in sample datasets
  • list_dataframes - List all DataFrames in session
  • get_schema - Get column types and info
  • get_sample - Preview rows from a DataFrame

Data Cleaning

  • execute_cleaning_tool - Access all cleaning sub-tools:
    • drop_na - Remove missing values
    • impute - Fill missing values
    • dedupe - Remove duplicates
    • handle_outliers - Detect and handle outliers

Transforms

  • execute_transform_tool - Access all transform sub-tools:
    • filter - Filter rows by condition
    • groupby - Group and aggregate
    • pivot - Pivot tables
    • add_column - Calculated columns
    • encode - Categorical encoding

EDA & Statistics

  • execute_eda_tool - Access all EDA sub-tools:
    • describe - Summary statistics
    • correlations - Correlation matrix
    • hypothesis_test - T-tests, chi-square, etc.
    • data_quality - Quality report

Visualization

  • execute_plot_tool - Access all plot sub-tools:
    • histogram - Distribution plots
    • scatter - Scatter plots
    • bar - Bar charts
    • line - Line plots
    • confusion_matrix - Classification confusion matrix
    • roc_curve - ROC curves
    • precision_recall_curve - PR curves
    • feature_importance - Feature importance charts

Machine Learning

  • execute_ml_tool - Access all ML sub-tools:
    • train_model - Train classifiers/regressors
    • evaluate - Model evaluation
    • predict - Make predictions

Workflows (High-Level)

  • run_eda_report_workflow - Complete EDA report
  • run_preprocessing_workflow - Data cleaning pipeline
  • run_classification_workflow - Full classification pipeline
  • run_regression_workflow - Full regression pipeline
  • run_timeseries_workflow - ARIMA forecasting

CLI Commands

# Start local server (stdio)
stats-compass-mcp run

# Start HTTP server
stats-compass-mcp serve --port 8000

# List all tools
stats-compass-mcp list-tools

# Install for Claude Desktop or VS Code
stats-compass-mcp install --client claude
stats-compass-mcp install --client vscode

Development

# Clone the repo
git clone https://github.com/oogunbiyi21/stats-compass-mcp.git
cd stats-compass-mcp

# Install dependencies
poetry install

# Run tests
poetry run pytest

# Run locally
poetry run stats-compass-mcp run

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stats_compass_mcp-0.2.0.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stats_compass_mcp-0.2.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file stats_compass_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: stats_compass_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.5 Darwin/24.6.0

File hashes

Hashes for stats_compass_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e4ce77e3b9a2e5e4d528ed5813ed228ca0d2a92cd7999bc35501d1697de678f
MD5 73099fb513daaedc9b8098c7cdda5202
BLAKE2b-256 a675a1cf7c985ed128013862f5b773a9b82fb51aab2584058e4f67c36ca858ad

See more details on using hashes here.

File details

Details for the file stats_compass_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: stats_compass_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 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

Hashes for stats_compass_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f81a5208f31aaef92fc4fddad13e31815df892a3aa3297b85035acddc692135f
MD5 6c02b53d91f0525c8bc2e786a6ec485e
BLAKE2b-256 cd8b94a838e091a793fc520c207d812a6e805605a8c0f2cc719050c7acd565d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page