The Excel MCP Server is a tool for reading, writing, analyzing, and managing Excel files efficiently via the Model Context Protocol.
📖 Read Excel Files: Get worksheet lists, specific sheet data, or data from all sheets
✍️ Write Excel Files: Create new files, write to specific sheets, with support for multiple worksheets
🔍 Analyze Excel Structure: Analyze worksheet structure and export it to a new file
💾 Cache Management: Automatically cache file content with scheduled cleanup and manual clearing options
📝 Log Management: Automatically log operations with periodic cleanup
Excel MCP Server
简体中文 | English
Excel file processing server based on Model Context Protocol (MCP), providing functionalities for reading, writing, and analyzing Excel files.
Features
📖 Read Excel Files
Get worksheet list
Read specific worksheet data
Read all worksheets data
✍️ Write Excel Files
Create new Excel files
Write to specific worksheet
Support multiple worksheets
🔍 Analyze Excel Structure
Analyze worksheet structure
Export structure to new file
💾 Cache Management
Automatic file content caching
Scheduled cache cleanup
Manual cache clearing
📝 Log Management
Automatic operation logging
Periodic log cleanup
Installation
Installing via Smithery
To install excel-mcp-server for Claude Desktop automatically via Smithery:
Installing Manually
Installing via NPM excel-mcp-server can be automatically installed by adding the following configuration to the MCP servers configuration.
Windows Platform:
Other Platforms:
Note: LOG_PATH is optional. If not set, logs will be stored in the 'logs' folder under the application root directory.other arguments are optional.
API Tools
Structure Tools
analyzeExcelStructure
Function: Get Excel file structure including sheet list and column headers in JSON format
Parameters:
fileAbsolutePath: Absolute path of the Excel file
headerRows: Number of header rows (default: 1)
exportExcelStructure
Function: Export Excel file structure (sheets and headers) to a new Excel template file
Parameters:
sourceFilePath: Source Excel file path
targetFilePath: Target Excel file path
headerRows: Number of header rows (default: 1)
Read Tools
readSheetNames
Function: Get all sheet names from the Excel file
Parameters:
fileAbsolutePath: Absolute path of the Excel file
readDataBySheetName
Function: Get data from a specific sheet in the Excel file
Parameters:
fileAbsolutePath: Absolute path of the Excel file
sheetName: Name of the sheet to read
headerRow: Header row number (default: 1)
dataStartRow: Data start row number (default: 2)
readSheetData
Function: Get data from all sheets in the Excel file
Parameters:
fileAbsolutePath: Absolute path of the Excel file
headerRow: Header row number (default: 1)
dataStartRow: Data start row number (default: 2)
Write Tools
writeDataBySheetName
Function: Write data to a specific sheet in the Excel file (overwrites if sheet exists)
Parameters:
fileAbsolutePath: Absolute path of the Excel file
sheetName: Name of the sheet to write
data: Array of data to write
writeSheetData
Function: Create a new Excel file with provided data
Parameters:
fileAbsolutePath: Absolute path for the new Excel file
data: Object containing multiple sheet data
Cache Tools
clearFileCache
Function: Clear cached data for the specified Excel file
Parameters:
fileAbsolutePath: Absolute path of the Excel file to clear from cache
Configuration
Environment Variables
LOG_PATH
: Log files storage pathOptional
Default: 'logs' folder under application root directory
CACHE_MAX_AGE
: Cache expiration time (hours)Optional
Default: 1
CACHE_CLEANUP_INTERVAL
: Cache cleanup interval (hours)Optional
Default: 4
LOG_RETENTION_DAYS
: Log retention daysOptional
Default: 7
LOG_CLEANUP_INTERVAL
: Log cleanup interval (hours)Optional
Default: 24
Default Configuration
Cache Configuration
Cache expiration time: 1 hour
Cache cleanup interval: 4 hours
Log Configuration
Log retention days: 7 days
Cleanup interval: 24 hours
Dependencies
@modelcontextprotocol/sdk: ^1.7.0
xlsx: ^0.18.5
typescript: ^5.8.2
Development Dependencies
@types/node: ^22.13.10
nodemon: ^3.1.9
ts-node: ^10.9.2
License
This project is licensed under the MIT License. This means you are free to:
Use the software for commercial or non-commercial purposes
Modify the source code
Distribute original or modified code Requirements:
Retain the original copyright notice
No liability can be claimed against the authors for software use For detailed license information,please see the LICENSE file.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
Enables seamless reading, writing, and analyzing of Excel files through Model Context Protocol, with features for worksheet management, structure analysis, and automated caching.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides tools for reading Excel (xlsx) files, enabling extraction of data from entire workbooks or specific sheets with results returned in structured JSON format.Last updated -35Apache 2.0
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.Last updated -61,642537MIT License
- -securityFlicense-qualityA Model Context Protocol server that provides tools for reading, updating, filtering, and visualizing Excel data through a simple API.Last updated -
- -securityAlicense-qualityA Model Context Protocol server for intelligent Excel processing and data analysis, offering tools for reading, validating, executing code, and generating interactive visualizations with Excel files.Last updated -94MIT License