Back to MCP directory
publicPublicdnsLocal runtime

mcp-file-merger

一个简单高效的多文件合并工具

article

README

🚀 文件合并 MCP 服务器

这是一个简单实用的工具,能够快速、安全且轻松地将多个文件合并为一个,有效解决文件整合难题,提升工作效率。

🚀 快速开始

将以下内容添加到您的 claude_desktop_config.json

{
  "mcpServers": {
    "file-merger": {
      "command": "npx",
      "args": [
        "-y",
        "@exoticknight/mcp-file-merger",
        "/path/to/allowed/dir"
      ]
    }
  }
}

✨ 主要特性

  • 简单:使用单一命令即可合并任意数量的文件。
  • 快速:高效地合并任何大小的文件。
  • 安全:只访问您允许的目录。
  • 详细:报告文件大小和合并摘要。

📦 安装指南

# 克隆和安装
git clone https://github.com/exoticknight/mcp-file-merger.git
cd mcp-file-merger
npm install
npm run build

💻 使用示例

基础用法

本工具提供了两个主要的 API 接口,以下是它们的使用示例:

merge_files 接口

# 此函数用于合并多个文件
# 输入参数:
# inputPaths (string[]): 要合并的文件
# outputPath (string): 输出文件位置
# 返回:
# 成功消息,包括合并详细信息
merge_files(inputPaths, outputPath)

list_allowed_directories 接口

# 此函数用于列出服务器可以访问的目录
list_allowed_directories()

📚 详细文档

API

工具

  • merge_files

    • 输入:
      • inputPaths (string[]): 要合并的文件
      • outputPath (string): 输出文件位置
    • 返回:
      • 成功消息,包括合并详细信息
  • list_allowed_directories

    • 列出服务器可以访问的目录

📄 许可证

Apache License 2.0

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client