Skip to main content

MCP server for Excel operations with Supabase Storage integration

Project description

Excel MCP Server with Supabase Storage

Python Version License: MIT MCP Compatible

A powerful MCP (Model Context Protocol) server for Excel operations with seamless Supabase Storage integration. Handle Excel files programmatically without requiring Microsoft Office or WPS installation.

๐ŸŒŸ Features

  • โœ… Excel Parsing: Convert Excel files to JSON with complete formatting information
  • โœ… Excel Generation: Create formatted Excel files from JSON data
  • โœ… Advanced Formatting: Modify cell styles, merge cells, adjust dimensions
  • โœ… Formula Support: Execute and calculate 20+ common Excel formulas
  • โœ… Multi-Sheet Operations: Merge multiple Excel files into a single workbook
  • โœ… Supabase Integration: Direct read/write operations with Supabase Storage
  • โœ… Zero Dependencies: No Microsoft Office or WPS required
  • โœ… Cross-Platform: Works on Windows, Linux, and macOS

๐Ÿš€ Quick Start

Installation

Option 1: Install from GitHub (Recommended for now)

# Install and run directly
uvx --from git+https://github.com/1126misakp/Excel-MCP-Server-with-Supabase-Storage mcp-excel-supabase

Option 2: Install from PyPI (Coming soon)

# Once published to PyPI, you can use:
uvx mcp-excel-supabase

Option 3: Install from local source

# Clone the repository
git clone https://github.com/1126misakp/Excel-MCP-Server-with-Supabase-Storage
cd Excel-MCP-Server-with-Supabase-Storage

# Install in development mode
pip install -e .

# Run the server
mcp-excel-supabase

Configuration

  1. Create a .env file in your project directory:
cp .env.example .env
  1. Edit .env and add your Supabase credentials:
SUPABASE_URL=https://yourproject.supabase.co
SUPABASE_KEY=your-service-role-key-here

Claude Desktop Configuration

Add to your Claude Desktop configuration file:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

If installing from GitHub:

{
  "mcpServers": {
    "excel-supabase": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/1126misakp/Excel-MCP-Server-with-Supabase-Storage",
        "mcp-excel-supabase"
      ],
      "env": {
        "SUPABASE_URL": "https://yourproject.supabase.co",
        "SUPABASE_KEY": "your-service-role-key-here"
      }
    }
  }
}

If installing from PyPI (once published):

{
  "mcpServers": {
    "excel-supabase": {
      "command": "uvx",
      "args": ["mcp-excel-supabase"],
      "env": {
        "SUPABASE_URL": "https://yourproject.supabase.co",
        "SUPABASE_KEY": "your-service-role-key-here"
      }
    }
  }
}

๐Ÿ› ๏ธ Available Tools

This server provides 12 MCP tools for comprehensive Excel operations:

Tool Description
parse_excel_to_json Parse Excel files to JSON format
create_excel_from_json Generate Excel files from JSON data
modify_cell_format Edit cell formatting (fonts, colors, borders)
merge_cells Merge cell ranges
unmerge_cells Unmerge cell ranges
set_row_heights Adjust row heights
set_column_widths Adjust column widths
manage_storage Upload/download files to/from Supabase
set_formula Set Excel formulas in cells
recalculate_formulas Recalculate all formulas in a workbook
manage_sheets Create, delete, rename, copy, move sheets
merge_excel_files Merge multiple Excel files

See API Reference for detailed documentation.

๐Ÿ“– Usage Examples

Parse Excel to JSON

# Parse a local file
result = parse_excel_to_json(
    file_path="data/sales_q1.xlsx",
    extract_formats=True
)

# Access parsed data
workbook = result["workbook"]
sheets = workbook["sheets"]

Create Excel from JSON

# Create a simple Excel file
workbook_data = {
    "sheets": [{
        "name": "Sales",
        "rows": [
            {"cells": [
                {"value": "Product", "row": 1, "column": 1},
                {"value": "Revenue", "row": 1, "column": 2}
            ]},
            {"cells": [
                {"value": "Product A", "row": 2, "column": 1},
                {"value": 1000, "row": 2, "column": 2}
            ]}
        ]
    }]
}

create_excel_from_json(
    workbook_data=workbook_data,
    output_path="output/sales.xlsx",
    apply_formats=True
)

Format Cells

# Format header row
modify_cell_format(
    file_path="data/sales.xlsx",
    sheet_name="Sheet1",
    cell_range="A1:J1",
    format_spec={
        "font": {"name": "Arial", "size": 12, "bold": True, "color": "FFFFFF"},
        "fill": {"color": "4472C4"},
        "alignment": {"horizontal": "center", "vertical": "center"}
    }
)

Set Formulas

# Set a SUM formula
set_formula(
    file_path="data/sales.xlsx",
    sheet_name="Sheet1",
    cell="D10",
    formula="=SUM(D2:D9)"
)

# Recalculate all formulas
recalculate_formulas(
    file_path="data/sales.xlsx"
)

Merge Excel Files

# Merge quarterly reports
merge_excel_files(
    file_paths=["q1.xlsx", "q2.xlsx", "q3.xlsx", "q4.xlsx"],
    output_path="annual_report.xlsx",
    handle_duplicates="rename"  # or "skip" or "overwrite"
)

Supabase Storage Operations

# Upload file to Supabase
manage_storage(
    operation="upload",
    local_path="output/report.xlsx",
    remote_path="reports/2024/annual.xlsx"
)

# Download file from Supabase
manage_storage(
    operation="download",
    remote_path="reports/2024/annual.xlsx",
    local_path="downloads/annual.xlsx"
)

# List files
manage_storage(
    operation="list",
    remote_path="reports/2024/"
)

For more examples, see the Examples Directory.

๐Ÿ“š Documentation

๐Ÿ› ๏ธ Development

Local Setup

# Clone the repository
git clone https://github.com/1126misakp/Excel-MCP-Server-with-Supabase-Storage
cd Excel-MCP-Server-with-Supabase-Storage

# Install dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check .

# Format code
black .

Project Structure

Excel-MCP-Server-with-Supabase-Storage/
โ”œโ”€โ”€ src/mcp_excel_supabase/      # Source code
โ”‚   โ”œโ”€โ”€ excel/                    # Excel operations
โ”‚   โ”œโ”€โ”€ storage/                  # Supabase integration
โ”‚   โ””โ”€โ”€ utils/                    # Utilities
โ”œโ”€โ”€ tests/                        # Test suite
โ”œโ”€โ”€ docs/                         # Documentation
โ””โ”€โ”€ PRD.md                        # Product Requirements

๐Ÿงช Testing

# Run all tests
pytest

# Run with coverage
pytest --cov

# Run specific test file
pytest tests/test_parser.py

๐Ÿ“‹ Requirements

  • Python 3.9+
  • Supabase account with Storage API access
  • No Microsoft Office or WPS installation required

๐Ÿค Contributing

Contributions are welcome! Please see Development Guide for guidelines.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™‹ Support

๐Ÿ—บ๏ธ Roadmap

Version 1.0 (Current)

  • โœ… Core Excel parsing and generation
  • โœ… Supabase Storage integration
  • โœ… Basic formatting support
  • โœ… 20+ common formulas

Version 1.1 (Planned)

  • ๐Ÿ“‹ Chart generation support
  • ๐Ÿ“‹ Conditional formatting
  • ๐Ÿ“‹ Data validation rules
  • ๐Ÿ“‹ Advanced formula functions
  • ๐Ÿ“‹ WebUI control panel

๐ŸŒ Related Projects

๐Ÿ“Š Performance

Benchmarked on a standard development machine (Intel i5, 8GB RAM):

Operation Target Actual Status
Parse 1MB file <2s 0.598s โœ… 3.3x faster
Generate 1000 rows <3s 0.026s โœ… 115x faster
Merge 10 files <8s 0.117s โœ… 68x faster
Batch 20 files <10s 0.192s โœ… 52x faster
Format 1000 cells <0.5s 0.089s โœ… 5.6x faster

Performance Optimizations:

  • โœ… LRU caching for parsed files (128 entries)
  • โœ… Thread pool concurrency (8 workers)
  • โœ… Streaming I/O for large files
  • โœ… Memory-efficient processing (5000 rows = +0.04MB)

Made with โค๏ธ by 1126misakp

This project is actively maintained and welcomes contributions from the community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_excel_supabase-1.0.0.tar.gz (247.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_excel_supabase-1.0.0-py3-none-any.whl (82.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_excel_supabase-1.0.0.tar.gz.

File metadata

  • Download URL: mcp_excel_supabase-1.0.0.tar.gz
  • Upload date:
  • Size: 247.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for mcp_excel_supabase-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e727c7f766dcaeb371419e74f81828839f4ee3a7aa5fae6044438081fe7a0af
MD5 9d40ff988a80035411da79a6d522f181
BLAKE2b-256 c192308368d480eda3db9ff8ee84a1aa08126c99026dfb462275459fd76d2be2

See more details on using hashes here.

File details

Details for the file mcp_excel_supabase-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_excel_supabase-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f5b51a20bd6d185786b8438a4d439dbf99e0ecd3b6048b4c16ee6b583187f5a
MD5 89253b03cfe400fe3e42176b9aca4a60
BLAKE2b-256 d78a8bf9eaf89e2f5e779d20e6071d00f47d6b1b2f8955a63e61897172bf5d6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page