Advanced ML-ready data preprocessing for educational and development use.
This MCP server provides a secure, containerised interface for AI assistants to load, explore, clean, transform, and export datasets using pandas, numpy, scikit-learn, pyarrow, and openpyxl.
load_dataset— Load a file from your data directory (CSV,Excel,Parquet,JSON)get_info— Shape, column types, null counts, memory usagepreview_data— First or lastNrows of the datasetget_statistics— Descriptive statistics (count,mean,std,min,max, etc.)get_missing_summary— Per-column missing value count and percentage
drop_columns— Remove one or more columnsselect_columns— Keep only specified columnsdrop_duplicates— Remove duplicate rows, optionally on a subset of columnsdrop_rows_with_missing— Drop rows that contain null valuesfill_missing— Fill nulls usingmean,median,mode,constant,ffill, orbfillrename_column— Rename a single columnfilter_rows— Filter rows using:==!=><>=<=containsstartswithendswithisnullnotnull
detect_outliers— Detect, and optionally remove, outliers viaIQRorZ-score
convert_column_type— Cast a column toint,float,str,bool, ordatetimeencode_categorical— Label encoding or one-hot (dummy) encoding
normalize_column— Min-max (0–1) or Z-score (mean = 0,std = 1) scalingapply_log_transform— Applylogorlog1pto a numeric column
feature_engineering_date— Extractyear,month,day,hour,minute,dayofweek,quarter,weekofyear, anddayofyearfrom a datetime columnbin_column— Bin a numeric column using equal-width or quantile strategy
sort_data— Sort dataset by a column in ascending or descending orderexport_dataset— Export toCSV,Excel,Parquet, orJSONreset_dataset— Reset dataset to its originally loaded state
- Docker Desktop, with Docker MCP Toolkit enabled
- Docker MCP CLI plugin, with the
docker mcpcommand available - A local data directory to mount into the container
mkdir -p ~/mcp-data
# Copy datasets you want to work with into this directory
cp mydata.csv ~/mcp-data/Build the MCP server image from the project directory.
cd /path/to/data-preprocessor
docker build -t data-preprocessor-mcp-server .Create your custom Docker MCP catalog file.
mkdir -p ~/.docker/mcp/catalogs
nano ~/.docker/mcp/catalogs/custom.yamlPaste the following, replacing YOUR_USERNAME with your macOS username:
version: 2
name: custom
displayName: Custom MCP Servers
registry:
data-preprocessor:
description: "ML-ready data preprocessing: cleaning, encoding, normalisation, feature engineering"
title: "Data Preprocessor"
type: server
dateAdded: "2026-03-06T00:00:00Z"
image: data-preprocessor-mcp-server:latest
ref: ""
readme: ""
toolsUrl: ""
source: ""
upstream: ""
icon: ""
volumes:
- source: "/Users/YOUR_USERNAME/mcp-data"
target: /data
tools:
- name: load_dataset
- name: get_info
- name: preview_data
- name: get_statistics
- name: get_missing_summary
- name: drop_columns
- name: select_columns
- name: drop_duplicates
- name: drop_rows_with_missing
- name: fill_missing
- name: rename_column
- name: filter_rows
- name: encode_categorical
- name: normalize_column
- name: convert_column_type
- name: feature_engineering_date
- name: compute_correlation
- name: detect_outliers
- name: apply_log_transform
- name: bin_column
- name: sort_data
- name: export_dataset
- name: reset_dataset
metadata:
category: automation
tags:
- data-preprocessing
- machine-learning
- pandas
- scikit-learn
- csv
license: MIT
owner: localOpen your local Docker MCP registry file:
nano ~/.docker/mcp/registry.yamlAdd the following under the existing registry: key:
data-preprocessor:
ref: ""Check that the MCP server is visible:
docker mcp server listYou can send requests like:
"Load the file sales.csv from my data directory"
Uses:
load_dataset(filename="sales.csv")
"Show me the first 10 rows"
Uses:
preview_data(n_rows="10", position="head")
"Summarise missing values in the dataset"
Uses:
get_missing_summary()
"Fill missing values in the Age column using the median"
Uses:
fill_missing(column="Age", strategy="median")
"Drop the columns ID and Timestamp"
Uses:
drop_columns(columns="ID, Timestamp")
"Remove duplicate rows"
Uses:
drop_duplicates()
"Encode the Category column using label encoding"
Uses:
encode_categorical(column="Category", method="label")
"Normalise the Price column using min-max scaling"
Uses:
normalize_column(column="Price", method="minmax")
"Extract year, month and day from the OrderDate column"
Uses:
feature_engineering_date(column="OrderDate", features="year,month,day")
"Show the correlation matrix"
Uses:
compute_correlation()
"Detect outliers in the Revenue column using IQR"
Uses:
detect_outliers(column="Revenue", method="iqr")
"Remove outliers from the Revenue column"
Uses:
detect_outliers(column="Revenue", method="iqr", remove="true")
"Apply log1p transform to the Salary column"
Uses:
apply_log_transform(column="Salary", method="log1p")
"Bin the Age column into 4 equal-width groups"
Uses:
bin_column(column="Age", bins="4", strategy="equal_width")
"Export the cleaned dataset as cleaned_sales.csv"
Uses:
export_dataset(filename="cleaned_sales.csv", file_type="csv")
"Reset to the original dataset"
Uses:
reset_dataset()
AI Client → MCP Gateway → Data Preprocessor Container → /data volume
↕
~/mcp-data (your local files)
All data stays local. No internet access is required. No API keys are needed.
export DATA_DIR="$(pwd)/test-data"
export MAX_PREVIEW_ROWS=20
mkdir -p test-data
python data_preprocessor_server.pydocker build -t data-preprocessor-mcp-server .- Add a function with the
@mcp.tool()decorator - Use a single-line docstring only, because multi-line docstrings can cause gateway panic
- Default all parameters to
"", neverNone - Return a formatted string
- Add the tool name to your
custom.yamlcatalog entry - Rebuild the Docker image
MIT License