Get the FREE Ultimate OpenClaw Setup Guide →

openpyxl

A thin wrapper around the OpenPyXl Python library that exposes some of its features as Model Context Protocol (MCP) server. This allows Claude and other MCP clients to fetch data from Excel files.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jonemo-openpyxl-mcp-server python openpyxl_mcp_server.py

How to use

This MCP server exposes a subset of the OpenPyXL library's capabilities through the Model Context Protocol (MCP). It lets Claude and other MCP clients query Excel files to retrieve data, extract values from cells or ranges, inspect sheet names, and read metadata about workbooks. The server acts as a bridge: you point clients to an Excel file on disk (or accessible path) and use MCP prompts to request the data you need. Typical interactions involve asking for specific cell values, lists of sheet names, or data from a defined range within a sheet, which the server returns in a structured MCP response.

To use it, configure the MCP client to point at this server (for Claude Desktop this means adding an MCP server entry with the command to launch the server). Once running, you can issue natural language prompts that specify the workbook location and the data you want, such as the value in a particular cell, a column or row slice, or the contents of a sheet. The server translates这些 requests into OpenPyXL operations behind the scenes and returns the results in a format suitable for MCP-based agents to present to users. If you are developing or debugging, you can test prompts that request sheet names, a range like A1:C10, or the value of a single cell, and verify the responses align with the Excel data.

How to install

Prerequisites:

  • Python 3.8+ (recommended 3.9–3.11) and pip
  • Access to a machine where you can run Python scripts
  • Optional: a local copy of the repository if you want to run from source

From Source (recommended for development or verification):

  1. Clone the repository
git clone https://github.com/jonemo/openpyxl-mcp-server.git
cd openpyxl-mcp-server
  1. Create and activate a virtual environment
  • On macOS/Linux
python -m venv venv
source venv/bin/activate
  • On Windows
python -m venv venv
venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run the server (from repository root)
python openpyxl_mcp_server.py

Running with a prebuilt executable (optional):

  • Download the latest release for your platform from the project releases page.
  • Make sure the executable has execute permissions on macOS: chmod a+x /path/to/openpyxl_mcp_server.
  • Run the executable directly or via your MCP client configuration as the command.

If you want to replicate the exact command shown in the repository examples when running from source, you can also start the server like this:

python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt
python openpyxl_mcp_server.py

Configuring Claude Desktop or other MCP clients: add an entry that points to the server launcher, for example in Claude's claude_desktop_config.json under mcpServers with a server name like inspect_excel_xlsx_file and the command/path to the running server executable or entry script.

Additional notes

Tips and caveats:

  • The server expects paths to Excel files accessible to the host process. Use absolute paths to avoid ambiguity.
  • If you install from source, keep your virtual environment activated when running or configuring the server.
  • MCP clients may require the server to stay alive for the duration of a session; ensure the process is not terminated unexpectedly.
  • If you run into issues, verify Python version compatibility and that all dependencies in requirements.txt are installed.
  • For testing, start with a simple workbook and basic queries (e.g., list sheet names, read a single cell) before attempting larger ranges.
  • When using from Claude Desktop, remember to restart Claude after updating the MCP server config so the changes take effect.

Related MCP Servers

Sponsor this space

Reach thousands of developers