Excel Mcp Server
Pricing
Pay per usage
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Muhammad Aashiq
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
19 hours ago
Last modified
Categories
Share
Excel Copilot MCP Server
A 219-tool Model Context Protocol (MCP) server that gives AI agents full Excel superpowers — local .xlsx files, Microsoft 365 / OneDrive / SharePoint, and live COM automation for workbooks already open in Excel on Windows.
Pricing: $0.001 per tool call (configured in
.actor/actor.json)
Table of Contents
- Features
- Quick Start
- Configuration
- Tool Reference
- Project Structure
- Requirements
- Apify Pricing
- Troubleshooting
Features
| Category | Tools | Description |
|---|---|---|
| Local Excel (openpyxl) | 34 | Read/write/format .xlsx files without Excel installed |
| Microsoft 365 / OneDrive | 9 | Authenticate, upload, read/write files on OneDrive & SharePoint |
| Live Excel (COM / xlwings) | 176 | Full automation of Excel workbooks open on Windows desktop |
| Total | 219 |
Quick Start
1. Clone & Install
git clone https://github.com/your-org/excel-mcp-server.gitcd excel-mcp-serverpip install -r requirements.txt
2. Configure Environment (optional — only for M365 tools)
Copy .env.example to .env and fill in your Azure App credentials:
AZURE_CLIENT_ID=your-client-idAZURE_TENANT_ID=your-tenant-idAZURE_CLIENT_SECRET=your-client-secret
3. Run the Server
$python server.py
4. Connect from VS Code (GitHub Copilot Chat)
Add to .vscode/mcp.json in your workspace:
{"servers": {"excel-copilot": {"type": "stdio","command": "python","args": ["C:/path/to/excel-mcp-server/server.py"]}}}
Configuration
| Variable | Required | Description |
|---|---|---|
AZURE_CLIENT_ID | No* | Azure App Registration Client ID |
AZURE_TENANT_ID | No* | Azure AD Tenant ID |
AZURE_CLIENT_SECRET | No* | Azure App Client Secret |
*Required only for Microsoft 365 / OneDrive tools.
Azure App Permissions needed (for M365 tools):
Files.ReadWrite.AllSites.ReadWrite.AllUser.Read
Tool Reference
Local Excel Tools (openpyxl)
These tools work on .xlsx files stored locally. Excel does not need to be installed.
Workbook & Sheet Operations
| Tool | Description |
|---|---|
create_workbook | Create a new blank .xlsx workbook at a given path |
read_excel | Read cell values from a range in a worksheet |
write_excel | Write a 2-D list of values into a worksheet range |
fill_cells | Fill individual cells with values (cell→value dict) |
add_formula | Write a formula string into a specific cell |
list_sheets | List all worksheet names and the active sheet |
create_sheet | Add a new worksheet at an optional position |
delete_sheet | Delete a worksheet by name |
rename_sheet | Rename an existing worksheet |
copy_sheet | Duplicate a worksheet within the same workbook |
search_in_excel | Search all sheets for a value (exact or substring match) |
get_workbook_info | Return metadata: file size, sheet names, named ranges |
Formatting & Layout
| Tool | Description |
|---|---|
format_cells | Apply font, fill, border, alignment, and number format to a range |
set_column_width | Set a specific column width in Excel units |
auto_fit_columns | Auto-fit all columns to their content |
set_row_height | Set the height of a specific row |
freeze_panes | Freeze rows/columns above and to the left of a cell |
merge_cells | Merge a cell range into a single cell |
unmerge_cells | Un-merge a previously merged range |
get_merged_cells | List all merged cell ranges in a worksheet |
Row & Column Operations
| Tool | Description |
|---|---|
insert_rows | Insert blank rows at a given position |
insert_columns | Insert blank columns at a given position |
delete_rows | Delete rows at a given position |
delete_columns | Delete columns at a given position |
copy_range | Copy cell values from one range to another |
delete_range | Clear/delete a range of cells |
Tables, Charts, Pivot & Validation
| Tool | Description |
|---|---|
create_chart | Insert a bar, column, line, pie, area, or scatter chart |
create_table | Create an Excel table from a cell range |
create_pivot_table | Create a pivot table from a data range |
add_conditional_format | Add a color-scale or data-bar conditional format rule |
validate_formula_syntax | Check whether a formula string is syntactically valid |
validate_range | Validate that a range address is well-formed |
get_data_validation_info | Read data-validation rules on a range |
define_named_range | Create a named range in the workbook |
delete_named_range | Delete a named range by name |
list_named_ranges | List all named ranges in the workbook |
Microsoft 365 / OneDrive Tools
Connect to Microsoft 365 via the Microsoft Graph API. Call authenticate_m365 first.
| Tool | Description |
|---|---|
authenticate_m365 | Sign in using device-code flow (browser prompt) — must be called first |
upload_to_onedrive | Upload a local .xlsx file to a OneDrive folder |
open_from_link | Get workbook info from a SharePoint or OneDrive sharing URL |
read_m365_excel | Read cell values from a OneDrive/SharePoint Excel file by item ID |
write_m365_excel | Write values into a OneDrive/SharePoint Excel worksheet |
list_m365_sheets | List worksheets in a OneDrive/SharePoint Excel file |
create_m365_workbook | Create a new blank workbook in OneDrive |
create_share_link | Generate a shareable link for a OneDrive/SharePoint file |
list_onedrive_files | List Excel files in a OneDrive folder |
Live Excel Tools (COM / xlwings)
Control Excel workbooks currently open on Windows via COM automation. Excel must be installed and running.
Workbook Management
| Tool | Description |
|---|---|
open_excel_live | Open an Excel file and connect via COM |
close_excel_live | Close an open workbook (optionally save first) |
save_excel_live | Save the active or named workbook |
attach_live_workbook | Attach to an already-open workbook by name |
list_live_workbooks | List all workbooks currently open in Excel |
list_all_excel_workbooks | List every Excel file in a folder |
get_live_workbook_info | Get sheet names, named ranges, and metadata |
get_live_workbook_properties | Read workbook custom properties |
set_live_workbook_properties | Write workbook custom properties |
protect_live_workbook | Password-protect the workbook structure |
unprotect_live_workbook | Remove workbook structure protection |
run_live_calculate | Force recalculate all formulas |
export_live_to_pdf | Export sheet(s) to PDF |
export_live_to_csv | Export active sheet to CSV |
show_excel_window | Make the Excel window visible |
hide_excel_window | Hide the Excel window |
set_excel_status_bar | Set text in Excel's status bar |
clear_excel_status_bar | Clear the Excel status bar |
undo_live | Undo the last action |
undo_all_live | Undo all actions since last save |
run_vba_macro | Run a named VBA macro in an open workbook |
run_live_vba | Execute an arbitrary VBA code string |
Sheet Management
| Tool | Description |
|---|---|
add_live_sheet | Add a new worksheet |
delete_live_sheet | Delete a worksheet |
rename_live_sheet | Rename a worksheet |
copy_live_sheet | Duplicate a worksheet |
move_live_sheet | Move a worksheet to a new position |
list_live_sheets | List all worksheets with index and visibility |
hide_live_sheet | Hide a worksheet |
unhide_live_sheet | Unhide a worksheet |
set_live_tab_color | Set the tab color of a worksheet (hex color) |
protect_live_sheet | Password-protect a worksheet |
unprotect_live_sheet | Remove worksheet protection |
freeze_live_panes | Freeze rows/columns in a worksheet |
unfreeze_live_panes | Remove freeze panes |
get_live_sheet_info | Get row/column count and used range |
get_live_sheet_objects | List all objects (charts, images, shapes) on a sheet |
Cell Read & Write
| Tool | Description |
|---|---|
read_live_cells | Read cell values from a range |
write_live_cell | Write a value or formula to a single cell |
fill_live_range | Fill a range with a single value |
fill_live_cells | Fill multiple specific cells with their respective values |
fill_live_series | Auto-fill a series (numbers, dates, etc.) across a range |
get_live_formula | Return the formula string from a cell |
add_live_formula | Write a formula into a cell |
evaluate_live_formula | Evaluate and return the result of a formula expression |
find_live_free_range | Find the next empty range below existing data |
get_live_last_row | Get the last row number with data in a column |
get_live_last_column | Get the last column letter with data in a row |
get_live_used_range | Get the address of the used range |
get_live_selection | Get the currently selected range address |
set_live_selection | Select a range in the worksheet |
navigate_live_cell | Move the active cell to a given address |
get_live_cell_info | Get value, formula, format, and type of a cell |
get_live_range_stats | Get min, max, sum, average, and count for a range |
search_live_workbook | Search all sheets for a value |
Formatting
| Tool | Description |
|---|---|
format_live_range | Apply fill color, font color, bold/italic/underline to a range |
add_live_border | Add borders around or inside a cell range |
get_live_cell_format | Read all formatting properties of a cell |
set_live_font | Set font name, size, bold, italic, underline, color |
set_live_number_format | Set number format string (e.g. #,##0.00, dd/mm/yyyy) |
get_live_number_format | Read the number format of a cell |
set_live_cell_alignment | Set horizontal/vertical alignment and text orientation |
set_live_cell_style | Apply a named Excel cell style |
set_live_text_wrap | Enable or disable text wrap in a range |
copy_live_cell_format | Copy formatting from one cell to another range |
clear_live_range | Clear values and formatting from a range |
clear_live_range_contents | Clear only the values from a range |
clear_live_range_format | Clear only the formatting from a range |
set_live_zoom | Set the worksheet zoom level (10–400%) |
Row & Column Operations
| Tool | Description |
|---|---|
insert_live_rows | Insert blank rows at a position |
insert_live_columns | Insert blank columns at a position |
delete_live_rows | Delete rows at a position |
delete_live_columns | Delete columns at a position |
hide_live_rows | Hide a row range |
unhide_live_rows | Unhide a row range |
hide_live_columns | Hide a column range |
unhide_live_columns | Unhide a column range |
set_live_column_width | Set width of one or more columns |
set_live_row_height | Set height of one or more rows |
autofit_live_columns | Auto-fit column widths to content |
autofit_live_rows | Auto-fit row heights to content |
group_live_rows | Group rows for collapsing/expanding |
ungroup_live_rows | Remove row grouping |
group_live_columns | Group columns for collapsing/expanding |
ungroup_live_columns | Remove column grouping |
Range Operations
| Tool | Description |
|---|---|
copy_live_range | Copy a range (with formatting) to a target range |
copy_live_range_as_values | Paste only values from source to target |
delete_live_range | Delete a range and shift cells left or up |
move_live_range | Cut and paste a range to a new location |
sort_live_range | Sort a range by one or more columns |
filter_live_range | Apply AutoFilter to a range |
clear_live_filter | Clear AutoFilter from a worksheet |
find_and_replace_live | Find and replace values in a range |
remove_live_duplicates | Remove duplicate rows in a range |
paste_live_transpose | Paste a range transposed (rows ↔ columns) |
Merge Operations
| Tool | Description |
|---|---|
merge_live_cells | Merge a cell range |
unmerge_live_cells | Un-merge a previously merged range |
get_live_merged_cells | List all merged regions on a sheet |
Named Ranges
| Tool | Description |
|---|---|
define_live_named_range | Create or update a named range |
delete_live_named_range | Delete a named range |
list_live_named_ranges | List all named ranges with their addresses |
update_live_named_range | Update the reference address of a named range |
get_live_named_range_value | Read the values in a named range |
Tables
| Tool | Description |
|---|---|
create_live_table | Create an Excel table from a range |
delete_live_table | Delete a table (and optionally its data) |
list_live_tables | List all tables on a sheet or workbook |
rename_live_table | Rename an existing table |
apply_live_table_style | Apply a named table style |
toggle_live_table_total_row | Show or hide the totals row |
convert_live_table_to_range | Convert a table back to a plain range |
add_live_table_row | Append a new row to a table |
get_live_table_data | Read all data from a table including headers |
Charts
| Tool | Description |
|---|---|
create_live_chart | Create a chart (bar, column, line, pie, scatter, area, etc.) |
delete_live_chart | Delete a chart by name or index |
list_live_charts | List all charts on a sheet |
update_live_chart_title | Change the chart title |
update_live_chart_type | Change the chart type |
move_live_chart | Move a chart to a new position |
resize_live_chart | Resize a chart (width/height in points) |
add_live_chart_series | Add a new data series to an existing chart |
delete_live_chart_series | Remove a data series from a chart |
get_live_chart_data | Read chart series data and properties |
set_live_chart_axis_title | Set the X or Y axis title |
set_live_chart_data_range | Update the data range of a chart |
set_live_chart_legend | Show, hide, or reposition the legend |
Pivot Tables
| Tool | Description |
|---|---|
create_live_pivot_table | Create a PivotTable from a data range |
delete_live_pivot_table | Delete a PivotTable |
list_live_pivot_tables | List all PivotTables in a workbook |
refresh_live_pivot_tables | Refresh all PivotTables |
refresh_live_single_pivot | Refresh a specific PivotTable by name |
get_live_pivot_data | Read PivotTable data and field configuration |
Conditional Formatting
| Tool | Description |
|---|---|
add_live_conditional_format | Add a conditional formatting rule to a range |
clear_live_conditional_format | Remove conditional formatting from a range |
get_live_conditional_formats | List all conditional formatting rules on a sheet |
Data Validation
| Tool | Description |
|---|---|
add_live_data_validation | Add a data validation rule (list, number, date, etc.) |
delete_live_data_validation | Remove a data validation rule |
get_live_data_validation_info | Read data validation settings on a range |
list_live_data_validations | List all data validation rules on a sheet |
Comments & Hyperlinks
| Tool | Description |
|---|---|
add_live_comment | Add a comment to a cell |
get_live_comments | List all comments on a sheet |
delete_live_comment | Delete a comment from a cell |
add_live_hyperlink | Add a hyperlink to a cell |
get_live_hyperlinks | List all hyperlinks on a sheet |
delete_live_hyperlink | Remove a hyperlink from a cell |
Shapes, Images & Text Boxes
| Tool | Description |
|---|---|
add_live_shape | Insert a shape (rectangle, ellipse, arrow, etc.) |
delete_live_shape | Delete a shape by name |
list_live_shapes | List all shapes on a sheet |
get_live_shape_info | Get position, size, and type of a shape |
rename_live_shape | Rename a shape |
set_live_shape_text | Set the text inside a shape |
add_live_text_box | Insert a text box at a given position |
add_live_image | Insert an image from a file path |
delete_live_image | Delete an image by name |
list_live_images | List all images on a sheet |
Sparklines & Slicers
| Tool | Description |
|---|---|
add_live_sparkline | Add a sparkline (line, column, win/loss) to a cell |
delete_live_sparkline | Delete a sparkline |
add_live_slicer | Add a slicer connected to a table or PivotTable |
delete_live_slicer | Delete a slicer |
list_live_slicers | List all slicers on a sheet |
Print & Page Setup
| Tool | Description |
|---|---|
set_live_print_area | Define the print area for a sheet |
set_live_page_orientation | Set portrait or landscape orientation |
set_live_paper_size | Set paper size (A4, Letter, etc.) |
set_live_margins | Set page margins (top, bottom, left, right in inches) |
set_live_header_footer | Set header and footer text for printing |
get_live_page_setup | Read all page setup settings |
set_live_print_scale | Set the print scale percentage |
set_live_fit_to_page | Fit sheet to a given number of pages wide/tall |
set_live_print_titles | Set rows/columns to repeat on every printed page |
insert_live_page_break | Insert a manual page break |
remove_live_page_break | Remove a manual page break |
list_live_page_breaks | List all manual page breaks on a sheet |
lock_live_cells | Lock/unlock cells for sheet protection |
External Data
| Tool | Description |
|---|---|
refresh_live_external_data | Refresh all external data connections |
list_live_external_connections | List all external data connections |
Project Structure
excel-mcp-server/├── .actor/│ ├── actor.json # Apify actor config + $0.001/call pricing│ └── input_schema.json # Apify input schema├── tools/│ ├── local_excel.py # openpyxl-based local file tools│ ├── m365_excel.py # Microsoft Graph API / M365 tools│ └── live_excel.py # xlwings COM automation tools├── server.py # FastMCP server — 219 tools├── requirements.txt # Python dependencies├── Dockerfile # Container build file└── README.md
Requirements
mcpopenpyxlmsalrequestspython-dotenvpandasxlwings
Install: pip install -r requirements.txt
Note:
xlwings(live Excel tools) requires Microsoft Excel installed on Windows or macOS. Live tools do not work in headless Linux/Docker environments. Local and M365 tools work on any platform.
Apify Pricing
Published on Apify with pay-per-use pricing:
| Event | Price |
|---|---|
| 1 tool call | $0.001 USD |
Configured in .actor/actor.json:
"monetization": {"pricingModel": "PER_USAGE_EVENT","pricePerUnitUsd": 0.001,"usageEventTitle": "Tool call"}
Troubleshooting
xlwings COM error: "Application not found"
- Excel must be installed and licensed on the same Windows machine.
- Start Excel at least once before using live tools.
PermissionError when saving .xlsx
- The file is open in another process. Close it first, or use
save_excel_live.
M365 authentication fails
- Check that
AZURE_CLIENT_IDandAZURE_TENANT_IDare set in.env. - Ensure the Azure App has
Files.ReadWrite.AllandSites.ReadWrite.Allpermissions granted by an admin. - Re-run
authenticate_m365to refresh the token.
Server not detected by MCP client
- Verify the path in your MCP client config points to the correct
server.py. - Python 3.10+ is required.