Excel MCP Server

Excel MCP Server

Enables AI assistants to perform Excel file operations (create, read, write, format) without requiring Microsoft Excel installation.

Category
访问服务器

README

Excel MCP Server

A comprehensive Model Context Protocol (MCP) server that enables AI assistants to perform Excel file operations without requiring Microsoft Excel installation.

smithery badge Python Version License: MIT Tests MCP

Why This Server?

Feature Excel MCP Server Alternatives
No Excel Required ✅ Pure Python (openpyxl) ❌ Requires MS Office
Cross-Platform ✅ Windows, Mac, Linux ⚠️ Limited
Type Safety ✅ Full Pydantic validation ❌ No validation
Formatting Support ✅ Fonts, colors, borders ⚠️ Basic only
Formula Support ✅ Full Excel formulas ⚠️ Limited
MCP Protocol ✅ Native support ❌ Custom protocols
Remote Deploy ✅ Smithery ready ❌ Local only

Features

  • 📊 Workbook Management: Create, open, save Excel workbooks
  • 📄 Sheet Operations: Create, delete, rename, copy worksheets
  • 📝 Cell Operations: Read and write individual cells or ranges
  • 🔢 Formula Support: Write and evaluate Excel formulas
  • 🎨 Rich Formatting: Fonts, colors, borders, alignment, number formats
  • ✅ Type-safe operations with Pydantic validation
  • ✅ Well-tested with 17 tests

Installation

🚀 Smithery (Recommended)

Deploy globally and share with anyone - no installation required!

{
  "mcpServers": {
    "excel": {
      "url": "https://server.smithery.ai/@mort-lab/excel-mcp/mcp"
    }
  }
}

💻 Local Installation

# Using uvx (recommended)
uvx excel-mcp-server

# Using pip
pip install excel-mcp-server

# From source
git clone https://github.com/mort-lab/excel-mcp
cd excel-mcp
uv sync

Quick Start

Add to your Claude Desktop config:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "excel": {
      "command": "uvx",
      "args": ["excel-mcp-server"]
    }
  }
}

Restart Claude Desktop and start using Excel operations!

Example Usage

"Create a new Excel workbook called sales_report.xlsx"
"Write 'Product' to cell A1 in Sheet1"
"Format the header row with bold text and blue background"
"Add a formula in D2 that multiplies B2 and C2"
"Read the data from range A1:D10"

Connect with the Author

LinkedIn

Let's connect on LinkedIn!

I'm Martin Irurozki, a fullstack developer passionate about AI automation, building intelligent tools, and creating real-world solutions that make a difference. If you:

  • 🚀 Want to discuss MCP servers, AI integrations, and automation
  • 💡 Have ideas for new features or real-world use cases
  • 🤝 Are interested in collaboration opportunities
  • 🛠️ Build tools and solutions with AI
  • 🌟 Just want to connect and network with fellow developers

Connect with me on LinkedIn →

I'd love to hear about your projects and how this Excel MCP server is helping you build amazing things!


Available Tools

The server provides 20 MCP tools across 4 categories:

Workbook Operations (3 tools)

  • create_workbook(file_path) - Create a new Excel workbook
  • get_workbook_info(file_path) - Get workbook metadata
  • list_sheets(file_path) - List all worksheet names

Sheet Operations (4 tools)

  • create_sheet(workbook_path, sheet_name, index?) - Create a new worksheet
  • delete_sheet(workbook_path, sheet_name) - Delete a worksheet
  • rename_sheet(workbook_path, old_name, new_name) - Rename a worksheet
  • copy_sheet(workbook_path, source_sheet, new_name) - Copy a worksheet

Cell Operations (5 tools)

  • write_cell(workbook_path, sheet_name, cell, value) - Write to a cell
  • read_cell(workbook_path, sheet_name, cell) - Read from a cell
  • write_range(workbook_path, sheet_name, start_cell, data) - Write data to a range
  • read_range(workbook_path, sheet_name, range_ref) - Read data from a range
  • write_formula(workbook_path, sheet_name, cell, formula) - Write a formula

Formatting Operations (8 tools)

  • format_font(...) - Apply font formatting (bold, italic, color, size)
  • format_fill(...) - Apply background color
  • format_border(...) - Apply cell borders
  • format_alignment(...) - Apply text alignment
  • format_number(...) - Apply number formatting

Real-World Use Cases

📊 Automated Reporting

Generate monthly sales reports automatically with formatted data, calculations, and professional styling ready to share with stakeholders.

📈 Data Analysis

Import and transform data, apply statistical functions (SUM, AVERAGE, STDEV), create summary tables, and export results.

🎨 Invoice Generation

Create professional invoices with custom formatting, company branding, automatic calculations, and formula-driven totals.

📋 Inventory Management

Track stock levels with real-time updates, conditional formatting for alerts, and automated reorder calculations.

📑 Data Migration

Read from old Excel files, clean and transform data, apply new formatting standards, and export to new structure.

Examples

Example 1: Formatted Sales Report

Ask Claude:

Create a sales report in sales_2024.xlsx with:
1. Headers: Date, Product, Quantity, Price, Total
2. Format headers: Bold, white text, blue background (#4472C4)
3. Add 10 sample sales entries with realistic data
4. Total column formula: =C2*D2 (for each row)
5. Format prices as currency: $#,##0.00
6. Add borders around all cells (thin, black)
7. Center-align all headers
8. Sum total sales in the last row with bold formatting

Result: Professional report with automatic calculations, fully formatted and ready to share.

Example 2: Multi-Sheet Workbook

Ask Claude:

Create quarterly_report.xlsx with 5 sheets:
- Sheets: Q1, Q2, Q3, Q4, Summary
- Each Q sheet has: Month, Revenue, Expenses, Profit
- Add 3 months of data per quarter
- Profit formula: =B2-C2
- Summary sheet with formulas that sum all quarters
- Format all currency values as $#,##0.00

Result: Complex multi-sheet workbook with cross-sheet formulas and comprehensive business report.

Example 3: Data Migration

Ask Claude:

Read data from old_data.xlsx sheet 'Sales' range A1:E100,
then create new_data.xlsx with:
- Same data but sorted by date (column A)
- Add a new column F with 10% markup calculation (=E*1.1)
- Format dates as 'mm/dd/yyyy'
- Format currency columns as $#,##0.00
- Add bold headers with blue background

Result: Clean data migration enhanced with calculations and professional formatting.

Development

Setup

# Clone and install
git clone https://github.com/mort-lab/excel-mcp
cd excel-mcp
uv sync

# Run tests
uv run pytest

# Run with coverage
uv run pytest --cov=excel_mcp_server

# Lint and format
uv run ruff check
uv run ruff format

Project Structure

excel-mcp-server/
├── src/excel_mcp_server/
│   ├── server.py              # FastMCP server (local)
│   ├── server_smithery.py     # Smithery-compatible server
│   ├── models.py              # Pydantic validation models
│   ├── operations/            # Business logic
│   │   ├── workbook.py
│   │   ├── cell.py
│   │   ├── sheet.py
│   │   └── formatting.py
│   └── utils/
│       └── validators.py
├── tests/                     # Test suite (17 tests)
└── pyproject.toml             # Project configuration

Performance

  • Fast: Handles workbooks up to 10,000 rows efficiently
  • Memory: ~50MB for typical operations
  • Lightweight: No Excel installation required
Operation Time Notes
Create workbook ~50ms Empty workbook
Write 100 cells ~200ms Individual writes
Write 100 cells (range) ~50ms Bulk operation
Read 1000 cells ~300ms From existing file
Apply formatting ~100ms Per range

Limitations

  • ❌ No chart/graph support (coming soon)
  • ❌ No pivot tables (roadmap)
  • ❌ No VBA macros (intentional - pure Python)
  • ⚠️ File size limit: 100MB recommended

FAQ

Can I use this with Google Sheets? No, this server works exclusively with Excel (.xlsx) files.

Does it work offline? Yes! When installed locally, it works completely offline.

What Excel features are supported?

  • ✅ Formulas (SUM, AVERAGE, IF, VLOOKUP, COUNT, etc.)
  • ✅ Formatting (fonts, colors, borders, alignment, number formats)
  • ✅ Multiple sheets and workbooks
  • ✅ Cell ranges and bulk operations
  • ✅ Formula references across sheets
  • ❌ Charts and graphs (roadmap)
  • ❌ Pivot tables (roadmap)
  • ❌ Macros/VBA (not planned - security)

How large can my Excel files be? Recommended: Up to 100MB or ~50,000 rows for optimal performance.

Can I use this in production? Yes! The server is tested and stable. Consider using Smithery for deployment and scaling.

Troubleshooting

Import Errors

uv sync

Permission Errors

# Check permissions
ls -la /path/to/directory

# Fix permissions (Unix/Mac)
chmod u+w /path/to/directory

File Already Exists When creating a workbook, if the file already exists, the operation will fail. Delete the existing file or use a different filename.

Contributing

Contributions are welcome! Here's how:

Development Workflow:

  1. Fork & clone the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Make changes with tests
  4. Run tests: uv run pytest
  5. Run linting: uv run ruff check
  6. Commit: git commit -m 'feat: Add amazing feature'
  7. Push & create Pull Request

Commit Convention: We use Conventional Commits:

  • feat: New features
  • fix: Bug fixes
  • docs: Documentation
  • test: Adding tests
  • refactor: Code refactoring

Roadmap

v0.2.0 (Next Release)

  • Chart and graph creation
  • Data validation rules
  • Conditional formatting
  • Image insertion

v0.3.0

  • Pivot table operations
  • Cell comments and notes
  • Protected sheets
  • Named ranges

v1.0.0

  • CSV import/export
  • PDF export
  • Template system
  • 80%+ test coverage

Support

License

This project is licensed under the MIT License.

Acknowledgments


Made with ❤️ by Martin Irurozki

Empowering AI assistants to work with Excel files, one cell at a time.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选