# xlsx-tools-mcp

> xlsx-tools-mcp is an open-source MCP server for files and documents. Read and edit Excel files from an AI agent while keeping styles, formulas and merges. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux
- **Repository:** https://github.com/ruriazz/xlsx-tools-mcp
- **MCP Registry name:** io.github.ruriazz/xlsx-tools-mcp
- **Categories:** [files and documents](https://ai-powered.com/categories/files-and-documents), [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-23

## About

Editing a spreadsheet through an agent often wrecks what it did not touch. This server loads the existing workbook with openpyxl, changes only what was asked and saves it back so styles, merged cells and comments stay. Reads go through python-calamine for speed and type inference, falling back to openpyxl when formulas, styles or comments are needed.

It exposes 29 tools to list sheets, read ranges, search, aggregate and query with pandas, write cells and formulas, add or remove rows and columns, apply styles, build native Excel tables and bar, line, pie or scatter charts, copy and rename sheets and autofit widths. After value or formula writes it runs headless LibreOffice to recompute results and reports any Excel errors such as #REF! or #DIV/0!. The README admits this round trip can alter pivot tables, charts, data validation and some names, so recalculate=False skips it.

Safety features include per-file locks, an allowed-directories fence, automatic .bak backups with a restore tool, a guard against risky formulas such as WEBSERVICE or HYPERLINK, and XML-bomb protection. It runs over stdio from PyPI via uvx and needs Python 3.10 or newer; LibreOffice is optional.

## Features

- **Structure-preserving edits:** Keeps styles, merges and comments the edit does not touch.
- **Formula recalculation:** Headless LibreOffice recomputes values and reports Excel errors.
- **Aggregation and queries:** pandas-based grouping and filtering with expression validation.
- **Tables and charts:** Creates native Excel tables and four chart types.
- **Backups and restore:** Automatic .bak files and a restore tool.
- **Path and formula guards:** Directory allowlist and rejection of exfiltration-prone formulas.

## Good for

- Let an assistant fill a budget workbook without breaking formatting
- Summarise sales data by category from a spreadsheet
- Append rows to a tracker and check for formula errors
- Build a chart inside an existing workbook

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add xlsx-tools-mcp -- uvx xlsx-tools-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add xlsx-tools-mcp -- uvx xlsx-tools-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.xlsx-tools-mcp]
command = "uvx"
args = ["xlsx-tools-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user xlsx-tools-mcp uvx -- xlsx-tools-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "xlsx-tools-mcp": {
      "command": "uvx",
      "args": [
        "xlsx-tools-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 15 tools delete data and 6 change data; 6 names don't say. From the server's own tool labels and tool names; not verified by us.

- `aggregate_sheet`: Group and aggregate sheet data with pandas
- `query_sheet` (name suggests: reads): Query sheet data with validated expressions
- `create_table` (name suggests: changes): Create a formal Excel table with autofilter and styles
- `create_chart` (name suggests: changes): Create a bar, line, pie or scatter chart
- `rename_sheet` (name suggests: changes): Rename a sheet
- `copy_sheet`: Duplicate a sheet with styles intact
- `clear_range`: Clear a range of cells
- `autofit_columns`: Auto-fit column widths
- `restore_backup`: Atomically revert to a backup
- `write_cells` (name suggests: changes): Write values and formulas to cells
- `append_rows`: Append rows to a sheet
- `insert_rows` (name suggests: changes): Insert rows
- `delete_rows` (name suggests: deletes): Delete rows
- `insert_columns` (name suggests: changes): Insert columns
- `delete_columns` (name suggests: deletes): Delete columns

## FAQ

### Does xlsx-tools-mcp need Excel installed?

No. LibreOffice is optional and used only for formula recalculation.

### Can xlsx-tools-mcp overwrite my files safely?

It makes a .bak backup before writes by default and has a restore tool.

### How do I restrict access?

Set XLSX_MCP_ALLOWED_DIRS to the directories it may use.

### How many tools are there?

29.

### Is xlsx-tools-mcp free?

Yes. xlsx-tools-mcp is open source, so you can use and self-host it for free.

### How do I add xlsx-tools-mcp to Claude Code?

Run this command in your terminal: claude mcp add xlsx-tools-mcp -- uvx xlsx-tools-mcp

### What are the best alternatives to xlsx-tools-mcp?

The closest alternatives to xlsx-tools-mcp are Agent-Native Analytics, dashboard-icons, Google Ads + Meta Ads + SEO/GEO MCP, Tapetide - Indian Stock Market MCP and Pitot.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [dashboard-icons](https://ai-powered.com/mcp/dashboard-icons): dashboard-icons is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [Pitot](https://ai-powered.com/mcp/pitot): Pitot is an open-source MCP server for cloud and infrastructure.
- [World Monitor](https://ai-powered.com/mcp/world-monitor): World Monitor is a freemium MCP server for analytics and data.
- [Scholar Sidekick](https://ai-powered.com/mcp/scholar-sidekick): Scholar Sidekick is a freemium MCP server for education and exams.
- [Australian Economic Data (ABS, RBA & APRA)](https://ai-powered.com/mcp/australian-economic-data-abs-rba-and-apra): Australian Economic Data (ABS, RBA & APRA) is an open-source MCP server for analytics and data.

---
Source: https://ai-powered.com/mcp/xlsx-tools-mcp
