Cover image
Try Now
2025-04-10

Excel数据处理微服务

3 years

Works with Finder

1

Github Watches

3

Github Forks

13

Github Stars

Excel MCP Server

npm smithery badge 简体中文 | English

Excel file processing server based on Model Context Protocol (MCP), providing functionalities for reading, writing, and analyzing Excel files.

Features

  • 📖 Read Excel Files

    • Get worksheet list
    • Read specific worksheet data
    • Read all worksheets data
  • ✍️ Write Excel Files

    • Create new Excel files
    • Write to specific worksheet
    • Support multiple worksheets
  • 🔍 Analyze Excel Structure

    • Analyze worksheet structure
    • Export structure to new file
  • 💾 Cache Management

    • Automatic file content caching
    • Scheduled cache cleanup
    • Manual cache clearing
  • 📝 Log Management

    • Automatic operation logging
    • Periodic log cleanup

Installation

Installing via Smithery

To install excel-mcp-server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @zhiwei5576/excel-mcp-server --client claude

Installing Manually

Installing via NPM excel-mcp-server can be automatically installed by adding the following configuration to the MCP servers configuration.

Windows Platform:

{
  "mcpServers": {
    "excel": {
        "command": "cmd",
        "args": ["/c", "npx", "--yes", "@zhiweixu/excel-mcp-server"],
        "env": {
            "LOG_PATH": "[set an accessible absolute path]",
            "CACHE_MAX_AGE": "1",
            "CACHE_CLEANUP_INTERVAL": "4",
            "LOG_RETENTION_DAYS": "7",
            "LOG_CLEANUP_INTERVAL": "24"
        }
    }
}

Other Platforms:

{
  "mcpServers": {
    "excel": {
        "command": "npx",
        "args": ["--yes", "@zhiweixu/excel-mcp-server"],
        "env": {
            "LOG_PATH": "[set an accessible absolute path]",
            "CACHE_MAX_AGE": "1",
            "CACHE_CLEANUP_INTERVAL": "4",
            "LOG_RETENTION_DAYS": "7",
            "LOG_CLEANUP_INTERVAL": "24"
        }
    }
}

Note: LOG_PATH is optional. If not set, logs will be stored in the 'logs' folder under the application root directory.other arguments are optional.

API Tools

Structure Tools

  1. analyzeExcelStructure

    • Function: Get Excel file structure including sheet list and column headers in JSON format
    • Parameters:
      • fileAbsolutePath: Absolute path of the Excel file
      • headerRows: Number of header rows (default: 1)
  2. exportExcelStructure

    • Function: Export Excel file structure (sheets and headers) to a new Excel template file
    • Parameters:
      • sourceFilePath: Source Excel file path
      • targetFilePath: Target Excel file path
      • headerRows: Number of header rows (default: 1)

Read Tools

  1. readSheetNames

    • Function: Get all sheet names from the Excel file
    • Parameters:
      • fileAbsolutePath: Absolute path of the Excel file
  2. readDataBySheetName

    • Function: Get data from a specific sheet in the Excel file
    • Parameters:
      • fileAbsolutePath: Absolute path of the Excel file
      • sheetName: Name of the sheet to read
      • headerRow: Header row number (default: 1)
      • dataStartRow: Data start row number (default: 2)
  3. readSheetData

    • Function: Get data from all sheets in the Excel file
    • Parameters:
      • fileAbsolutePath: Absolute path of the Excel file
      • headerRow: Header row number (default: 1)
      • dataStartRow: Data start row number (default: 2)

Write Tools

  1. writeDataBySheetName

    • Function: Write data to a specific sheet in the Excel file (overwrites if sheet exists)
    • Parameters:
      • fileAbsolutePath: Absolute path of the Excel file
      • sheetName: Name of the sheet to write
      • data: Array of data to write
  2. writeSheetData

    • Function: Create a new Excel file with provided data
    • Parameters:
      • fileAbsolutePath: Absolute path for the new Excel file
      • data: Object containing multiple sheet data

Cache Tools

  1. clearFileCache
    • Function: Clear cached data for the specified Excel file
    • Parameters:
      • fileAbsolutePath: Absolute path of the Excel file to clear from cache

Configuration

Environment Variables

  • LOG_PATH: Log files storage path

    • Optional
    • Default: 'logs' folder under application root directory
  • CACHE_MAX_AGE: Cache expiration time (hours)

    • Optional
    • Default: 1
  • CACHE_CLEANUP_INTERVAL: Cache cleanup interval (hours)

    • Optional
    • Default: 4
  • LOG_RETENTION_DAYS: Log retention days

    • Optional
    • Default: 7
  • LOG_CLEANUP_INTERVAL: Log cleanup interval (hours)

    • Optional
    • Default: 24

Default Configuration

  • Cache Configuration

    • Cache expiration time: 1 hour
    • Cache cleanup interval: 4 hours
  • Log Configuration

    • Log retention days: 7 days
    • Cleanup interval: 24 hours

Dependencies

  • @modelcontextprotocol/sdk: ^1.7.0
  • xlsx: ^0.18.5
  • typescript: ^5.8.2

Development Dependencies

  • @types/node: ^22.13.10
  • nodemon: ^3.1.9
  • ts-node: ^10.9.2

License

This project is licensed under the MIT License. This means you are free to:

  • Use the software for commercial or non-commercial purposes

  • Modify the source code

  • Distribute original or modified code Requirements:

  • Retain the original copyright notice

  • No liability can be claimed against the authors for software use For detailed license information,please see the LICENSE file.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    1 (1)
    Avatar
    user_b1b6422U
    2025-04-16

    excel-mcp-server is a fantastic tool for managing Excel files efficiently. Developed by zhiwei5576, this server application seamlessly integrates with your system, providing robust features for processing and controlling Excel sheets. The GitHub link allows easy access and updates. Highly recommend this for anyone dealing with extensive Excel file operations!