Let Claude query Excel files using SQL - no SQL knowledge required
Project description
mcp-server-excel-sql
Let Claude query your Excel and CSV files using SQL - no SQL knowledge required. Ask questions in plain English, Claude writes and executes the queries automatically.
What It Does
How it works:
- Point the server at your Excel/CSV files
- Ask Claude questions in plain English
- Claude writes SQL queries automatically
- Get instant answers from your data
Capabilities:
- Each Excel sheet and CSV file becomes a queryable SQL table
- Join data across multiple files and formats (xlsx, xls, csv, tsv)
- Clean messy data with YAML transformation rules
- Deploy for teams with concurrent access
- Support for complex queries (aggregations, window functions, CTEs)
Should You Use This?
Great fit if you:
- Work with Excel files under 100MB
- Want data insights without SQL knowledge
- Need to join multiple spreadsheets
- Use AI assistants (Claude writes the SQL for you)
- Prototype before building ETL pipelines
Not the right tool if you:
- Have files over 100MB (use database import instead)
- Need to modify Excel files (read-only)
- Need formulas/macros/VBA (values only)
- Building production data warehouse (prototyping only)
Installation
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
That's it. No package installation needed - uvx runs the server on-demand.
Try It Now
git clone https://github.com/ivan-loh/mcp-excel.git
cd mcp-excel
python examples/finance/create_finance_examples.py
uvx --from mcp-server-excel-sql mcp-excel --path examples/finance
Quick Start
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"excel": {
"command": "uvx",
"args": [
"--from", "mcp-server-excel-sql", "mcp-excel",
"--path", "/path/to/excel/files/"
]
}
}
}
Update the path and restart Claude Desktop.
Command Line Testing
# Test with your files
uvx --from mcp-server-excel-sql mcp-excel --path /path/to/excel/files
# With auto-refresh
uvx --from mcp-server-excel-sql mcp-excel --path /path/to/files --watch
Common Use Cases
- Financial Analysis - Budget vs actuals, AR aging, revenue trending
- Sales Reporting - Territory performance, product analysis, customer segmentation
- Operations - Inventory reconciliation, vendor comparison, project tracking
- Data Exploration - Quick SQL access, data quality testing, analytics prototyping
Available Tools
- tool_list_tables - Lists all tables and views with file paths and row counts
- tool_get_schema - Shows column names and types for a table or view
- tool_query - Execute read-only SQL queries (joins, aggregations, CTEs)
- tool_refresh - Reload data after file changes (automatic with --watch)
- tool_create_view - Create persistent SQL views that survive restarts
- tool_drop_view - Delete a view and its storage
Understanding Table Names
Tables are named: <alias>.<filename>.<sheet> (lowercase, sanitized)
Example: File /data/sales/Q1-2024.xlsx sheet Summary → sales.q12024.summary
Important: Always quote table names in SQL:
SELECT * FROM "sales.q12024.summary" -- Correct
System Views
<alias>.__files- File inventory (paths, sheet count, rows, modification time)<alias>.__tables- Table catalog (names, source file, sheet, row count)
Persistent Views
Create reusable SQL views stored on disk that automatically restore on server restart.
Example:
CREATE VIEW high_value_sales AS
SELECT * FROM "sales.data.summary" WHERE amount > 1000
Use for filtering, aggregations, or multi-table joins. Manage with tool_create_view(), tool_drop_view(), and tool_list_tables().
Data Transformation
Clean messy Excel files with YAML transformation rules:
Capabilities:
- Skip header/footer rows, combine multi-row headers
- Filter rows with regex or column conditions
- Rename columns, set data types (dates, decimals)
- Pivot wide to long format, specify cell ranges
- Extract tables from multi-table sheets
Usage:
uvx --from mcp-server-excel-sql mcp-excel --path /data --overrides config.yaml
See examples/finance/finance_overrides.yaml for complete configuration examples.
Auto-Detection Features
Handle complex Excel files automatically without manual configuration.
What it detects:
- Merged cells, hidden rows/columns
- European number formats (1.234,56 → decimals)
- Multiple tables on single sheets
- Header rows, metadata rows
Enable:
messy_report.xlsx:
sheet_overrides:
"Report":
auto_detect: true
Use for: Merged cell headers, hidden columns, European formatting, multi-table sheets, complex layouts.
Limitation: .xlsx and .xlsm only. See DEVELOPMENT.md for advanced options.
CLI Options
uvx --from mcp-server-excel-sql mcp-excel [OPTIONS]
Options:
--path- Directory containing Excel files (default: current directory)--overrides- YAML configuration file for transformations--watch- Auto-refresh when files change--transport- Communication mode:stdio,streamable-http,sse(default: stdio)--host- Host for HTTP/SSE (default: 127.0.0.1)--port- Port for HTTP/SSE (default: 8000)--require-auth- Enable API key authentication (uses MCP_EXCEL_API_KEY env var)
Additional Documentation
Multi-user deployment, security, and development: See DEVELOPMENT.md for:
- Multi-user setup with authentication
- Security model and enforcement
- Architecture and design decisions
- Performance characteristics
- Testing and development workflow
Examples: See examples/README.md for finance and CNC datasets with detailed query examples.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_excel_sql-0.7.4.tar.gz.
File metadata
- Download URL: mcp_server_excel_sql-0.7.4.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fd34e77afad76257e5807369e5462e4828558e021d71412d6d131c76a17e565
|
|
| MD5 |
d0a6f719a3a35ef08eb78835e8cfc53c
|
|
| BLAKE2b-256 |
b685dd308f29ee8060260e3f627c8af892cc731fd73832e7073208ab1f2de7c7
|
Provenance
The following attestation bundles were made for mcp_server_excel_sql-0.7.4.tar.gz:
Publisher:
publish.yml on ivan-loh/mcp-excel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_excel_sql-0.7.4.tar.gz -
Subject digest:
4fd34e77afad76257e5807369e5462e4828558e021d71412d6d131c76a17e565 - Sigstore transparency entry: 641912877
- Sigstore integration time:
-
Permalink:
ivan-loh/mcp-excel@fe6d4321f146d646cf1c5d69fb01cf1409708277 -
Branch / Tag:
refs/tags/v0.7.4 - Owner: https://github.com/ivan-loh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fe6d4321f146d646cf1c5d69fb01cf1409708277 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_server_excel_sql-0.7.4-py3-none-any.whl.
File metadata
- Download URL: mcp_server_excel_sql-0.7.4-py3-none-any.whl
- Upload date:
- Size: 39.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
faed3161f3f21f0b39202aefe9455060cc3b86c01f44d415bc3cd6d66d1ed9ef
|
|
| MD5 |
177d0f8a8dcb133ccbafc82c65a9d9de
|
|
| BLAKE2b-256 |
0016cf2728a92e48567f239f801326ed8133ec704ec07caec1f4cb5a2f32f26b
|
Provenance
The following attestation bundles were made for mcp_server_excel_sql-0.7.4-py3-none-any.whl:
Publisher:
publish.yml on ivan-loh/mcp-excel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_excel_sql-0.7.4-py3-none-any.whl -
Subject digest:
faed3161f3f21f0b39202aefe9455060cc3b86c01f44d415bc3cd6d66d1ed9ef - Sigstore transparency entry: 641912878
- Sigstore integration time:
-
Permalink:
ivan-loh/mcp-excel@fe6d4321f146d646cf1c5d69fb01cf1409708277 -
Branch / Tag:
refs/tags/v0.7.4 - Owner: https://github.com/ivan-loh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fe6d4321f146d646cf1c5d69fb01cf1409708277 -
Trigger Event:
push
-
Statement type: