MCP server for Excel analysis and multimodal AI integration - comprehensive metadata extraction and sheet image capture for agents
Project description
Volute-XLS: Excel Integration for AI Applications
A comprehensive Model Context Protocol (MCP) server that enables AI agents to interact with Microsoft Excel spreadsheets through advanced metadata extraction, content analysis, and multimodal sheet image capture.
🚀 Features
📊 Excel Analysis & Metadata Extraction
- Comprehensive workbook analysis - File properties, sheet structure, named ranges
- Detailed sheet content analysis - Cell data, formulas, data types, merged cells
- Chart and image detection - Identify visual elements in spreadsheets
- Sample data extraction - Get representative cell data for content understanding
- Cross-platform support - Works on Windows, macOS, and Linux
🖼️ Multimodal Sheet Image Capture (Windows + xlwings)
- Full sheet capture - Export entire worksheets as PNG images
- Range-specific capture - Target specific cell ranges for focused analysis
- Zoom control - Adjust capture zoom levels (10% to 400%)
- Base64 encoding - Ready for multimodal LLM analysis
- Thread-safe operations - Reliable concurrent Excel automation
🔧 Dual Architecture
- Local Server - Full COM automation with xlwings for Windows Excel integration
- Cloud Server - Cross-platform openpyxl-based analysis without local requirements
- FastMCP Integration - Built on the Model Context Protocol standard
- SDK Client Library - Easy programmatic access to all tools
📦 Installation
Basic Installation (Cross-platform)
pip install volute-xls
Full Windows Installation (with image capture)
pip install volute-xls[windows]
# or for all features
pip install volute-xls[full]
Development Installation
pip install volute-xls[dev]
🏃♂️ Quick Start
1. Start the Local Server
# HTTP server (default)
volute-xls-local
# STDIO for MCP clients
volute-xls-local --transport stdio
2. Use with MCP Configuration
Add to your MCP client configuration:
Option A: Using installed package command
{
"volute-xls-local": {
"command": "volute-xls-local",
"args": ["--transport", "stdio"],
"env": {},
"working_directory": null
}
}
Option B: Using Python module (alternative)
{
"volute-xls-local": {
"command": "python",
"args": [
"-m",
"volute_xls.server_local",
"--transport",
"stdio"
],
"env": {},
"working_directory": null
}
}
3. Programmatic Usage
from volute_xls import create_client
# Extract Excel metadata
async with create_client("local") as client:
metadata = await client.extract_excel_metadata(
"path/to/workbook.xlsx",
include_sheet_content=True,
include_sheet_data=True
)
print(f"Found {len(metadata['data']['sheets'])} sheets")
# Capture sheet images (Windows + xlwings)
async with create_client("local") as client:
images = await client.capture_excel_sheets(
"path/to/workbook.xlsx",
sheet_names=["Sheet1", "Dashboard"],
image_width=1200,
image_height=800
)
# Images returned as base64-encoded PNG data
🛠️ Available Tools
extract_excel_metadata
Extract comprehensive metadata from Excel workbooks including file properties, sheet structure, cell content summary, and named ranges.
Parameters:
excel_path(str): Path to Excel file (.xlsx, .xlsm, .xls)include_sheet_content(bool): Include detailed sheet analysisinclude_sheet_data(bool): Include sample cell dataoutput_format(str): "json" or "summary"
analyze_excel_sheets
Perform focused analysis of specific worksheets with detailed content extraction and optional sample data.
Parameters:
excel_path(str): Path to Excel filesheet_names(list): Specific sheets to analyze (None for all)include_data_sample(bool): Include sample datamax_rows(int): Maximum rows in sampleinclude_formatting(bool): Include cell formatting
capture_excel_sheets (Windows + xlwings)
Capture Excel worksheets as PNG images for multimodal analysis.
Parameters:
excel_path(str): Path to Excel filesheet_names(list): Sheet names to captureimage_width(int): Image width (200-4000px)image_height(int): Image height (200-4000px)zoom_level(float): Zoom percentage (10-400%)
capture_excel_ranges (Windows + xlwings)
Capture specific cell ranges as images for detailed analysis.
Parameters:
excel_path(str): Path to Excel filesheet_ranges(dict): {"SheetName": ["A1:C10", "E1:G5"]}image_width(int): Image width (100-2000px)image_height(int): Image height (100-2000px)
🌐 Architecture
Local Server (volute-xls-local)
- Full Excel Integration - COM automation via xlwings
- Image Capture - Native Excel sheet-to-image export
- Local File Access - Direct file system operations
- Thread Safety - Concurrent Excel operations
- Windows Optimized - Best performance on Windows with Excel installed
Cloud Server (volute-xls-server)
- Cross-Platform - Pure Python openpyxl-based analysis
- No Excel Required - Works without Microsoft Excel
- Scalable - Cloud deployment ready
- Limited Features - Metadata and analysis only (no image capture)
📋 Requirements
Basic Requirements (All Platforms)
- Python 3.8+
- fastmcp >= 2.0.0
- openpyxl >= 3.0.0
- Pillow >= 9.0.0
Windows Image Capture Requirements
- Microsoft Excel installed
- xlwings >= 0.30.0
- pywin32 >= 306
Supported File Formats
- .xlsx - Excel 2007+ workbooks
- .xlsm - Excel macro-enabled workbooks
- .xls - Legacy Excel workbooks (limited support)
🔧 Configuration
Environment Variables
# Local server configuration
LOCAL_SERVER_NAME="Volute-XLS-Local"
LOCAL_SERVER_HOST="127.0.0.1"
LOCAL_SERVER_PORT="8002"
# Cloud server configuration
CLOUD_SERVER_NAME="Volute-XLS-Cloud"
CLOUD_SERVER_HOST="0.0.0.0"
CLOUD_SERVER_PORT="8000"
Server Options
# Start local server with custom settings
volute-xls-local --host 0.0.0.0 --port 8080
# Start cloud server
volute-xls-server --port 8000
🧪 Testing
# Install development dependencies
pip install volute-xls[dev]
# Run tests
pytest tests/
# Test with sample Excel file
python -c "
import asyncio
from volute_xls import create_client
async def test():
async with create_client('local') as client:
caps = await client.get_excel_capabilities()
print('Excel capabilities:', caps)
asyncio.run(test())
"
🤝 Integration Examples
Claude Desktop MCP Configuration
{
"mcpServers": {
"volute-xls-local": {
"command": "volute-xls-local",
"args": ["--transport", "stdio"]
}
}
}
Programmatic Analysis Pipeline
import asyncio
from volute_xls import VoluteXLSLocalClient
async def analyze_workbook(file_path):
async with VoluteXLSLocalClient() as client:
# 1. Extract metadata
metadata = await client.extract_excel_metadata(file_path)
# 2. Analyze key sheets
key_sheets = ["Summary", "Data", "Charts"]
analysis = await client.analyze_excel_sheets(
file_path,
sheet_names=key_sheets,
include_data_sample=True
)
# 3. Capture images for multimodal analysis
if analysis.get('success'):
images = await client.capture_excel_sheets(
file_path,
sheet_names=key_sheets
)
return {
'metadata': metadata,
'analysis': analysis,
'images': images
}
# Usage
result = asyncio.run(analyze_workbook("financial_report.xlsx"))
📚 Documentation
- API Reference - docs/api.md
- Developer Guide - DEVELOPER_GUIDE.md
- Examples - examples/
- Troubleshooting - docs/troubleshooting.md
🛡️ Security & Privacy
- Local Processing - All Excel analysis happens locally
- No Data Upload - Files never leave your machine with local server
- Thread Safety - Concurrent operations are protected
- Resource Management - Automatic cleanup of temporary files and Excel instances
🗺️ Roadmap
- Enhanced Chart Analysis - Detailed chart metadata extraction
- Pivot Table Support - Analysis of pivot tables and data models
- VBA Code Detection - Identify and analyze VBA macros
- Performance Optimization - Faster processing of large workbooks
- Additional Image Formats - Support for JPEG, SVG export
- Cloud Image Capture - Server-side image generation without xlwings
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Development Setup
git clone https://gitlab.com/coritan/volute-xls.git
cd volute-xls
pip install -e .[dev,full]
pre-commit install
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- FastMCP - For the excellent Model Context Protocol framework
- openpyxl - For cross-platform Excel file processing
- xlwings - For Windows Excel COM automation
- Pillow - For image processing capabilities
- Model Context Protocol - For the agent integration standard
Created with ❤️ for the AI agent community
For questions, issues, or feature requests, please visit our GitLab repository or open an issue.
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
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 volute_xls-1.1.1.tar.gz.
File metadata
- Download URL: volute_xls-1.1.1.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fdb897b68ec101b37c6e353fa2735d7662e3bdbf4d3765397ab5914e4441595
|
|
| MD5 |
f4ae202bf1296a3162e52d70f7b651d7
|
|
| BLAKE2b-256 |
b78340ab6a9d49bb4b24a73b8248db71c0a93af3541f214b0dbad1daa55dac5a
|
File details
Details for the file volute_xls-1.1.1-py3-none-any.whl.
File metadata
- Download URL: volute_xls-1.1.1-py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15109a6e5b756b2368f71ae252dbc9a89b769507d3d3a32f84948479fa8dc29f
|
|
| MD5 |
34e1a79148b5a95d9c5897b8c330eb66
|
|
| BLAKE2b-256 |
b957802294c7f07fdee03fb58f8cb858ffbb52b3d54ff43b0cf0d10085bc0f4e
|