Data Profiler

io.github.Ridadata由 GitHub 账号 Ridadata 发布v0.1.1更新于 Oct 24, 2026

Profile local CSV, Parquet, JSON and Excel files into a compact data-quality summary.

已验证STDIO仅桌面文件与存储数据与分析

概览

AI 生成的概览

一个本地 MCP 服务器,把 CSV、Parquet、JSON 和 Excel 文件剖析成紧凑的数据质量摘要,让助手无需读取原始数据即可了解数据集。

可以做什么
  • 把本地数据文件剖析为结构化摘要,包含列类型、空值数量、去重计数、样本值、数值四分位数和日期范围
  • 标记可能的数据质量问题,如常量列、全空列、疑似 ID、混合类型,以及以文本存储的数字或日期
  • 可通过采样行数、列数上限、高频值数量和 Excel 工作表名称控制剖析结果
  • 启动时指定根目录可将剖析范围限制在单个目录内
适用场景
当助手需要理解一个过大或过于杂乱、无法直接粘贴到对话中的本地数据集时适用,也适合在分析或建模前快速检查数据质量。
运行要求
作为本地进程运行,通过 PyPI 安装,需要 Python 3.10 或更高版本;无需数据库、索引或 API 密钥。仅读取本机文件。
安装前请注意
只读且仅限本地:不查询数据库或网址,也不写入文件。大文件默认采样,统计仅反映前 50,000 行,除非要求完整读取。遵循 pandas 解析规则,NA 或 None 等值会被视为缺失。嵌套 JSON 不会被展平。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Data Profiler,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-data-profiler

Let an AI agent understand a dataset without reading it.

An MCP server that turns a CSV, Parquet, JSON, or Excel file into a compact structured profile — types, ranges, missing values, and likely data-quality problems — instead of raw rows.

[CI] [Python] [PyPI] [License: MIT] [MCP Registry]


Overview

To let an AI agent reason about a data file, you normally paste rows into the conversation. That is expensive, truncates on anything large, and still leaves the model guessing at column types and null rates.

This server answers the question directly. One tool call returns a structured summary that is orders of magnitude smaller than the data and says more about it:

DatasetRaw fileProfileReductionTime
Google Play Store (2.3M rows × 24 cols)645 MB13 KB49,205×1.9 s
SNCF punctuality (10,687 rows × 26 cols)2 MB13 KB189×0.2 s
Orders sample (5,000 rows × 6 cols)241 KB2.3 KB104×0.1 s

The 645 MB file cannot go into a context window at any price. It is fully characterised here in under two seconds.

Demo

python demo.py generates a deliberately messy dataset, profiles it, and reports what came back:

[A terminal running python demo.py: a 237 KB, 5,000-row CSV is reduced to a 2 KB profile in a tenth of a second, with six data-quality findings listed across four columns]

The same profiler seen from an MCP client — one question, one profile_dataset call, and the file is characterised without a single row entering the conversation:

[An MCP client is asked what is in orders.csv: it calls profile_dataset, gets a 2.3 KB profile back, and reports every column with its type, range and quality flags]

Three real problems surfaced before any analysis began: a column that never varies, one that is entirely empty, and a date column that sorts as text — so "2024-10-01" < "2024-9-01" — silently corrupting any time-based result.

Features

  • Six data-quality flags — constant, all-null, probable ID, mixed types, and numbers or dates stored as text.
  • Full column statistics — dtype, null count and percentage, distinct count, sample values, quartiles for numerics, ranges for dates, frequent values for categories.
  • Bounded output — the response stays small no matter how wide the input, and always reports what it truncated.
  • Honest sampling — large files are sampled, but never silently; the true row count is always included.
  • Five formats, eleven extensions — .csv .tsv .txt .parquet .pq .json .jsonl .ndjson .xlsx .xlsm .xls, plus .gz variants of the text formats.
  • Path confinement — optional --root restricts profiling to a single directory.
  • Zero configuration — no database, no index, no warm-up. Point it at a file.

Architecture

mermaid
flowchart LR    A["MCP client<br/>Claude Code, Claude Desktop"]    B["server.py<br/>MCP adapter"]    C["profiler.py<br/>pure pandas, no MCP"]    D[("Local files<br/>CSV, Parquet<br/>JSON, Excel")]
    A -->|"profile_dataset(path)"| B    B -->|"validate, confine to --root"| C    C -->|"sampled read"| D    D -->|"DataFrame"| C    C -->|"bounded JSON profile"| B    B -->|"tool result"| A

All profiling logic lives in profiler.py, which imports nothing from MCP. It is unit-testable without a protocol harness and usable as an ordinary Python library. server.py is only the adapter.

Installation

Requires Python 3.10+.

bash
pip install mcp-data-profiler
Install the development version
bash
pip install git+https://github.com/Ridadata/mcp-data-profiler.git

Claude Code

bash
claude mcp add data-profiler -- mcp-data-profiler

Claude Desktop and other MCP clients

Add to your client's MCP configuration:

json
{  "mcpServers": {    "data-profiler": {      "command": "mcp-data-profiler"    }  }}

To confine the server to one directory, add "args": ["--root", "/path/to/your/data"].

Usage

Once registered, ask in plain language:

  • "Profile data/orders.csv"
  • "Which columns have missing values?"
  • "Is this dataset clean enough to model?"

Tool reference

profile_dataset(path, sample_rows=50000, max_columns=100, top_k=5, sheet=None)

ArgumentTypeDefaultDescription
pathstrrequiredFile to profile; .gz is decompressed transparently
sample_rowsint | null50000Rows to read. null reads everything — exact, slower
max_columnsint100Cap on columns described, so wide tables stay small
top_kint5Frequent values listed per categorical column
sheetstr | nullfirst sheetWhich Excel sheet to profile, by name

Quality flags

FlagMeaning
all_nullColumn is entirely empty
constantOnly ever one value — no signal
high_cardinality_possible_idNearly all values distinct; an identifier, not a feature
numeric_stored_as_textNumbers typed as strings; comparisons and sorting will be wrong
date_stored_as_textDates typed as strings; same problem
mixed_typesOne column holding several unrelated Python types

As a Python library

python
from mcp_data_profiler import profile_dataset
profile = profile_dataset("data/orders.csv", sample_rows=None)print(profile["shape"])          # {'rows_profiled': 5000, 'total_rows': 5000, 'columns': 6}print(profile["duplicate_rows"]) # 0

Example output

Verbatim output for the sample dataset produced by python demo.py, with three of the six columns shown:

json
{  "file": { "name": "orders.csv", "format": "csv", "size_bytes": 247263 },  "shape": { "rows_profiled": 5000, "total_rows": 5000, "columns": 6 },  "sampled": false,  "columns": [    {      "name": "order_id",      "dtype": "str",      "null_count": 0,      "null_pct": 0.0,      "unique_count": 5000,      "sample_values": ["ORD-000000", "ORD-000001", "ORD-000002"],      "flags": ["high_cardinality_possible_id"]    },    {      "name": "amount_eur",      "dtype": "float64",      "null_count": 0,      "null_pct": 0.0,      "unique_count": 1368,      "stats": {        "min": 2.65, "max": 1369.65, "mean": 684.2364, "std": 395.254451,        "q25": 341.65, "median": 683.65, "q75": 1025.65      },      "sample_values": [2.65, 39.65, 76.65]    },    {      "name": "currency",      "dtype": "str",      "null_count": 0,      "null_pct": 0.0,      "unique_count": 1,      "top_values": [{ "value": "EUR", "count": 5000 }],      "sample_values": ["EUR", "EUR", "EUR"],      "flags": ["constant"]    }  ],  "duplicate_rows": 0}

Note that order_id carries no top_values: for a near-unique column every count would be 1, so the list is omitted rather than padding the response with noise.

When a file is sampled, the profile also carries "sampled": true, the true total_rows, and a sampling_note saying so.

Design notes

Bounded output. The tool must cost less than the data it describes, so the response is capped regardless of input width and long strings are truncated. Near-unique columns skip the frequent-values list, since every count would be 1.

Honest sampling. Large files are profiled from a sample, but the result always carries "sampled": true alongside the true row count — a silently sampled statistic is a wrong statistic. Row counts come from Parquet metadata or a raw newline scan, never a full parse into memory.

No silent wrong answers. The same rule governs every default that could mislead. A workbook's first sheet is often a title page, so Excel profiles always name the sheet used and list the others rather than reporting an untouched sheet as a clean dataset. CSV delimiters are inferred by testing candidates for a stable column count, which handles the semicolon files common in European open data without the header-mangling that character-frequency sniffers cause. Compressed files are decompressed before either check, since inspecting gzip bytes as text yields a plausible-looking answer that is entirely wrong.

Path safety. --root confines profiling to one directory. Paths are canonicalised before the check, so .. and symlinks cannot escape it.

Limitations

  • Read-only, local files. No databases, no URLs, no writes.
  • Sampled by default. Statistics reflect the first 50,000 rows unless you pass sample_rows=null.
  • Row-oriented. No cross-column correlations, outlier detection, or plots.
  • pandas parsing rules apply. The profile shows what pandas sees, which is what your own code will see. Notably "NA", "N/A", and "None" are read as missing, so a region column containing "NA" for North America will report nulls. That trap is surfaced, not hidden.
  • Nested JSON is not flattened. Unhashable cells make the duplicate check inapplicable, and it is reported as null.
  • One Excel sheet per call. The profile names the sheet read and lists the rest; pass sheet to switch.

Development

bash
git clone https://github.com/Ridadata/mcp-data-profiler.gitcd mcp-data-profilerpip install -e ".[dev]"
pytest                                  # 40 testsruff check src tests demo.py            # lintruff format --check src tests demo.py   # formattingpython demo.py                          # profile a generated sample datasetpython demo.py path/to/your.csv         # profile your own files

CI runs the suite on Python 3.10–3.13 (Linux) plus Windows and macOS, and performs a real stdio handshake against the built server to confirm it starts and advertises its tool.

Releasing

Publishing to PyPI is automated via Trusted Publishing, so no API token is stored in this repository. Publishing a GitHub Release triggers .github/workflows/release.yml, which builds the distributions, verifies the built wheel actually installs and imports, and uploads it.

Issues and pull requests are welcome.

Roadmap

  • Publish to PyPI
  • Gzip-compressed inputs (.csv.gz, .jsonl.gz)
  • List on the official MCP registry
  • Cross-column correlation summary for numeric features
  • Multi-sheet Excel profiling in a single call
  • Remote sources (s3://, https://)

License

MIT © Rida Aderkane

来源:README.md,提交 5d41081

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分