
Data Cleaner Agent
io.github.wesseltl由 GitHub 账号 wesseltl 发布v0.1.3更新于 Oct 24, 2026
Clean messy CSVs: an LLM picks the steps, tested code does the work. Data untouched by the model.
概览
本地 MCP 服务器,用经过测试的 Python 函数清洗杂乱的 CSV 文本,返回清洗后的 CSV 和逐步处理报告。
- 可以做什么
- 清洗 CSV 文本:执行表头规范化、去除空白、数值转换、日期标准化、类别标准化和去重,返回清洗后的 CSV 以及每一步实际操作的报告,包括无法干净解析的值。
- 适用场景
- 当助手拿到表头不一致、日期格式混杂、金额带货币符号或存在重复行的杂乱 CSV 数据,且希望由确定性代码而非在提示中逐词重排来完成清洗时适用。
- 运行要求
- 作为本地进程运行;安装带 mcp 附加项的 PyPI 包,并用 python -m cleaner.mcp_server 启动。默认离线运行,无需 API 密钥;可选的 LLM 规划器需要 llm 附加项和 ANTHROPIC_API_KEY 环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Data Cleaner Agent,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
data-cleaner-agent
Clean a messy CSV with an agentic workflow. An LLM decides which cleaning steps the data needs, and tested Python functions do the actual work. The model plans the cleanup, it never touches your data values, so nothing gets hallucinated or silently rewritten.
Works offline out of the box (no API key). Can be driven by an LLM, and other AI agents can call it as an MCP tool.
Before / after
In one pass it fixed the headers, trimmed whitespace, parsed three different date formats to ISO,
turned €1.200,50 / $900 / € 750,00 into numbers, standardized the country names, and dropped the
duplicate Alice row.
Install & run
No API key needed. The default planner is a set of offline heuristics.
The idea
An "agentic workflow" is just software with a few parts:
The decision that makes it safe to trust:
The planner decides which tool runs on which column. The tools do the transformation. A language model is good at judgment ("this column looks like money") and bad at being a reliable calculator. So the LLM only ever picks operations from a fixed set. It never reads a value and writes back a "cleaned" one, which is where LLM data-cleaning usually goes wrong.
Two planners, one loop
Both return the same list of steps, so the loop is identical. You swap the brain, not the plumbing.
The log reports what each step actually did, including where a conversion could not produce a clean result (unparseable numbers/dates, unmapped categories), so a clean parse is distinguishable from a confident guess.
Use it from other code or agents
As an MCP tool (Claude Desktop)
Other AI agents can call the cleaner as a tool, so they clean a CSV properly instead of reformatting it token by token in the prompt. Three steps:
1. Install it
2. Add it to your client's config (Claude Desktop's config lives at
~/Library/Application Support/Claude/claude_desktop_config.json on macOS, or
%APPDATA%\Claude\claude_desktop_config.json on Windows):
3. Restart Claude Desktop. The agent now has a clean_csv tool that takes CSV text and returns the
cleaned CSV plus a report of what it did.
Use it with other MCP clients
The same server works in any MCP client, only the config differs. The command is
python -m cleaner.mcp_server.
Cursor — ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project), hot-reloads:
VS Code / GitHub Copilot — .vscode/mcp.json. Note the different key (servers, not mcpServers)
and the required type. Tools only run in Copilot Agent mode:
Windsurf — ~/.codeium/windsurf/mcp_config.json (create it if missing):
Cline — add it from the extension's MCP settings panel in VS Code.
Understanding the report
The tool doesn't just hand back tidy data, it tells you what each step actually did, including where it couldn't get a clean result, so you can tell a clean parse from a confident guess:
So instead of silently dropping a value or leaving a wrong category, it surfaces it, and you know exactly which cells to double-check.
What's in the box
cleaner/tools.py holds the transformations: snake_case_headers, strip_whitespace,
coerce_numeric, standardize_dates, standardize_categorical, drop_duplicate_rows.
Take standardize_dates. 2023-01-05 (year first, month in the middle) and 05/01/2023 (day first)
need opposite parsing rules, and one global setting corrupts one or the other, so the tool decides per
value. Mixed dates are genuinely ambiguous, and this handles them explicitly instead of guessing.
Tests
License
MIT.
来源:README.md,提交 0623109
工具
0版本历史
1- v0.1.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分