Repository avatar
AI Tools
v0.1.0
active

devray-datalab-mcp

io.github.rayklanderman/devray-datalab-mcp

Local-first data science and machine learning MCP server

Documentation

DevRay DataLab MCP

Local-first Data Science & Machine Learning for AI Assistants

PyPI version Python 3.11+ License: MIT CI MCP Registry DevRay DataLab MCP MCP server – quality and maintenance score on Glama Transport: stdio

DevRay DataLab MCP is a local-first Model Context Protocol (MCP) server that lets AI assistants such as Claude, Cursor, Cline, Kilo Code, and OpenAI Codex perform real data science and machine learning on your own computer — no cloud services, no API keys, no paid subscriptions.

Everything runs locally via stdio: dataset loading, exploratory data analysis, preprocessing, classification/regression training, model comparison, export, and prediction. Your datasets never leave your machine.

Installation

Method A — uvx (simplest, no virtualenv)

uvx devray-datalab-mcp

Requires uv. Install uv if needed:

# Windows PowerShell
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Method B — pip in a virtual environment

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install devray-datalab-mcp
devray-datalab-mcp

Linux / macOS:

python3 -m venv .venv
source .venv/bin/activate
pip install devray-datalab-mcp
devray-datalab-mcp

Method C — from GitHub source

pip install git+https://github.com/rayklanderman/devray-datalab-mcp.git
devray-datalab-mcp

A stdio MCP server waits for input from an MCP client. Launching devray-datalab-mcp directly without a connected client will appear to do nothing — this is expected. Connect it through an MCP-compatible client (see client configuration below).

Configure where datasets and model artifacts live with environment variables:

VariableDefaultMeaning
DEVRAY_WORKSPACE_DIRdatasetsDirectory containing CSV datasets
DEVRAY_ARTIFACTS_DIRartifactsDirectory for saved model artifacts

MCP client configuration

Add the server to your MCP-compatible client. Replace C:\MLData with your own paths.

Kilo Code

{
  "mcpServers": {
    "devray-datalab": {
      "command": "uvx",
      "args": [
        "--from",
        "devray-datalab-mcp",
        "devray-datalab-mcp"
      ],
      "env": {
        "DEVRAY_WORKSPACE_DIR": "C:\\MLData\\datasets",
        "DEVRAY_ARTIFACTS_DIR": "C:\\MLData\\artifacts"
      }
    }
  }
}

Cline / Cursor / Claude Desktop

These clients use the same mcpServers JSON structure:

{
  "mcpServers": {
    "devray-datalab": {
      "command": "devray-datalab-mcp",
      "args": [],
      "env": {
        "DEVRAY_WORKSPACE_DIR": "C:\\MLData\\datasets",
        "DEVRAY_ARTIFACTS_DIR": "C:\\MLData\\artifacts"
      }
    }
  }
}

VS Code / GitHub Copilot MCP

Add to your VS Code MCP settings (settings.json):

{
  "mcp.servers": {
    "devray-datalab": {
      "command": "devray-datalab-mcp",
      "args": [],
      "env": {
        "DEVRAY_WORKSPACE_DIR": "${workspaceFolder}/datasets",
        "DEVRAY_ARTIFACTS_DIR": "${workspaceFolder}/artifacts"
      }
    }
  }
}

Install in OpenAI Codex (CLI & VS Code)

DevRay DataLab MCP can be connected to the OpenAI Codex CLI (and its VS Code extension) through local stdio execution. Codex and its VS Code extension share configuration, so registering the server once makes it available in both.

Prerequisites

  • Install the Codex CLI (codex on PATH).
  • Install uv (provides uvx).
  • Create the dataset and artifact directories before registering:
New-Item -ItemType Directory -Force "C:\MLData\datasets","C:\MLData\artifacts"
Copy-Item "examples\sample_classification.csv" "C:\MLData\datasets\"

Register the server

codex mcp add devray-datalab `
  --env DEVRAY_WORKSPACE_DIR=C:\MLData\datasets `
  --env DEVRAY_ARTIFACTS_DIR=C:\MLData\artifacts `
  -- uvx --from devray-datalab-mcp devray-datalab-mcp
  • DEVRAY_WORKSPACE_DIR — directory containing your CSV datasets.
  • DEVRAY_ARTIFACTS_DIR — directory where trained model artifacts are saved.
  • Replace C:\MLData with your own paths.

Verify registration

codex mcp list
codex mcp get devray-datalab

Expected output shows enabled: true, transport: stdio, command: uvx, and the devray-datalab-mcp args.

Manual config.toml configuration

Codex also reads ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml):

[mcp_servers.devray-datalab]
command = "uvx"
args = ["--from", "devray-datalab-mcp", "devray-datalab-mcp"]

[mcp_servers.devray-datalab.env]
DEVRAY_WORKSPACE_DIR = "C:/MLData/datasets"
DEVRAY_ARTIFACTS_DIR = "C:/MLData/artifacts"

Codex CLI and its VS Code extension share this configuration. Register once, use everywhere.

Example prompts for Codex

  • Dataset exploration: "Use DevRay DataLab MCP to inspect sample_classification.csv, summarize its structure, identify missing values, and report potential data-quality issues."
  • Machine learning: "Use DevRay DataLab MCP to train and evaluate classification models for predicting purchased. Compare appropriate metrics and recommend the best model based on validation performance."
  • Prediction: "Use DevRay DataLab MCP to load my exported churn_model and generate predictions for new records."

A dedicated guide is available in docs/codex-integration.md.

Available tools

ToolWhat it does
list_datasetsList CSV datasets in the workspace
inspect_datasetLoad a CSV; report types, missing values, stats, preview
analyze_correlationsPearson/Spearman correlations, strongest pairs
analyze_data_qualityMissing values, duplicates, constants, outliers, recommendations
prepare_datasetDefine target + task type; fit preprocessing on train data only
train_baselineTrain a classification or regression model
compare_modelsCompare multiple algorithms; select best by metric
export_modelSave model with pipeline, metadata, and schema
predictGenerate predictions from a saved local model
system_infoCPU, RAM, storage, GPU detection

Quickstart workflow

Using the included sample_classification.csv (target purchased):

  1. Inspect: inspect_dataset with {"name": "sample_classification.csv"}
  2. Data quality: analyze_data_quality with {"name": "sample_classification.csv"}
  3. Correlations: analyze_correlations with {"name": "sample_classification.csv", "method": "pearson"}
  4. Train & compare: compare_models with {"name": "sample_classification.csv", "target_column": "purchased", "task_type": "classification", "metric": "f1"}
  5. Export: export_model with {"artifact_name": "churn_model", "name": "sample_classification.csv", "target_column": "purchased", "task_type": "classification", "model_name": "random_forest"}
  6. Predict: predict with {"artifact_name": "churn_model", "features": {"age": 40, "income": 80000, "credit_score": 720, "category": "electronics", "region": "east"}}

A full step-by-step tutorial with copy-ready prompts is available in docs/quickstart.md.

Links

Security and privacy

All processing is local; no data leaves your machine. File access is confined to the configured workspace/artifacts directories. Path traversal is blocked, file sizes and extensions are validated, and only artifacts created by this application are loaded for prediction. No cloud hosting, no paid AI APIs, no external downloads.

License

MIT License. See LICENSE.

PYPI
devray-datalab-mcp
Install Command
pip install devray-datalab-mcp