Logo openpyxl_mcp_server

openpyxl_mcp_server

Cộng đồng
jonemo

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.

Nhà phát hànhjonemo
Kho mãopenpyxl-mcp-server
Ngôn ngữPython
Bản fork
6
Sao
19
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    openpyxl_mcp_server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    19 sao và 6 bản fork từ kho mã được liên kết.

openpyxl_mcp_server

What is this?

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.

Related links:

Installation

General Steps

  1. Download the latest version of the executable from https://github.com/jonemo/openpyxl-mcp-server/releases. openpyxl_mcp_server is for MacOS, openpyxl_mcp_server.exe is for Windows.
  2. For MacOS users, make sure to set executable permissions on the downloaded file: chmod a+x /path/to/openpyxl_mcp_server (replace /path/to/ with your actual download location).
  3. Configure your MCP Client. Most commonly this will be Claude Desktop, see instructions in next section.

Windows will try to talk you out of running a random executable downloaded from the internet. You will have to click "Keep" or "Keep anyway" in various places to convince it to not delete the file. The details of this depend on which browser you use and what your Windows Defender settings are.

Alternatively, if you don't trust my executables, you can also install the source version of the code directly from this repo. See the "From Source" section below.

Configuring Claude Desktop

Note that this only works with the Claude Desktop app, not with Claude running in the web browser.

  1. Have Claude Desktop installed.
  2. Have the MCP server executable downloaded (see previous section). This assumes that you have downloaded the executable to your Downloads folder. You can use any other folder, adjust the paths in the configuration below accordingly.
  3. In Claude Desktop, open the "Settings..." menu:
  4. Navigate to the "Developer" section of the settings.
  5. Click "Edit Config". This will create a config file for MCP servers if you didn't have one already. The default location of this file is:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  6. On MacOS, add the following to your claude_desktop_config.json. Replace <YOUR-USERNAME> with your MacOS username. If you already use other MCP servers, you'll have to merge the JSON into the existing contents.
    json
    {
      "mcpServers": {
        "inspect_excel_xlsx_file": {
          "command": "/Users/<YOUR-USERNAME>/Downloads/openpyxl_mcp_server",
          "args": []
        }
      }
    }
  7. On Windows, add the following to your claude_desktop_config.json. Replace <YOUR-USERNAME> with your MacOS username. If you already use other MCP servers, you'll have to merge the JSON into the existing contents.
    json
    {
      "mcpServers": {
        "inspect_excel_xlsx_file": {
          "command": "C:\\Users\\<YOUR-USERNAME>\\Downloads\\openpyxl_mcp_server.exe",
          "args": []
        }
      }
    }
  8. After updating your configuration file, you need to restart the Claude app for the changes to take effect. It is not enough to close the Claude app window. On Windows you must right click the Claude icon in your system tray and select "Quit". On macOS you can use Command+Q.

If you encounter problems, please consult these resources:

Configuring other MCP clients

Instructions for configuring MCP servers in other tools that support them:

From Source (for development)

This section only applies if you wish to modify the source code or if you do not trust the provided executables and prefer to run from source code.

sh
git clone git@github.com:jonemo/openpyxl-mcp-server.git
cd openpyxl-mcp-server
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Assuming you've cloned your repo to /Users/jonas/repos/openpyxl_mcp_server, the configuration file contents should now change to:

json
{
  "mcpServers": {
    "inspect_excel_xlsx_file": {
      "command": "/Users/jonas/repos/openpyxl_mcp_server/venv/bin/python",
      "args": ["/Users/jonas/repos/openpyxl_mcp_server/openpyxl_mcp_server.py"]
    }
  }
}

Example prompts

Example 1

Uses the file KimbroughEvelyn_A-5qg0_Dataset_20160624.xlsx from the "Near-Port Air Quality Assessment Utilizing a Mobile Monitoring Approach" dataset from https://catalog.data.gov/dataset/near-port-air-quality-assessment-utilizing-a-mobile-monitoring-approach

From a quick glance at description and file contents it wasn't obvious to me what ports this dataset is about. Let's ask Claude:

I have an Excel file in ~/Downloads/KimbroughEvelyn_A-5qg0_Dataset_20160624.xlsx that contains data associated with some study about air pollution near one or more ports in the United States. Can you infer from the file contents which ports are covered by this study?

https://claude.ai/share/d87f67a9-dbc0-4223-86ff-3b4c1f9fa2e7

After 11 calls to the MCP server, the response is:

Looking at the latitude and longitude coordinates from the Fig 2 sheet and combining this with the location information, I can infer that this study is focused on the Port of Charleston, South Carolina.

The coordinates in the dataset (approximately latitude 32.83 and longitude -79.87) correspond to the Charleston area, and the references to downtown, rail yard, and airport monitoring stations are consistent with air quality monitoring around a port city.

This dataset appears to contain air pollution measurements (PM2.5 and PM10) collected near the Port of Charleston, with comparisons between port locations and background/reference sites.

Example 2:

I'm the treasurer of a small 10-unit home owners association. Our book keeping happens in an Excel file in Google Sheets. The file has 9 sheets with nine sheets for things like the transactions list, members' dues accounts, quarterly reports.

The file contains non-public information, therefore this example only shows the prompt, a few key "insights", and the final answer:

~/Downloads/CASH FLOW 2024.xlsx are the finances of my home owner association. How much did we get billed for sprinkler system maintenance in 2024? How many transactions contributed to this total? When did each transaction happen?

[...]

I see a "Transactions" sheet that likely contains the detailed expense records. Let me search for "sprinkler" in this sheet to find relevant transactions:

[...]

Let me examine the YEAR 2024 summary sheet to see if sprinkler maintenance is listed as a category:

[...]

Great! I found "Sprinkler Maintenance" listed as a category in row 24 of the YEAR 2024 sheet. Now, let me check the actual transactions related to sprinkler maintenance:

[...]

Let me check more entries by searching specifically for "Sprinkler Maintenance" in the entire Transactions sheet:

[...]

Based on my analysis of your HOA's financial records in the "CASH FLOW 2024.xlsx" file, here's what I found about the sprinkler system maintenance expenses in 2024:

Total amount billed for sprinkler system maintenance in 2024: $565.00 Number of transactions: 1 transaction Transaction date: September 9, 2024

The expense appears as a single transaction in the Transactions sheet. The spreadsheet also contains a budgeted amount for sprinkler maintenance of $750.00 for the year > in the "YEAR 2024 Actuals vs Planned" sheet, with a note stating "Not received any invoices yet" (which may be outdated since there is now one invoice recorded). Would you like me to analyze any other aspects of your HOA's sprinkler maintenance expenses or other financial information from the spreadsheet?

True story. Our sprinkler guy only billed us for the one visit in the spring and forgot to send the bill for the work later in the year. Don't worry, he got paid but it's booked in 2025.

Example 3: Filling out a form

My Google searches for interesting Excel workbooks turned up form DPR 973 by the California Natural Resources Agency: https://www.parks.ca.gov/pages/22374/files/Annual%20Report%20DPR973.xls This appears to be a form that gets filled out by "associations" that support the California State Parks. To be clear, I am not affiliated with such an association. But I converted the form from .xls format to .xlsx and asked Claude to help me fill it out:

I need to file DPR973 because I work for a "cooperating association" for California State Parks. The form I have to fill out is this Excel sheet: /Users/jonas/Downloads/Annual Report DPR973.xlsx. We supported the State Parks by publishing books and generated revenue by selling firewood. Where in the workbook do I have to fill out cells?

After 11 calls to the tool the response seems correct, although I don't understand why Claude did not look at the remaining sheets at all:

Based on my examination of the DPR973 form, I'll now provide guidance on where you need to fill out cells for your cooperating association that publishes books and sells firewood:

  1. Page 1:

    • You'll need to fill out the Association Information (Part I) with your organization's details (name, address, contact information)
    • Update the year in cell C4 to the current reporting year
  2. Page 2 (A) - This is where you'll record your sales information:

    • For your book sales (which would be considered interpretive/educational):

      • Line 1 (Cell F22): Gross Sales - Materials (for your published books)
      • Line 2 (Cell F23): Any returns or refunds
      • Line 3 (Cell F24): Cost of Goods Sold for the books
    • For your firewood sales:

      • Line 23 (Cell F51): Gross Sales - Firewood
      • Line 24 (Cell F52): Any refunds/returned/damaged firewood
      • Line 25 (Cell F53): Cost of Goods Sold for firewood
    • The form will automatically calculate totals in cells F25 (book profits), F54 (firewood profits), and F58 (total net profits)

  3. Page 3 - Financial Summary:

    • Your sales figures will automatically populate from Page 2(A) into:

      • Line 6 (Cell F11): Total gross sales
      • Line 7 (Cell F12): Total cost of goods/services + returns/refunds
      • Line 8 (Cell H13): Net profits for all materials and services
    • You'll need to manually enter:

      • Any donations/contributions (Line 1, Cell F6)
      • Membership dues if applicable (Line 4, Cell H9)
      • Interest/investment income if any (Line 5, Cell H10)
      • Fundraising information if applicable (Lines 9-11)
      • Other income if applicable (Line 12, Cell H17)
    • For expenses:

      • Line 15 (Cell F21): Any direct grants to California State Parks
      • Line 16 (Cell F22): Interpretive program support expenses
      • Line 17 (Cell F23): Other CSP program support
      • Line 19 (Cell H25): Management and general expenses
    • For assets/liabilities:

      • Line 22 (Cell F30): Total assets
      • Line 23 (Cell H31): Total liabilities
      • Lines 24-26 (Cells F32-F34): Net assets by restriction type
  4. Page 4 (not fully examined but likely contains):

    • Additional notes, explanations, and signatures

For your specific activities (book publishing and firewood sales), focus on accurately completing:

  1. The Interpretive and Educational Sales section on Page 2(A) for your book sales
  2. The Firewood Sales section on Page 2(A) for your firewood revenue
  3. The complete financial summary on Page 3

Would you like me to explain any specific section in more detail?

Example 4

This uses the file 2025-3-7-iolp-buildings.xlsx from the Inventory of Owned and Leased Properties (IOLP) dataset available at https://catalog.data.gov/dataset/inventory-of-owned-and-leased-properties-iolp If you've followed the news in recent weeks you will know why this is currently the most popular dataset on data.gov.

Prompt:

Using the Excel file in "/Users/jonas/Downloads/2025-3-7-iolp-buildings.xlsx": What is the largest federal building by square footage in the state of Utah?

I used this file and prompt repeatedly as test case and got mixed results:

  • Chats that terminated without a response because they had reached the context limit. This happened when Claude got into a loop of querying many rows one at a time.
  • Incorrect answers because Claude made "bad assumptions" along the way. For example in this chat it decides that the largest building must be in Salt Lake City and starts to search the spreadsheet for arbitrary terms.
  • Correct answers, for example this chat: The IRS Service Center in Ogden is the largest federally-owned building in Utah on the list.

Footnote: The IRS Service Center is correct insofar that it is the largest building on the list. The "Bumblehive" aka "Utah Data Center" aka "Intelligence Community Comprehensive National Cybersecurity Initiative Data Center" is almost certainly larger but is not included in the file.

Contributing and Development

Building standalone executables

To create standalone executables that don't require Python installation:

  1. Make sure you have all dependencies installed:

    sh
    pip install -r requirements.txt
    pip install -r requirements-dev.txt
  2. Build the executable:

    sh
    pyinstaller openpyxl_mcp_server.spec

The executable will be created in the dist directory. On Windows, it will be named openpyxl_mcp_server.exe. On macOS, it will be named openpyxl_mcp_server.

Note: When building on macOS, you might need to sign the executable for it to run properly. You can do this with:

sh
codesign --force --deep --sign - dist/openpyxl_mcp_server

MCP Server Directories

openpyxl-mcp-server is currently listed in these MCP server directories:

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "jonemo-openpyxl-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "openpyxl-mcp-server"
      ]
    }
  }
}

Dùng MCP openpyxl_mcp_server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối openpyxl_mcp_server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm openpyxl_mcp_server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của openpyxl_mcp_server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "jonemo-openpyxl-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "openpyxl-mcp-server"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của openpyxl_mcp_server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của openpyxl_mcp_server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng openpyxl_mcp_server giúp tôi làm việc này không?
openpyxl_mcp_server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng openpyxl_mcp_server.

Câu hỏi thường gặp

Máy chủ MCP openpyxl_mcp_server dùng để làm gì?

openpyxl_mcp_server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP openpyxl_mcp_server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng openpyxl_mcp_server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP openpyxl_mcp_server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối openpyxl_mcp_server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP openpyxl_mcp_server với TypingMind?

openpyxl_mcp_server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP openpyxl_mcp_server cung cấp những công cụ nào trong TypingMind?

openpyxl_mcp_server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP openpyxl_mcp_server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu openpyxl_mcp_server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇