mcp-xlsx
v1.0.3
Published
MCP server for reading and writing Excel (xlsx) files
Maintainers
Readme
mcp-xlsx
An MCP (Model Context Protocol) server for reading and writing Excel (.xlsx) files. This server enables AI assistants like CodeBuddy to interact with Excel spreadsheets.
Features
- Read Excel files: Parse .xlsx files and return data as JSON
- Write Excel files: Create .xlsx files from JSON data
- Sheet selection: Read specific sheets or all sheets at once
- Simple integration: Works with any MCP-compatible client
Installation
npm install -g mcp-xlsxOr use directly with npx:
npx mcp-xlsxUsage with CodeBuddy
Add the following configuration to your CodeBuddy MCP settings:
{
"mcpServers": {
"mcp-xlsx": {
"command": "npx",
"args": [
"-y",
"mcp-xlsx"
]
}
}
}Available Tools
read_xlsx
Read an Excel file and return its contents as JSON.
Parameters:
filePath(required): The absolute path to the Excel filesheet(optional): Sheet name or index (1-based) to read. Defaults to first sheetallSheets(optional): If true, reads all sheets and returns as object with sheet names as keys
Example:
{
"filePath": "/path/to/file.xlsx",
"sheet": "Sheet1"
}Response:
[
{"Name": "John", "Age": 30, "City": "New York"},
{"Name": "Jane", "Age": 25, "City": "Los Angeles"}
]write_xlsx
Write JSON data to an Excel file.
Parameters:
filePath(required): The absolute path where the Excel file should be saveddata(required): Array of objects representing rows (keys become column headers)sheetName(optional): Name of the sheet. Defaults to "Sheet1"
Example:
{
"filePath": "/path/to/output.xlsx",
"data": [
{"Name": "John", "Age": 30},
{"Name": "Jane", "Age": 25}
],
"sheetName": "Employees"
}Development
Build from source
git clone https://github.com/Guxi11/mcp-xlsx.git
cd mcp-xlsx
npm install
npm run buildRun locally
npm startDependencies
- @modelcontextprotocol/sdk - MCP SDK
- xlsx - Excel file writing
- read-excel-file - Excel file reading
License
MIT
