
A Model Context Protocol server for global law with read-only tools to find and read provisions by date, trace the law behind each word, search text and changes, and check cases or briefs against law in force.

A Model Context Protocol server that provides file statistics, listing, image compression, archive creation and extraction, copy and move, and PDF merging, splitting, and image conversion.
File Operation MCP Server is cataloged as an MCP server attributed to lxkylin. A Model Context Protocol server that provides file statistics, listing, image compression, archive creation and extraction, copy and move, and PDF merging, splitting, and image conversion. It is categorized under file systems-docs. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for File Operation MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes. It supports Stdio for local single-user use and SSE for remote access, multiple clients, and monitoring through an HTTP server.
The server creates and extracts ZIP, TAR, and TAR.GZ archives.
README.md · 1429fc039cbf · 采集于 2026-11-13 13:09:15 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
一个基于 Model Context Protocol (MCP) 的文件操作服务器,提供文件统计、列表查询和图片压缩功能。
git clone https://github.com/lxKylin/file-operation-mcp.git
cd file-operation-mcp
pnpm install
pnpm build
本项目支持两种MCP传输方式,您可以根据使用场景选择合适的方式:
| 特性 | Stdio | SSE |
|---|---|---|
| 传输协议 | 进程间通信 (IPC) | HTTP/HTTPS |
| 连接方式 | stdin/stdout | Server-Sent Events |
| 多客户端支持 | ❌ 1对1连接 | ✅ 多对1连接 |
| 远程访问 | ❌ 仅本地 | ✅ 支持远程 |
| 部署复杂度 | ✅ 简单 | ❌ 需要HTTP服务器 |
| 资源占用 | ✅ 低 | ❌ 相对高 |
| 调试便利性 | ❌ 困难 | ✅ 容易(HTTP工具) |
| 网络穿透 | ❌ 不支持 | ✅ 支持 |
| 负载均衡 | ❌ 不支持 | ✅ 支持 |
| 监控能力 | ❌ 有限 | ✅ 丰富(健康检查等) |
| 延迟 | ✅ 极低 (~1-5ms) | ❌ 略高 (~10-50ms) |
客户端 ←→ 服务器进程 (直接IPC)
延迟: 1-5ms | 内存: 低 | CPU: 低
客户端 ←→ HTTP服务器 ←→ MCP服务器
延迟: 10-50ms | 内存: 中等 | CPU: 中等
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('Stdio MCP服务器已启动');
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
import express from 'express';
const app = express();
app.get('/sse', async (req, res) => {
const transport = new SSEServerTransport('/messages', res);
await server.connect(transport);
});
app.listen(3000, () => {
console.error('SSE MCP服务器已启动在端口 3000');
});
💡 推荐: 如果您是个人用户且只需要本地使用,选择 Stdio;如果需要团队协作或远程访问,选择 SSE。
将以下配置添加到 Claude Desktop 的配置文件中:
配置文件位置:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json配置内容:
{
"mcpServers": {
"file-operation-mcp": {
"command": "node",
"args": ["path/to/file-operation-mcp/dist/index.js"],
"cwd": "path/to/file-operation-mcp",
"env": {
"NODE_ENV": "production"
}
}
}
}
⚠️ 注意: 请将
path/to/file-operation-mcp替换为实际的项目路径
{
"mcpServers": {
"file-operation-mcp": {
"command": "node",
"args": ["path/to/file-operation-mcp/dist/index.js"]
}
}
}
首先启动HTTP服务器:
# 启动服务器
pnpm start
# 或
node dist/index.js
服务器启动后会显示:
MCP文件操作服务器已启动在端口 3000
SSE端点: http://localhost:3000/sse
健康检查: http://localhost:3000/health
# 检查服务器健康状态
curl http://localhost:3000/health
# 返回示例
{
"status": "ok",
"message": "MCP文件操作服务器运行中",
"timestamp": "2024-01-01T12:00:00.000Z"
}
将以下配置添加到 Claude Desktop 的配置文件中:
{
"mcpServers": {
"file-operation-mcp": {
"url": "http://localhost:3000/sse"
}
}
}
{
"mcpServers": {
"file-operation-mcp": {
"url": "http://localhost:3000/sse"
}
}
}
http://localhost:3000/sse - 主要的MCP连接端点http://localhost:3000/messages - 处理JSON-RPC消息http://localhost:3000/health - 服务器状态检查PORT 修改,默认为 3000⚠️ 注意: SSE模式需要先手动启动服务器,然后再配置客户端连接。
配置完成后重启 Claude Desktop,即可在对话中使用以下功能:
统计指定文件夹中的文件数量,默认统计桌面文件。
参数:
folderPath (可选): 文件夹路径,默认为桌面示例:
请帮我统计一下桌面上有多少个文件
请统计 /Users/username/Documents 文件夹中的文件数量
获取指定文件夹中所有文件的详细信息,包括文件名、类型和大小。
参数:
folderPath (可选): 文件夹路径,默认为桌面includeHidden (可选): 是否包含隐藏文件,默认为 false示例:
请列出桌面上的所有文件
请显示 /Users/username/Downloads 文件夹中的内容,包括隐藏文件
压缩指定的图片文件,支持多种格式和自定义参数。
参数:
imagePath: 图片文件路径 (必需)quality (可选): 压缩质量 (1-100),默认为 80maxWidth (可选): 最大宽度限制maxHeight (可选): 最大高度限制outputPath (可选): 输出路径,默认为原文件名加 _compressed 后缀支持格式:
示例:
请将 /Users/username/Desktop/photo.jpg 压缩到 60% 质量
请压缩图片 /path/to/image.png,限制最大宽度为 1920 像素
将文件或文件夹压缩为ZIP、TAR或TAR.GZ格式。
参数:
files: 要压缩的文件/文件夹路径数组 (必需)outputPath: 输出压缩文件路径 (必需)format (可选): 压缩格式 (zip, tar, tar.gz),默认为zipcompressionLevel (可选): 压缩级别 (0-9),默认为6支持格式:
示例:
请将 /Users/username/Documents 文件夹压缩为ZIP格式
请压缩文件 ["/path/file1.txt", "/path/file2.txt"] 为 /backup/files.tar.gz 格式
请将项目文件夹压缩为高压缩级别的ZIP包
解压ZIP、TAR或TAR.GZ文件到指定目录。
参数:
archivePath: 压缩文件路径 (必需)extractTo: 解压目标目录 (必需)overwrite (可选): 是否覆盖已存在文件,默认为false支持格式:
示例:
请解压 /Downloads/archive.zip 到 /Projects/ 目录
请解压 /backup/files.tar.gz 到 /restore/ 并覆盖现有文件
请将压缩包解压到临时文件夹
注意事项:
复制文件或文件夹到指定位置,保持原文件不变。
参数:
sourcePath: 源文件/文件夹路径 (必需)targetPath: 目标路径 (必需)overwrite (可选): 是否覆盖已存在文件,默认为falsepreserveTimestamps (可选): 是否保留时间戳,默认为true特性:
示例:
请复制 /Users/username/Documents/report.pdf 到 /backup/ 目录
请复制整个项目文件夹到备份目录,保留时间戳
请复制文件并覆盖已存在的目标文件
移动文件或文件夹到指定位置,相当于剪切操作。
参数:
sourcePath: 源文件/文件夹路径 (必需)targetPath: 目标路径 (必需)overwrite (可选): 是否覆盖已存在文件,默认为false特性:
示例:
请移动 /Downloads/archive.zip 到 /Projects/ 目录
请将临时文件夹移动到永久存储位置
请移动文件并覆盖目标位置的同名文件
注意事项:
将多个PDF文件合并成一个完整的PDF文档。
参数:
inputPaths: PDF文件路径数组 (必需)outputPath: 输出PDF文件路径 (必需)title (可选): 合并后PDF的标题特性:
示例:
请合并这些PDF文件:["/reports/report1.pdf", "/reports/report2.pdf"] 到 "/merged/combined_report.pdf"
请将项目文档合并,标题设为 "完整项目文档"
将PDF文件拆分成多个独立的文件,支持按页面或自定义范围拆分。
参数:
inputPath: 输入PDF文件路径 (必需)outputDir: 输出目录 (必需)splitMode (可选): 拆分模式 - pages(每页一个文件) 或 ranges(按范围拆分),默认pagesranges (可选): 页面范围数组,如 ["1-3", "4-6"],仅ranges模式需要prefix (可选): 输出文件名前缀,默认为原文件名特性:
示例:
请将 "/documents/manual.pdf" 按页面拆分到 "/pages/" 目录
请将PDF按范围拆分:["1-5", "6-10", "11-15"]
请拆分PDF的第3页到第8页为单独文件


将PDF页面转换为高质量的图片文件,支持多种格式和自定义设置。
参数:
inputPath: 输入PDF文件路径 (必需)outputDir: 输出目录 (必需)format (可选): 图片格式 - jpeg 或 png,默认jpegquality (可选): 图片质量 1-100,默认80dpi (可选): 分辨率DPI 50-600,默认150pages (可选): 页面范围,如 "1-3" 或 "1,3,5",默认全部页面prefix (可选): 输出文件名前缀特性:
示例:
请将 "/docs/presentation.pdf" 转换为PNG图片,分辨率300 DPI
请只转换PDF的第1、3、5页为JPEG图片
请将PDF第10-20页转换为高质量图片
注意事项:
默认查询桌面文件,也可指定具体路径:

快速统计指定目录的文件数量:

高质量图片压缩,支持自定义参数:


pnpm dev
pnpm format
pnpm lint
pnpm start
/Users/username/pathC:\Users\username\pathconsole.error() 而非 console.log() 避免干扰 MCP 协议1. 服务器启动失败
Error: Cannot find module 'xxx'
解决方案: 确保运行了 pnpm install 和 pnpm build
2. 权限错误
Error: EACCES: permission denied
解决方案: 检查文件夹访问权限,或使用具有适当权限的路径
3. 路径不存在
错误:路径 /xxx 不存在
解决方案: 确认路径正确,使用绝对路径
4. 图片格式不支持
错误:不支持的图片格式 .xxx
解决方案: 使用支持的图片格式 (jpg, png, webp, tiff, gif)
5. 压缩文件创建失败
错误:创建压缩文件时发生错误
解决方案:
6. 解压文件失败
错误:目标目录不为空
解决方案: 设置 overwrite=true 或清空目标目录
7. 不支持的压缩格式
错误:不支持的压缩格式
解决方案: 使用支持的格式 (.zip, .tar, .tar.gz, .tgz)
8. 文件复制失败
错误:目标路径已存在
解决方案: 设置 overwrite=true 或选择不同的目标路径
9. 文件移动失败
错误:源路径和目标路径不能相同
解决方案: 确保源路径和目标路径不同
10. 权限不足
Error: EACCES: permission denied
解决方案:
11. PDF文件损坏
错误:无法处理PDF文件
解决方案:
12. PDF转图片失败
错误:批量转换失败
解决方案:
13. 页面范围错误
错误:页面范围超出有效范围
解决方案:
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for File Operation MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/file-operation-mcp)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A Model Context Protocol server for global law with read-only tools to find and read provisions by date, trace the law behind each word, search text and changes, and check cases or briefs against law in force.

Hosted MCP server for tabletop RPG worlds that organizes messy notes and documents into a private store and lets MCP apps search lore, read documents, find characters, and optionally generate character or world pictures.

An MCP server that gives AI assistants scoped file system operations inside a project directory, with read-only reference projects plus git and GitHub tools.