/sheetex-mcp-server

基于 sheetex 的 MCP 服务器,用于导出对话中的生成表格,并套用基本格式

Primary LanguageTypeScriptMIT LicenseMIT

sheetex-mcp-server

English | 简体中文

An MCP server based on sheetex, designed to export tables generated in AI conversations into Excel files with basic formatting applied.

📌 Use Case: When using an MCP-compatible AI client, this server enables AI to automatically save structured data as local Excel files, improving data handling efficiency.

🌟 Key Features

  • Convert Markdown tables generated in conversations into .xlsx files
  • Support for multiple export directories with alias management, allowing controlled access and explicit save location selection
  • Preserve basic table styles:
    • Bold headers and emphasized text (bold, italic, strikethrough)
    • Auto column width estimation based on content length
  • Compatible with mainstream MCP clients

🛠 Available Tool

save-with-sheetex - Save table as Excel file

Saves a table generated in the conversation as an .xlsx file.

Parameter Type Description
folderName string Export directory (must match an alias in EXPORT_DIRS)
fileName string Output file name (without .xlsx extension)
caption string Optional table caption (displayed as a merged, centered row at the top in Excel)
table string Table data in Markdown format

🚀 Usage

Integrate via Configuration File

Windows:

{
  "mcpServers": {
    "sheetex": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "sheetex-mcp-server"],
      "env": {
        "EXPORT_DIRS": "/path/to/dir#alias_name;/path/to/document"
      }
    }
  }
}

Linux/MacOS:

{
  "mcpServers": {
    "sheetex": {
      "command": "npx",
      "args": ["-y", "sheetex-mcp-server"],
      "env": {
        "EXPORT_DIRS": "/path/to/dir#alias_name;/path/to/document"
      }
    }
  }
}

⚙️ Environment Variable: EXPORT_DIRS

Specifies a list of allowed export directories, with optional aliasing.

  • Format: Multiple directories separated by semicolons (;). Each directory may optionally include a #alias.
  • Alias Rules:
    • If #alias_name is provided, the AI will recognize the directory by that alias.
    • If no alias is given, the last segment of the path is used as the default alias.
  • Default Behavior: When the AI cannot determine the target directory, the first directory in the list is used.

Example

EXPORT_DIRS=/Users/me/reports#FinanceReports;/home/user/docs#Documents

The AI will recognize the directories as FinanceReports and Documents. Users can specify the target in prompts, e.g., "Save the table to the FinanceReports directory."

🤝 Contributing

We welcome Issues and Pull Requests to help improve this project!
Whether it's feature suggestions, documentation improvements, or bug fixes — your contributions are greatly appreciated.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.