excel-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@excel-mcp-serverread the sales data from report.xlsx"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Excel MCP Server
A comprehensive Model Context Protocol (MCP) server that provides Excel file manipulation capabilities. This project includes both a standalone Excel library and an MCP server that exposes Excel operations as tools for AI assistants like Claude.
โจ Features
๐ Excel Operations
Read Excel Files: Extract data from .xlsx and .xls files with range and sheet selection
Write Excel Files: Create new Excel files with structured data and headers
Worksheet Management: Add, remove, and manage multiple worksheets
Cell Operations: Update individual cells and ranges with values or formulas
Formula Support: Apply and calculate Excel formulas including cross-sheet references
Formatting: Apply styling, fonts, colors, and advanced formatting options
Charts: Create various chart types (line, bar, pie, scatter) with customization
๐ง MCP Integration
FastMCP Server: High-performance MCP server implementation using the official MCP SDK
Resource Endpoints: Built-in help documentation and usage examples
Tool Definitions: All Excel operations exposed as MCP tools with full type hints
Error Handling: Comprehensive error reporting and logging throughout
Related MCP server: ironcalc-mcp
๐ Quick Start
Prerequisites
Python 3.8 or higher
pip package manager
Installation
Clone the repository:
git clone https://github.com/amanarneja/XSpreadsheet.git cd XSpreadsheetCreate a virtual environment:
python -m venv venvActivate the virtual environment:
# Windows venv\Scripts\activate # macOS/Linux source venv/bin/activateInstall dependencies:
pip install -r requirements.txt
Usage
Running the MCP Server
cd src/excel_mcp_server
python server.pyThe server will start and listen for MCP protocol messages on standard input/output.
Using the Excel Library
from src.excel_mcp_server.excel_library import ExcelLibrary
# Initialize the library
excel_lib = ExcelLibrary()
# Read an Excel file
data = excel_lib.read_excel_file("example.xlsx", "Sheet1")
# Write data to Excel
excel_lib.write_excel_file("output.xlsx", [
["Name", "Age", "City"],
["John", 30, "New York"],
["Jane", 25, "Boston"]
], headers=["Name", "Age", "City"])Available MCP Tools
Core Operations
read_excel_fileRead data from Excel files
Parameters:
file_path,sheet_name(optional),range(optional)
write_excel_fileWrite data to Excel files
Parameters:
file_path,data,sheet_name(optional),headers(optional)
get_worksheet_infoGet information about worksheets
Parameters:
file_path
Worksheet Management
add_worksheetAdd new worksheets
Parameters:
file_path,sheet_name
Cell Operations
update_cellUpdate specific cells
Parameters:
file_path,sheet_name,cell,value
apply_formulaApply Excel formulas
Parameters:
file_path,sheet_name,cell,formula
Formatting and Charts
format_cellsApply cell formatting
Parameters:
file_path,sheet_name,range,format_options
create_chartCreate charts and graphs
Parameters:
file_path,sheet_name,data_range,chart_type,title(optional),position(optional)
MCP Resources
excel://help- Comprehensive help documentationexcel://examples- Usage examples and code snippets
Configuration
VS Code Integration
The project includes VS Code configuration for MCP debugging:
{
"servers": {
"excel-mcp-server": {
"type": "stdio",
"command": "python",
"args": ["src/excel_mcp_server/server.py"]
}
}
}Claude Desktop Integration
To use with Claude Desktop, add this to your claude_desktop_config.json:
{
"mcpServers": {
"excel-mcp-server": {
"command": "python",
"args": ["path/to/XSpreadsheet/src/excel_mcp_server/server.py"],
"cwd": "path/to/XSpreadsheet"
}
}
}Windows example:
{
"mcpServers": {
"excel-mcp-server": {
"command": "python",
"args": ["C:\\projects\\XSpreadsheet\\src\\excel_mcp_server\\server.py"],
"cwd": "C:\\projects\\XSpreadsheet"
}
}
}Alternative: Module Execution
{
"mcpServers": {
"excel-mcp-server": {
"command": "python",
"args": ["-m", "src.excel_mcp_server.server"],
"cwd": "path/to/XSpreadsheet"
}
}
}Project Structure
Xpreadsheet/
โโโ src/
โ โโโ excel_mcp_server/
โ โโโ __init__.py
โ โโโ server.py # MCP Server implementation
โ โโโ excel_library.py # Core Excel functionality
โโโ .vscode/
โ โโโ mcp.json # VS Code MCP configuration
โโโ .github/
โ โโโ copilot-instructions.md # Copilot development guidelines
โโโ requirements.txt # Python dependencies
โโโ README.md # This fileDependencies
mcp: Model Context Protocol SDK
openpyxl: Excel file manipulation
pandas: Data processing and analysis
anyio: Async I/O support
Development
Adding New Features
Excel Library: Add new methods to
excel_library.pyMCP Tools: Expose new methods as MCP tools in
server.pyDocumentation: Update help resources and README
๐งช Testing & Demo
Run the Demo
python demo.pyThis creates sample Excel files demonstrating all features.
Verify Installation
python verify.pyTest Individual Components
# Test the Excel library
python -c "from src.excel_mcp_server.excel_library import ExcelLibrary; print('โ
Library works!')"
# Test the MCP server (press Ctrl+C to stop)
python src/excel_mcp_server/server.py๐ Usage Examples
Reading Excel Data with Claude
Once configured, you can ask Claude:
"Read the data from my sales.xlsx file, sheet called 'Q1 Data', range A1:D10"
Claude will use the read_excel_file tool:
{
"file_path": "sales.xlsx",
"sheet_name": "Q1 Data",
"range": "A1:D10"
}Creating Charts with Claude
"Create a line chart from my data.xlsx file showing the sales trend. Use data from A1:B12 on the 'Sales' sheet"
Claude will use the create_chart tool:
{
"file_path": "data.xlsx",
"sheet_name": "Sales",
"data_range": "A1:B12",
"chart_type": "line",
"title": "Sales Trend"
}Writing Excel Files
"Create a new Excel file called 'report.xlsx' with this data: [['Name', 'Score'], ['Alice', 95], ['Bob', 87]]"
Claude will use the write_excel_file tool:
{
"file_path": "report.xlsx",
"data": [["Alice", 95], ["Bob", 87]],
"headers": ["Name", "Score"]
}๐ค Contributing
We welcome contributions! Here's how to get started:
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/amanarneja/XSpreadsheet.gitCreate a feature branch:
git checkout -b feature/amazing-featureMake your changes and add tests
Run the verification:
python verify.py python demo.pyCommit your changes:
git commit -m "Add amazing feature"Push to your branch:
git push origin feature/amazing-featureOpen a Pull Request on GitHub
Development Guidelines
Follow the existing code style and patterns
Add type hints to all functions
Include docstrings for new methods
Update tests and documentation
Ensure all demo scripts still work
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support & Resources
Issues: GitHub Issues
MCP Documentation: Model Context Protocol
Claude Desktop: Anthropic Claude
Excel Library: Built with openpyxl
๐ Acknowledgments
Built using the Model Context Protocol (MCP)
Excel manipulation powered by openpyxl
Data processing with pandas
๐ Ready to supercharge your Excel workflows with AI? Get started today!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to perform comprehensive Microsoft Excel operations including data analysis, cell editing, advanced formatting, and VBA execution on Windows systems. It provides a structured workflow for managing workbooks and worksheets through a dedicated Model Context Protocol interface.51834MIT
- AlicenseAqualityCmaintenanceEnables AI agents to directly create, read, edit, and save Excel (.xlsx) spreadsheets using natural language through the Model Context Protocol, supporting cells, sheets, formatting, and formulas without writing Python code.215MIT
- FlicenseBqualityDmaintenanceEnables Excel automation via natural language, providing session-based workbook management, data manipulation, formulas, charts, and formatting through the Model Context Protocol.29
- AlicenseBqualityDmaintenanceEnables AI assistants to perform Excel file operations (create, read, write, format) without requiring Microsoft Excel installation.175MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโฆ
A Model Context Protocol server for Wix AI tools
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/amanarneja/XSpreadsheet'
If you have feedback or need assistance with the MCP directory API, please join our Discord server