opc-excel-clean-mcp
v1.0.0
Published
MCP server for AI-powered Excel/CSV data cleaning — dedup, normalize, detect anomalies, fuzzy match
Maintainers
Readme
opc-excel-clean-mcp
AI-Powered Excel/CSV Data Cleaning — 10x Faster Than Kutools Manual Toolbox
Stop clicking through Kutools' $49/year manual toolbox. Let AI clean your spreadsheets in seconds.
Why opc-excel-clean-mcp?
| | opc-excel-clean-mcp | Kutools | 方方格子 | |---|---|---|---| | Speed | ⚡ AI-driven, sub-second | 🐢 Manual 47+ clicks | 🐢 Manual ribbon UI | | Fuzzy Dedup | ✅ Levenshtein distance | ❌ Exact only (manual) | ❌ Limited | | Anomaly Detection | ✅ IQR + Z-score auto-detect | ❌ None | ❌ None | | Batch Processing | ✅ Programmatic (API) | ❌ One sheet at a time | ❌ One sheet at a time | | Cost | 🆓 Free & Open Source | 💰 $49/year (1M+ users) | 🆓 Free (10M+ downloads) | | AI Integration | ✅ MCP native (Claude/GPT) | ❌ None | ❌ None |
Features
1. clean_deduplicate — Remove Duplicates
- Exact dedup: Row-by-row comparison, configurable columns
- Fuzzy dedup: Levenshtein distance catches near-duplicates (
"Acme Corp"≈"Acme Corporation") - Control: Choose
keep: firstorkeep: last, set similarity thresholds
2. clean_normalize — Standardize Format
- Trim whitespace, collapse multiple spaces
- Case normalization: lowercase / UPPERCASE / Title Case
- Strip non-printable characters
- Unicode normalization (NFKD)
- Remove empty rows
- Per-column operation targeting
3. detect_anomalies — Find Outliers
- IQR method (robust): Q1 − 1.5×IQR / Q3 + 1.5×IQR
- Z-score method: Mean ± threshold × standard deviation
- Auto-detects numeric columns
- Returns full statistics: Q1, Q3, IQR, mean, median, std dev, bounds
4. fuzzy_match — Fuzzy String Search
- Rank up to 50,000 candidates by Levenshtein similarity
- Configurable threshold and top-N
- Perfect for product name reconciliation, address matching, data merging
Quick Start
Install
npm install -g opc-excel-clean-mcpConfigure in Claude Desktop / Hermes
{
"mcpServers": {
"excel-clean": {
"command": "npx",
"args": ["opc-excel-clean-mcp"]
}
}
}Use via MCP
User: Clean this sales data — remove duplicates and find outliers
Claude: [calls clean_deduplicate → calls detect_anomalies → returns cleaned data]
5 duplicate rows removed. 3 anomalies found in "Revenue" column:
- Row 142: $1,250,000 (upper bound: $998,500)
- Row 287: -$45,000 (lower bound: $12,300)
- Row 403: $2,100,000 (upper bound: $998,500)API Reference
All tools accept a data parameter: string[][] — a 2D array where data[0] is the header row and data[1..] are data rows.
clean_deduplicate
| Parameter | Type | Default | Description |
|---|---|---|---|
| data | string[][] | required | Input tabular data |
| mode | "exact" \| "fuzzy" \| "both" | "both" | Dedup strategy |
| columns | number[] | all | Column indices to compare |
| fuzzy_threshold | number | 0.85 | Similarity (0-1) for fuzzy |
| keep | "first" \| "last" | "first" | Which row to keep |
clean_normalize
| Parameter | Type | Default | Description |
|---|---|---|---|
| data | string[][] | required | Input tabular data |
| operations | string[] | ["trim","collapse_whitespace"] | Operations to apply |
| columns | number[] | all | Target columns |
Available operations: trim, collapse_whitespace, lowercase, uppercase, title_case, remove_empty_rows, strip_non_printable, normalize_unicode
detect_anomalies
| Parameter | Type | Default | Description |
|---|---|---|---|
| data | string[][] | required | Input tabular data |
| columns | number[] | auto-detect | Numeric columns to scan |
| method | "iqr" \| "zscore" | "iqr" | Detection method |
| threshold | number | 1.5 | IQR multiplier / Z-score cutoff |
| min_values | number | 5 | Min values to analyze |
fuzzy_match
| Parameter | Type | Default | Description |
|---|---|---|---|
| query | string | required | Search string |
| candidates | string[] | required | Pool to search (max 50K) |
| top_n | number | 5 | Results to return |
| threshold | number | 0.3 | Min similarity (0-1) |
| include_scores | boolean | true | Include similarity scores |
Architecture
src/
├── index.ts # MCP server entry point, tool registration
└── tools/
├── fuzzy.ts # Levenshtein distance, ratio, fuzzy groups, ranking
├── dedup.ts # clean_deduplicate: exact + fuzzy row dedup
├── normalize.ts # clean_normalize: whitespace/case/unicode ops
└── anomaly.ts # detect_anomalies: IQR + Z-score outlier detection- Pure TypeScript — zero runtime dependencies beyond MCP SDK + Zod
- No external API calls — all logic runs locally
- O(n) memory Levenshtein — single-row DP optimization handles large datasets
- Stdio MCP transport — works with any MCP-compatible client
Comparison: AI vs Manual Toolbox
Scenario: Clean 10,000-row sales export with duplicate customers and missing values.
| Step | Kutools (Manual) | opc-excel-clean-mcp (AI) |
|---|---|---|
| Remove duplicates | Navigate ribbon → Kutools → Select range → Check columns → OK (5 clicks) | clean_deduplicate (1 call) |
| Find fuzzy duplicates | Manually scan, sort, eye-ball differences (10+ min) | clean_deduplicate(mode="fuzzy") (<1s) |
| Normalize whitespace | Trim + Clean formulas, column by column (20 clicks) | clean_normalize (1 call) |
| Detect outliers | Add formulas, conditional formatting, manual review (15 min) | detect_anomalies (<1s) |
| Match names | VLOOKUP + manual correction (30+ min) | fuzzy_match (<1s) |
| Total | ~45 minutes + 50+ clicks | ~3 seconds + 4 tool calls |
Development
git clone https://github.com/nous-hermes/opc-excel-clean-mcp
cd opc-excel-clean-mcp
npm install
npm run build
npm startTest locally
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/index.jsLicense
MIT © Nous Research — part of the OPC (One-Person Company) MCP toolkit.
