mirror of
https://github.com/sbroenne/mcp-server-excel.git
synced 2026-09-19 07:53:08 +08:00
ExcelMcp.CLI Examples
This directory contains example scripts demonstrating ExcelMcp.CLI features.
Batch Mode Demo
The batch mode demo shows how to use batch sessions for high-performance multi-operation workflows.
Requirements
- Windows with Excel installed
- ExcelMcp.CLI installed (
dotnet tool install --global Sbroenne.ExcelMcp.CLI)
Running the Demo
Linux/macOS/WSL:
./batch-mode-demo.sh
Windows PowerShell:
.\batch-mode-demo.ps1
What the Demo Does
- Creates a test workbook (
test-batch.xlsx) - Starts a batch session and captures the batch ID
- Performs multiple operations using the same Excel instance:
- Creates 3 worksheets (Sales, Customers, Products)
- Lists worksheets
- Lists Power Queries
- Lists active batch sessions
- Commits the batch (saves all changes)
- Verifies changes were saved
Expected Performance
Batch mode is 75-90% faster than running individual commands because:
- Only one Excel instance is opened
- No file open/close overhead between operations
- All changes committed atomically
Cleanup
rm test-batch.xlsx
Or in PowerShell:
Remove-Item test-batch.xlsx
Use Cases
Batch mode is ideal for:
- RPA workflows - Automated report generation
- Data pipelines - ETL operations with multiple steps
- Testing - Setting up test data across multiple sheets
- Bulk operations - Making many changes to a workbook