Excel Mcp Server avatar

Excel Mcp Server

Pricing

Pay per usage

Go to Apify Store
Excel Mcp Server

Excel Mcp Server

Excel Mcp server with 200+ tools

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Muhammad Aashiq

Muhammad Aashiq

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

19 hours ago

Last modified

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

CategoryToolsDescription
Local Excel (openpyxl)34Read/write/format .xlsx files without Excel installed
Microsoft 365 / OneDrive9Authenticate, upload, read/write files on OneDrive & SharePoint
Live Excel (COM / xlwings)176Full automation of Excel workbooks open on Windows desktop
Total219

Quick Start

1. Clone & Install

git clone https://github.com/your-org/excel-mcp-server.git
cd excel-mcp-server
pip 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-id
AZURE_TENANT_ID=your-tenant-id
AZURE_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

VariableRequiredDescription
AZURE_CLIENT_IDNo*Azure App Registration Client ID
AZURE_TENANT_IDNo*Azure AD Tenant ID
AZURE_CLIENT_SECRETNo*Azure App Client Secret

*Required only for Microsoft 365 / OneDrive tools.

Azure App Permissions needed (for M365 tools):

  • Files.ReadWrite.All
  • Sites.ReadWrite.All
  • User.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

ToolDescription
create_workbookCreate a new blank .xlsx workbook at a given path
read_excelRead cell values from a range in a worksheet
write_excelWrite a 2-D list of values into a worksheet range
fill_cellsFill individual cells with values (cell→value dict)
add_formulaWrite a formula string into a specific cell
list_sheetsList all worksheet names and the active sheet
create_sheetAdd a new worksheet at an optional position
delete_sheetDelete a worksheet by name
rename_sheetRename an existing worksheet
copy_sheetDuplicate a worksheet within the same workbook
search_in_excelSearch all sheets for a value (exact or substring match)
get_workbook_infoReturn metadata: file size, sheet names, named ranges

Formatting & Layout

ToolDescription
format_cellsApply font, fill, border, alignment, and number format to a range
set_column_widthSet a specific column width in Excel units
auto_fit_columnsAuto-fit all columns to their content
set_row_heightSet the height of a specific row
freeze_panesFreeze rows/columns above and to the left of a cell
merge_cellsMerge a cell range into a single cell
unmerge_cellsUn-merge a previously merged range
get_merged_cellsList all merged cell ranges in a worksheet

Row & Column Operations

ToolDescription
insert_rowsInsert blank rows at a given position
insert_columnsInsert blank columns at a given position
delete_rowsDelete rows at a given position
delete_columnsDelete columns at a given position
copy_rangeCopy cell values from one range to another
delete_rangeClear/delete a range of cells

Tables, Charts, Pivot & Validation

ToolDescription
create_chartInsert a bar, column, line, pie, area, or scatter chart
create_tableCreate an Excel table from a cell range
create_pivot_tableCreate a pivot table from a data range
add_conditional_formatAdd a color-scale or data-bar conditional format rule
validate_formula_syntaxCheck whether a formula string is syntactically valid
validate_rangeValidate that a range address is well-formed
get_data_validation_infoRead data-validation rules on a range
define_named_rangeCreate a named range in the workbook
delete_named_rangeDelete a named range by name
list_named_rangesList all named ranges in the workbook

Microsoft 365 / OneDrive Tools

Connect to Microsoft 365 via the Microsoft Graph API. Call authenticate_m365 first.

ToolDescription
authenticate_m365Sign in using device-code flow (browser prompt) — must be called first
upload_to_onedriveUpload a local .xlsx file to a OneDrive folder
open_from_linkGet workbook info from a SharePoint or OneDrive sharing URL
read_m365_excelRead cell values from a OneDrive/SharePoint Excel file by item ID
write_m365_excelWrite values into a OneDrive/SharePoint Excel worksheet
list_m365_sheetsList worksheets in a OneDrive/SharePoint Excel file
create_m365_workbookCreate a new blank workbook in OneDrive
create_share_linkGenerate a shareable link for a OneDrive/SharePoint file
list_onedrive_filesList 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

ToolDescription
open_excel_liveOpen an Excel file and connect via COM
close_excel_liveClose an open workbook (optionally save first)
save_excel_liveSave the active or named workbook
attach_live_workbookAttach to an already-open workbook by name
list_live_workbooksList all workbooks currently open in Excel
list_all_excel_workbooksList every Excel file in a folder
get_live_workbook_infoGet sheet names, named ranges, and metadata
get_live_workbook_propertiesRead workbook custom properties
set_live_workbook_propertiesWrite workbook custom properties
protect_live_workbookPassword-protect the workbook structure
unprotect_live_workbookRemove workbook structure protection
run_live_calculateForce recalculate all formulas
export_live_to_pdfExport sheet(s) to PDF
export_live_to_csvExport active sheet to CSV
show_excel_windowMake the Excel window visible
hide_excel_windowHide the Excel window
set_excel_status_barSet text in Excel's status bar
clear_excel_status_barClear the Excel status bar
undo_liveUndo the last action
undo_all_liveUndo all actions since last save
run_vba_macroRun a named VBA macro in an open workbook
run_live_vbaExecute an arbitrary VBA code string

Sheet Management

ToolDescription
add_live_sheetAdd a new worksheet
delete_live_sheetDelete a worksheet
rename_live_sheetRename a worksheet
copy_live_sheetDuplicate a worksheet
move_live_sheetMove a worksheet to a new position
list_live_sheetsList all worksheets with index and visibility
hide_live_sheetHide a worksheet
unhide_live_sheetUnhide a worksheet
set_live_tab_colorSet the tab color of a worksheet (hex color)
protect_live_sheetPassword-protect a worksheet
unprotect_live_sheetRemove worksheet protection
freeze_live_panesFreeze rows/columns in a worksheet
unfreeze_live_panesRemove freeze panes
get_live_sheet_infoGet row/column count and used range
get_live_sheet_objectsList all objects (charts, images, shapes) on a sheet

Cell Read & Write

ToolDescription
read_live_cellsRead cell values from a range
write_live_cellWrite a value or formula to a single cell
fill_live_rangeFill a range with a single value
fill_live_cellsFill multiple specific cells with their respective values
fill_live_seriesAuto-fill a series (numbers, dates, etc.) across a range
get_live_formulaReturn the formula string from a cell
add_live_formulaWrite a formula into a cell
evaluate_live_formulaEvaluate and return the result of a formula expression
find_live_free_rangeFind the next empty range below existing data
get_live_last_rowGet the last row number with data in a column
get_live_last_columnGet the last column letter with data in a row
get_live_used_rangeGet the address of the used range
get_live_selectionGet the currently selected range address
set_live_selectionSelect a range in the worksheet
navigate_live_cellMove the active cell to a given address
get_live_cell_infoGet value, formula, format, and type of a cell
get_live_range_statsGet min, max, sum, average, and count for a range
search_live_workbookSearch all sheets for a value

Formatting

ToolDescription
format_live_rangeApply fill color, font color, bold/italic/underline to a range
add_live_borderAdd borders around or inside a cell range
get_live_cell_formatRead all formatting properties of a cell
set_live_fontSet font name, size, bold, italic, underline, color
set_live_number_formatSet number format string (e.g. #,##0.00, dd/mm/yyyy)
get_live_number_formatRead the number format of a cell
set_live_cell_alignmentSet horizontal/vertical alignment and text orientation
set_live_cell_styleApply a named Excel cell style
set_live_text_wrapEnable or disable text wrap in a range
copy_live_cell_formatCopy formatting from one cell to another range
clear_live_rangeClear values and formatting from a range
clear_live_range_contentsClear only the values from a range
clear_live_range_formatClear only the formatting from a range
set_live_zoomSet the worksheet zoom level (10–400%)

Row & Column Operations

ToolDescription
insert_live_rowsInsert blank rows at a position
insert_live_columnsInsert blank columns at a position
delete_live_rowsDelete rows at a position
delete_live_columnsDelete columns at a position
hide_live_rowsHide a row range
unhide_live_rowsUnhide a row range
hide_live_columnsHide a column range
unhide_live_columnsUnhide a column range
set_live_column_widthSet width of one or more columns
set_live_row_heightSet height of one or more rows
autofit_live_columnsAuto-fit column widths to content
autofit_live_rowsAuto-fit row heights to content
group_live_rowsGroup rows for collapsing/expanding
ungroup_live_rowsRemove row grouping
group_live_columnsGroup columns for collapsing/expanding
ungroup_live_columnsRemove column grouping

Range Operations

ToolDescription
copy_live_rangeCopy a range (with formatting) to a target range
copy_live_range_as_valuesPaste only values from source to target
delete_live_rangeDelete a range and shift cells left or up
move_live_rangeCut and paste a range to a new location
sort_live_rangeSort a range by one or more columns
filter_live_rangeApply AutoFilter to a range
clear_live_filterClear AutoFilter from a worksheet
find_and_replace_liveFind and replace values in a range
remove_live_duplicatesRemove duplicate rows in a range
paste_live_transposePaste a range transposed (rows ↔ columns)

Merge Operations

ToolDescription
merge_live_cellsMerge a cell range
unmerge_live_cellsUn-merge a previously merged range
get_live_merged_cellsList all merged regions on a sheet

Named Ranges

ToolDescription
define_live_named_rangeCreate or update a named range
delete_live_named_rangeDelete a named range
list_live_named_rangesList all named ranges with their addresses
update_live_named_rangeUpdate the reference address of a named range
get_live_named_range_valueRead the values in a named range

Tables

ToolDescription
create_live_tableCreate an Excel table from a range
delete_live_tableDelete a table (and optionally its data)
list_live_tablesList all tables on a sheet or workbook
rename_live_tableRename an existing table
apply_live_table_styleApply a named table style
toggle_live_table_total_rowShow or hide the totals row
convert_live_table_to_rangeConvert a table back to a plain range
add_live_table_rowAppend a new row to a table
get_live_table_dataRead all data from a table including headers

Charts

ToolDescription
create_live_chartCreate a chart (bar, column, line, pie, scatter, area, etc.)
delete_live_chartDelete a chart by name or index
list_live_chartsList all charts on a sheet
update_live_chart_titleChange the chart title
update_live_chart_typeChange the chart type
move_live_chartMove a chart to a new position
resize_live_chartResize a chart (width/height in points)
add_live_chart_seriesAdd a new data series to an existing chart
delete_live_chart_seriesRemove a data series from a chart
get_live_chart_dataRead chart series data and properties
set_live_chart_axis_titleSet the X or Y axis title
set_live_chart_data_rangeUpdate the data range of a chart
set_live_chart_legendShow, hide, or reposition the legend

Pivot Tables

ToolDescription
create_live_pivot_tableCreate a PivotTable from a data range
delete_live_pivot_tableDelete a PivotTable
list_live_pivot_tablesList all PivotTables in a workbook
refresh_live_pivot_tablesRefresh all PivotTables
refresh_live_single_pivotRefresh a specific PivotTable by name
get_live_pivot_dataRead PivotTable data and field configuration

Conditional Formatting

ToolDescription
add_live_conditional_formatAdd a conditional formatting rule to a range
clear_live_conditional_formatRemove conditional formatting from a range
get_live_conditional_formatsList all conditional formatting rules on a sheet

Data Validation

ToolDescription
add_live_data_validationAdd a data validation rule (list, number, date, etc.)
delete_live_data_validationRemove a data validation rule
get_live_data_validation_infoRead data validation settings on a range
list_live_data_validationsList all data validation rules on a sheet
ToolDescription
add_live_commentAdd a comment to a cell
get_live_commentsList all comments on a sheet
delete_live_commentDelete a comment from a cell
add_live_hyperlinkAdd a hyperlink to a cell
get_live_hyperlinksList all hyperlinks on a sheet
delete_live_hyperlinkRemove a hyperlink from a cell

Shapes, Images & Text Boxes

ToolDescription
add_live_shapeInsert a shape (rectangle, ellipse, arrow, etc.)
delete_live_shapeDelete a shape by name
list_live_shapesList all shapes on a sheet
get_live_shape_infoGet position, size, and type of a shape
rename_live_shapeRename a shape
set_live_shape_textSet the text inside a shape
add_live_text_boxInsert a text box at a given position
add_live_imageInsert an image from a file path
delete_live_imageDelete an image by name
list_live_imagesList all images on a sheet

Sparklines & Slicers

ToolDescription
add_live_sparklineAdd a sparkline (line, column, win/loss) to a cell
delete_live_sparklineDelete a sparkline
add_live_slicerAdd a slicer connected to a table or PivotTable
delete_live_slicerDelete a slicer
list_live_slicersList all slicers on a sheet
ToolDescription
set_live_print_areaDefine the print area for a sheet
set_live_page_orientationSet portrait or landscape orientation
set_live_paper_sizeSet paper size (A4, Letter, etc.)
set_live_marginsSet page margins (top, bottom, left, right in inches)
set_live_header_footerSet header and footer text for printing
get_live_page_setupRead all page setup settings
set_live_print_scaleSet the print scale percentage
set_live_fit_to_pageFit sheet to a given number of pages wide/tall
set_live_print_titlesSet rows/columns to repeat on every printed page
insert_live_page_breakInsert a manual page break
remove_live_page_breakRemove a manual page break
list_live_page_breaksList all manual page breaks on a sheet
lock_live_cellsLock/unlock cells for sheet protection

External Data

ToolDescription
refresh_live_external_dataRefresh all external data connections
list_live_external_connectionsList 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

mcp
openpyxl
msal
requests
python-dotenv
pandas
xlwings

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:

EventPrice
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_ID and AZURE_TENANT_ID are set in .env.
  • Ensure the Azure App has Files.ReadWrite.All and Sites.ReadWrite.All permissions granted by an admin.
  • Re-run authenticate_m365 to 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.