这是一个简单实用的工具,能够快速、安全且轻松地将多个文件合并为一个,有效解决文件整合难题,提升工作效率。
将以下内容添加到您的 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()
merge_files
inputPaths
(string[]): 要合并的文件outputPath
(string): 输出文件位置list_allowed_directories
Apache License 2.0