Skip to main content

MCP Server for reading and writing Excel files with embedded image extraction. The first MCP that lets AI agents SEE images inside your spreadsheets.

Project description

๐Ÿ“Š Excel Vision MCP

The first MCP server that lets AI agents see images inside your spreadsheets.

Read and write Excel files with full content extraction โ€” cell data, formulas, merged cells, and embedded images โ€” all returned as multimodal content your AI can actually understand.

Python 3.11+ License: MIT MCP PyPI

Installation ยท Tools ยท Configuration ยท How It Works ยท FAQ


๐Ÿค” The Problem

You ask your AI assistant to analyze an Excel document. It reads the text just fine โ€” but completely misses the diagrams, screenshots, and charts embedded in the file. That's because every existing Excel MCP server ignores images.

Excel MCP Server fixes this. It extracts embedded images, optimizes them, and returns them as native ImageContent that vision-capable AI models can see and analyze โ€” alongside all the text data.

โœจ Key Features

Feature Description
๐Ÿ–ผ๏ธ Image Extraction Extracts all embedded images with cell-position mapping
๐Ÿ“„ Full Content Reading Text + images in a single call โ€” nothing is missed
๐Ÿท๏ธ Format-Aware Reading Reports bold, strikethrough, highlights and font colors so agents read intent, not just text
๐Ÿ™ˆ Hidden-Content Aware Skips hidden rows/columns by default, keeping those formulas depend on
โœ๏ธ Write Support Create workbooks, update cells, write formulas, insert images
๐ŸŽจ Formatting Colors, fonts, borders, alignment, number formats, auto-fit columns
๐Ÿ›ก๏ธ Atomic Saves A failed write can never corrupt your original file
๐Ÿ“Š Smart Pagination Handles massive spreadsheets without blowing up context
๐Ÿ” Text Search Find content across all sheets instantly
๐Ÿ”’ 100% Local Your files never leave your machine
โšก Fast 16MB file with 40 images processed in ~4 seconds
๐Ÿ–ฅ๏ธ Cross-Platform macOS, Linux, Windows

Image Extraction โ€” What Makes This Different

Most Excel MCP servers only read cell values. This server uses a dual extraction strategy:

  1. Cell-Position Mapping (primary) โ€” Maps each image to its exact cell location using openpyxl-image-loader
  2. Archive Scanning (fallback) โ€” Scans the xlsx ZIP archive's xl/media/ directory to catch any images missed by method 1

The result: zero images left behind, with position metadata when available.


๐Ÿš€ Quick Start

Install via uvx (Recommended)

No installation needed โ€” runs directly:

uvx excel-vision-mcp

Install via pip

pip install excel-vision-mcp

Then run:

excel-vision-mcp

Install from source

git clone https://github.com/VOYAGER-Inc/excel-vision-mcp.git
cd excel-vision-mcp
uv sync
uv run excel-vision-mcp

๐Ÿ”ง Configuration

Add the server to your MCP client's configuration file.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

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

Cursor

Edit .cursor/mcp.json in your project root:

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

Windsurf / VS Code (Copilot)

Edit your MCP settings file:

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

Antigravity IDE

Edit ~/.gemini/config/mcp_config.json:

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

Note: After editing the config, restart your IDE/client to load the new server.

Restricting file access (optional)

By default the server can read/write any Excel file your user account can access. To sandbox it to specific directories, set EXCEL_VISION_MCP_ALLOWED_DIRS (multiple paths separated by : on macOS/Linux, ; on Windows):

{
  "mcpServers": {
    "excel-reader": {
      "command": "uvx",
      "args": ["excel-vision-mcp"],
      "env": {
        "EXCEL_VISION_MCP_ALLOWED_DIRS": "/Users/me/Documents/spreadsheets:/Users/me/Projects/data"
      }
    }
  }
}

๐Ÿ› ๏ธ Available Tools

list_sheets

List all sheets with dimensions, merged cell counts, and image totals. Use this first to understand a workbook's structure.

list_sheets(file_path="/path/to/file.xlsx")

Returns: Sheet names, rowร—column dimensions, data ranges, merged cell counts, total image count.


read_excel_data

Read cell data from a specific sheet with pagination support.

read_excel_data(
    file_path="/path/to/file.xlsx",
    sheet_name="Sheet1",      # optional, defaults to first sheet
    start_row=1,              # optional, 1-indexed
    max_rows=200,             # optional, default 200
    include_hidden=False      # optional, read hidden rows/columns too
)

Returns: Cell values organized by row with coordinate labels and markers for merged cells and formatting.

Row 1: A1: Feature [B] [HL:blue] | B1: Status [B] [HL:blue]
Row 3: A3: Legacy export [S] | B3: Cancelled [S]
Row 4: A4: Report | B4: Needs review [HL:yellow] | C4: Urgent [B] [C:red]
Marker Meaning
[M] Merged cell
[B] [I] [S] Bold ยท Italic ยท Strikethrough
[HL:color] Highlighted background (color named, e.g. yellow, red)
[C:color] Font color
[HIDDEN-REF] Hidden cell kept because a visible formula references it

Markers and a short legend appear only on sheets that actually use formatting, so plain sheets cost no extra context.


extract_images

Extract all embedded images from the workbook as base64 ImageContent.

extract_images(
    file_path="/path/to/file.xlsx",
    sheet_name="Overview",    # optional, None = all sheets
    max_width=1024,           # optional, resize limit
    max_height=1024           # optional, resize limit
)

Returns: List of ImageContent (base64) with metadata โ€” cell position, sheet name, original dimensions.


read_full_content โญ

The star tool. Reads ALL text data AND all embedded images in a single call. Ideal for comprehensive document analysis.

read_full_content(
    file_path="/path/to/file.xlsx",
    max_rows_per_sheet=500,   # optional
    max_image_width=1024,     # optional
    max_image_height=1024     # optional
)

Returns: Complete workbook contents โ€” every sheet's data as structured text (with formatting markers), followed by every embedded image with cell-position mapping.

Example use case: "Analyze this requirements document and summarize all use cases, including the workflow diagrams."


Hidden rows & columns

All read tools skip hidden rows and columns by default โ€” an author who hid them signalled they aren't part of the content to review.

One exception: a hidden cell that a visible formula references is still returned, marked [HIDDEN-REF], because its value drives results you can see. Skipped content is always reported so nothing disappears silently:

โ„น๏ธ Skipped 2 hidden row(s) with content. 1 hidden cell(s) are shown anyway
   because visible formulas reference them. Pass include_hidden=true to read them.

Pass include_hidden=true to read_excel_data, read_full_content, or search_excel to read everything.


get_workbook_overview

Quick structural summary of a workbook โ€” file size, sheet list, dimensions, image count.

get_workbook_overview(file_path="/path/to/file.xlsx")

search_excel

Case-insensitive text search across all cells in the workbook.

search_excel(
    file_path="/path/to/file.xlsx",
    query="revenue",
    sheet_name="Q4 Report"    # optional, None = all sheets
)

Returns: Matching cells with sheet name, coordinate, and value. Limited to 100 results.


create_excel_file

Create a new empty workbook with the sheets you name.

create_excel_file(
    file_path="/path/to/new.xlsx",
    sheet_names=["Summary", "Detail"],  # optional, default ["Sheet1"]
    overwrite=False                     # optional, refuses to replace by default
)

add_excel_sheet

Add a new empty sheet to an existing workbook.

add_excel_sheet(file_path="/path/to/file.xlsx", sheet_name="Q3", position=0)

update_excel_cells

Set individual cells by coordinate. Values starting with = are written as formulas.

update_excel_cells(
    file_path="/path/to/file.xlsx",
    updates={"A1": "Title", "B2": 42, "C2": "=SUM(B2:B10)"},
    sheet_name="Data"             # optional, defaults to first sheet
)

Note: newly written formulas show no calculated value until the file is opened in Excel. For merged ranges, write to the top-left anchor cell.


write_excel_rows

Write a rectangular block of tabular data in one call.

write_excel_rows(
    file_path="/path/to/file.xlsx",
    rows=[["Item", "Qty"], ["Widget", 4], ["Gadget", 7]],
    sheet_name="Data",            # optional
    start_cell="A1"               # optional
)

insert_excel_image

Insert a local image file into a workbook, anchored at a cell.

insert_excel_image(
    file_path="/path/to/file.xlsx",
    image_path="/path/to/chart.png",
    cell="B2",
    sheet_name="Report",          # optional
    width=480, height=320         # optional display size in px
)

format_excel_cells

Style a range: font, colors, borders, alignment, number formats. Only the attributes you pass are changed โ€” existing styling is preserved.

format_excel_cells(
    file_path="/path/to/file.xlsx",
    cell_range="A1:D1",
    bold=True,
    font_color="FFFFFF",
    fill_color="4472C4",
    horizontal_align="center",
    border_style="thin",          # thin | medium | thick | double | dashed | dotted
    border_edges="all",           # "all" or "outline" (outer edge of range only)
    number_format="#,##0.00"      # any Excel format code
)

set_excel_column_widths

Set column widths manually and/or auto-fit to content.

set_excel_column_widths(
    file_path="/path/to/file.xlsx",
    widths={"A": 12, "B": 35},    # explicit widths (skipped by auto-fit)
    auto_fit=True,                # size remaining columns to content
    max_width=60,                 # cap for auto-fit
    wrap_overflow=True            # wrap cells longer than the cap
)

Auto-fit counts full-width CJK characters (ๆ—ฅๆœฌ่ชž) as 2 units. Cells longer than max_width get wrap text enabled instead of stretching the column โ€” Excel auto-expands their row heights on open.


All write tools use atomic saves: the workbook is written to a temp file and swapped into place, so a failed save never corrupts your original. .xlsm macros are preserved. Known openpyxl limitation: pivot tables and some complex chart features are not preserved on re-save.


โš™๏ธ How It Works

Architecture

Your AI Client (Claude, Cursor, etc.)
       โ”‚
       โ”‚ stdio (JSON-RPC)
       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚     Excel MCP Server        โ”‚
โ”‚                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   openpyxl            โ”‚  โ”‚โ”€โ”€โ†’ Cell data, formulas, merged cells
โ”‚  โ”‚   (Excel parser)      โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ openpyxl-image-loader โ”‚  โ”‚โ”€โ”€โ†’ Images with cell positions
โ”‚  โ”‚ + zipfile (fallback)  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   Pillow              โ”‚  โ”‚โ”€โ”€โ†’ Resize, optimize, base64 encode
โ”‚  โ”‚   (image processing)  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚
       โ”‚ TextContent + ImageContent
       โ–ผ
  AI sees text AND images

Data Flow & Privacy

  1. Your file stays on your machine. The server runs locally via stdio โ€” no network requests, no uploads, no cloud.
  2. Read tools never modify your files. All image processing happens in-memory (BytesIO buffers). Write tools change only the exact file you specify, via atomic saves (temp file + swap) that can never leave a half-written workbook.
  3. Optional directory sandbox. Set EXCEL_VISION_MCP_ALLOWED_DIRS (path-separator-separated list) to restrict which directories the server may read or write. Unset = no restriction.
  4. Memory is freed automatically. After each request, Python's garbage collector reclaims all buffers.

Image Processing Pipeline

Original image in .xlsx (e.g., 2048ร—1536px PNG)
  โ†“ Extract from ZIP archive / drawing layer
  โ†“ Resize to fit max dimensions (default 1024px)
  โ†“ Compress (JPEG 80% / PNG optimized)
  โ†“ Base64 encode
  โ†’ ImageContent returned to AI client (~100-300KB per image)

๐Ÿ“‹ Supported Formats

Format Status Notes
.xlsx โœ… Fully supported Excel 2007+ Open XML
.xlsm โœ… Fully supported Macro-enabled workbooks
.xls โŒ Not supported Legacy Excel 97-2003 format
.csv โŒ Not supported Use a CSV-specific tool

Image Types

Image Type Cell-Mapped Archive Extraction
PNG โœ… โœ…
JPEG โœ… โœ…
GIF โœ… โœ…
BMP โœ… โœ…
TIFF โš ๏ธ Partial โœ…
EMF/WMF โŒ โœ…
=IMAGE() formula โŒ โŒ
Images in comments โŒ โŒ

๐Ÿ“Š Performance

Tested on real-world enterprise Excel files (macOS, Apple Silicon):

File Size Sheets Images Extracted Time
Requirements Doc A 4.5 MB 12 24 2.4s
Requirements Doc B 5.0 MB 6 18 2.4s
Requirements Doc C 10.7 MB 6 13 1.5s
Master Spec 16.0 MB 12 40 4.4s

โ“ FAQ

Why can't it extract images from .xls files?

.xls is the legacy binary format (Excel 97-2003). It uses a completely different internal structure (BIFF) compared to .xlsx (ZIP-based Open XML). The libraries used (openpyxl, openpyxl-image-loader) only support the modern Open XML format. If you have .xls files, convert them to .xlsx using Excel or LibreOffice first.

Why are some images marked as "orphan"?

The primary extraction method (openpyxl-image-loader) maps images to specific cells but may miss images that aren't anchored to the standard drawing layer. The fallback archive scanner catches these "orphan" images from the xl/media/ directory โ€” you get every image, just without cell-position metadata for orphans.

Can I use this with models that don't support vision?

Yes! Text data extraction works perfectly with any model. Image extraction will still return ImageContent, but text-only models will simply ignore the image data. You won't get errors.

Is my data safe?

Yes. The server runs entirely on your local machine via stdio transport. No data is sent over the network and no files are uploaded anywhere. Read tools never modify your files; write tools change only the file you explicitly target, using atomic saves so a failed write can't corrupt it. You can also sandbox the server to specific directories with the EXCEL_VISION_MCP_ALLOWED_DIRS environment variable.

How do I handle very large files (100MB+)?

The server uses read_only mode for data iteration and processes images in-memory one at a time. For extremely large files, use read_excel_data with pagination (start_row + max_rows) instead of read_full_content to control memory usage.


๐Ÿ—บ๏ธ Roadmap

  • Write support โ€” Create workbooks, update cells, write formulas, insert images (v1.1.0)
  • Format-aware reading โ€” Bold, strikethrough, highlights, colors; hidden-content handling (v1.2.0)
  • Formula evaluation โ€” Show formulas alongside their calculated values
  • CSV/TSV support โ€” Extend to other tabular formats
  • Conditional formatting โ€” Extract formatting rules
  • Chart extraction โ€” Render charts as images

๐Ÿค Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

git clone https://github.com/VOYAGER-Inc/excel-vision-mcp.git
cd excel-vision-mcp
uv sync
uv run pytest  # Run the test suite

๐Ÿ“„ License

MIT โ€” use it however you want.


Built for AI agents that need to see the whole picture, not just the text.

โญ Star this repo if it helped you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excel_vision_mcp-1.2.0.tar.gz (96.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

excel_vision_mcp-1.2.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file excel_vision_mcp-1.2.0.tar.gz.

File metadata

  • Download URL: excel_vision_mcp-1.2.0.tar.gz
  • Upload date:
  • Size: 96.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for excel_vision_mcp-1.2.0.tar.gz
Algorithm Hash digest
SHA256 125ee5be0534a27a2d1b760fc3513c17bcbd1fbe027a21ad043755849e7e3d4c
MD5 478235a2acf2bc9173606c525a4887de
BLAKE2b-256 4980119e90ac0f7053e4e3e850e8e66bab7400070874d2911a69a5b0626bc69a

See more details on using hashes here.

Provenance

The following attestation bundles were made for excel_vision_mcp-1.2.0.tar.gz:

Publisher: publish.yml on VOYAGER-Inc/excel-vision-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file excel_vision_mcp-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for excel_vision_mcp-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72ac99b6a84632bf9be19aad79a1984f0d70fb06e19b861782950c3b07f05fd7
MD5 56f7460f90935b9aaa2272ebaf79f393
BLAKE2b-256 bfe700fb59072380ae54ae4bdc59d6ffd5db80471b852e8211a1b5a29922cd93

See more details on using hashes here.

Provenance

The following attestation bundles were made for excel_vision_mcp-1.2.0-py3-none-any.whl:

Publisher: publish.yml on VOYAGER-Inc/excel-vision-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page