excel reader mcp
Provides efficient handling of large Excel files through automatic chunking and pagination, using MCP to enable seamless file reading and management features such as sheet selection and error handling.
Provides efficient handling of large Excel files through automatic chunking and pagination, using MCP to enable seamless file reading and management features such as sheet selection and error handling.
A Model Context Protocol (MCP) server for reading Excel files with automatic chunking and pagination support. Built with SheetJS and TypeScript, this tool helps you handle large Excel files efficiently by automatically breaking them into manageable chunks.
To install Excel Reader for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @ArchimedesCrypto/excel-reader-mcp-chunked --client claude
Install globally:
npm install -g @archimdescrypto/excel-reader
Add to your MCP settings file (usually at ~/.config/claude/settings.json
or equivalent):
{
"mcpServers": {
"excel-reader": {
"command": "excel-reader",
"env": {}
}
}
}
Clone the repository:
git clone https://github.com/ArchimdesCrypto/mcp-excel-reader.git
cd mcp-excel-reader
Install dependencies:
npm install
Build the project:
npm run build
The Excel Reader provides a single tool read_excel
with the following parameters:
interface ReadExcelArgs {
filePath: string; // Path to Excel file
sheetName?: string; // Optional sheet name (defaults to first sheet)
startRow?: number; // Optional starting row for pagination
maxRows?: number; // Optional maximum rows to read
}
// Response format
interface ExcelResponse {
fileName: string;
totalSheets: number;
currentSheet: {
name: string;
totalRows: number;
totalColumns: number;
chunk: {
rowStart: number;
rowEnd: number;
columns: string[];
data: Record<string, any>[];
};
hasMore: boolean;
nextChunk?: {
rowStart: number;
columns: string[];
};
};
}
When used with Claude or another MCP-compatible AI:
Read the Excel file at path/to/file.xlsx
The AI will use the tool to read the file, automatically handling chunking for large files.
Provides metadata for pagination
Sheet Selection
Defaults to first sheet if not specified
Row Pagination
Get next chunk information for continuous reading
Error Handling
The Excel Reader is built on SheetJS and can be extended with its powerful features:
Formula Handling
// Enable formula parsing
const wb = XLSX.read(data, {
cellFormula: true,
cellNF: true
});
Cell Formatting
// Access cell styles and formatting
const styles = Object.keys(worksheet)
.filter(key => key[0] !== '!')
.map(key => ({
cell: key,
style: worksheet[key].s
}));
Data Validation
// Access data validation rules
const validation = worksheet['!dataValidation'];
Sheet Features
worksheet['!merges']
worksheet['!rows']
, worksheet['!cols']
worksheet['!protect']
For more features and detailed documentation, visit the SheetJS Documentation.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
[
{
"description": "Read an Excel file and return its contents as structured data",
"inputSchema": {
"properties": {
"filePath": {
"description": "Path to the Excel file to read",
"type": "string"
},
"maxRows": {
"description": "Maximum number of rows to read (optional)",
"type": "number"
},
"sheetName": {
"description": "Name of the sheet to read (optional)",
"type": "string"
},
"startRow": {
"description": "Starting row index (optional)",
"type": "number"
}
},
"required": [
"filePath"
],
"type": "object"
},
"name": "read_excel"
}
]