BM

bsmi021/mcp-file-operations-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

22 stars 5 forks 质量 55 趋势 10MIT

一款模型上下文协议(MCP)服务器,提供增强的文件操作能力,支持流式传输、补丁和变更跟踪。

概览

一款模型上下文协议(MCP)服务器,提供增强的文件操作能力,支持流式传输、补丁和变更跟踪。 - : 复制、读取、写入、移动和删除文件 - : 创建、删除和复制目录 - : 监控文件和目录的变更 - : 跟踪和查询文件操作历史 - : 通过流式高效处理大文件 - : 通过服务器发送事件(SSE)的可流式HTTP接口 - : 通过MCP资源访问文件和目录 - : 长时间操作的实时进度更新 - : 防止过度请求 - : 路径验证和输入净化 - : 全面的错误处理和报告 - : 完整的TypeScript支持,严格类型检查 - : 带卷挂载的容器化部署 通过 Smithery 自动安装 Claude Desktop 的文件操作服务器: 详见 DOCKER.md,了解包括Windows和Linux本地硬盘挂载在内的详细Docker设置说明。

概述(AI 翻译)

一款模型上下文协议(MCP)服务器,提供增强的文件操作能力,支持流式传输、补丁和变更跟踪。

特色

  • 基本文件操作:复制、读取、写入、移动和删除文件
  • 目录操作:创建、删除和复制目录
  • 文件监控:监控文件和目录的变更
  • 变更追踪:跟踪和查询文件操作历史
  • 流媒体支持:通过流媒体高效处理大文件
  • HTTP 接口:带服务器发送事件(SSE)的可流式 HTTP 接口
  • 资源支持:通过MCP资源访问文件和目录
  • 进展报告:长期运营的实时进展更新
  • 速率限制:防止过度请求
  • 增强安全性:路径验证和输入净化
  • 稳健的错误处理:全面的错误处理与报告
  • 类型安全:完全支持TypeScript,严格类型检查
  • Docker 支持:带卷挂载的容器化部署

安装

通过Smithery安装

通过 Smithery 自动安装 Claude Desktop 的文件操作服务器:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

File Operations MCP Server

A Model Context Protocol (MCP) server that provides enhanced file operation capabilities with streaming, patching, and change tracking support.

Features

  • Basic File Operations: Copy, read, write, move, and delete files
  • Directory Operations: Create, remove, and copy directories
  • File Watching: Monitor files and directories for changes
  • Change Tracking: Track and query file operation history
  • Streaming Support: Handle large files efficiently with streaming
  • HTTP Interface: Streamable HTTP interface with Server-Sent Events (SSE)
  • Resource Support: Access files and directories through MCP resources
  • Progress Reporting: Real-time progress updates for long operations
  • Rate Limiting: Protection against excessive requests
  • Enhanced Security: Path validation and input sanitization
  • Robust Error Handling: Comprehensive error handling and reporting
  • Type Safety: Full TypeScript support with strict type checking
  • Docker Support: Containerized deployment with volume mounting

Installation

Installing via Smithery

To install File Operations Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @bsmi021/mcp-file-operations-server --client claude

Manual Installation

npm install

Docker Installation

See DOCKER.md for comprehensive Docker setup instructions including local drive mounting for Windows and Linux.

Quick Docker Start:

# Stdio transport (for MCP clients)
docker run -it --rm -v "$(pwd):/workspace" ghcr.io/bsmi021/mcp-file-operations-server

# HTTP transport (for web/remote access)
docker run -it --rm -p 3001:3001 -v "$(pwd):/workspace" -e MCP_TRANSPORT=http ghcr.io/bsmi021/mcp-file-operations-server

Usage

Transport Modes

The server supports two transport modes:

1. Stdio Transport (Default)

For direct integration with MCP clients like Claude Desktop:

npm start

2. HTTP Transport with SSE (New in v1.5)

For remote connections and web applications:

npm run start:http

The HTTP server provides:

  • SSE Endpoint: GET http://localhost:3001/sse - Establishes streaming connection
  • Messages Endpoint: POST http://localhost:3001/messages - Receives client messages
  • Health Check: GET http://localhost:3001/health - Server status
  • Sessions: GET http://localhost:3001/sessions - Active connection info

Starting the Server

Development Mode

# Stdio transport with auto-reload
npm run dev
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @bsmi021/mcp-file-operations-server --client claude
新手?先看 mcpskill.org 教程 →