A Model Context Protocol (MCP) server that provides tools for reading Excel (xlsx) files.
- Read content from all sheets in an Excel file
- Read content from a specific sheet by name
- Read content from a specific sheet by index
- Returns data in JSON format
- Handles empty cells and data type conversions
Requires Python 3.10 or higher.
# Using pip pip install excel-reader-server # Using uv (recommended) uv pip install excel-reader-server- mcp >= 1.2.1
- openpyxl >= 3.1.5
The server provides three main tools:
Reads content from all sheets in an Excel file.
{ "file_path": "path/to/your/excel/file.xlsx" }Reads content from a specific sheet by name. If no sheet name is provided, reads the first sheet.
{ "file_path": "path/to/your/excel/file.xlsx", "sheet_name": "Sheet1" # optional }Reads content from a specific sheet by index. If no index is provided, reads the first sheet (index 0).
{ "file_path": "path/to/your/excel/file.xlsx", "sheet_index": 0 # optional }The server returns data in the following JSON format:
{ "Sheet1": [ ["Header1", "Header2", "Header3"], ["Value1", "Value2", "Value3"], ["Value4", "Value5", "Value6"] ] }- Each sheet is represented as a key in the top-level object
- Sheet data is an array of arrays, where each inner array represents a row
- All values are converted to strings
- Empty cells are represented as empty strings
The server provides clear error messages for common issues:
- File not found
- Invalid sheet name
- Index out of range
- General Excel file reading errors
This project is released under the Apache 2 License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
