MCP.FileSystem 1.0.2

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package MCP.FileSystem --version 1.0.2
                    
NuGet\Install-Package MCP.FileSystem -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MCP.FileSystem" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MCP.FileSystem" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="MCP.FileSystem" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MCP.FileSystem --version 1.0.2
                    
#r "nuget: MCP.FileSystem, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MCP.FileSystem@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MCP.FileSystem&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=MCP.FileSystem&version=1.0.2
                    
Install as a Cake Tool

MCP.FileSystem

A comprehensive Model Context Protocol (MCP) Server that provides powerful file system operations through standardized tools. This server enables AI assistants and other MCP clients to interact with the file system safely and efficiently.

Features

File Operations

  • Read/Write Files: Read content from files or create new files with custom content
  • Append Content: Add content to existing files without overwriting
  • Delete Files: Remove files from the file system
  • Copy Files: Duplicate files to new locations
  • Move/Rename Files: Relocate or rename files

Directory Operations

  • Create Directories: Make new directories with automatic parent creation
  • Delete Directories: Remove directories with optional recursive deletion
  • List Directory Contents: Browse files and folders with filtering options

Advanced Search Capabilities

  • File Name Search: Find files by name patterns with wildcard support
  • Content Search: Search for text within files across directories
  • Regex Search: Advanced pattern matching using regular expressions
  • Recursive Searching: Search through subdirectories

File Information & Utilities

  • File Metadata: Get detailed information about files and directories
  • Path Validation: Check if files or directories exist
  • Directory Size: Calculate total size of directories including subdirectories
  • Working Directory: Get and set current working directory

Technology Stack

  • .NET 8.0: Built on the latest .NET platform
  • C# 12.0: Using modern C# language features
  • Model Context Protocol: Implements MCP server specification
  • JSON Serialization: Structured responses for easy integration
  • Docker Support: Ready for containerized deployment

Installation

Prerequisites

  • .NET 8.0 SDK or later
  • Compatible MCP client (Claude Desktop, VS Code with MCP extension, etc.)

Building from Source

git clone https://github.com/YOUR_USERNAME/MCP.FileSystem.git
cd MCP.FileSystem
dotnet build

Running the Server

dotnet run --project MCP.FileSystem

Docker Deployment

docker build -t mcp-filesystem .
docker run -it mcp-filesystem

Usage

MCP Client Configuration

Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "dotnet",
      "args": ["run", "--project", "path/to/MCP.FileSystem"]
    }
  }
}
VS Code with MCP Extension

Configure in your MCP settings:

{
  "mcp.servers": [
    {
      "name": "filesystem",
      "command": "dotnet",
      "args": ["run", "--project", "path/to/MCP.FileSystem"]
    }
  ]
}

Available Tools

File Operations

Tool Description Parameters
ReadFile Read content from a file filePath
WriteFile Write content to a file filePath, content, overwrite?
AppendToFile Append content to a file filePath, content
DeleteFile Delete a file filePath
CopyFile Copy a file sourcePath, destinationPath, overwrite?
MoveFile Move/rename a file sourcePath, destinationPath, overwrite?

Directory Operations

Tool Description Parameters
CreateDirectory Create a directory directoryPath
DeleteDirectory Delete a directory directoryPath, recursive?
ListDirectory List directory contents directoryPath, searchPattern?, includeSubdirectories?

Search Operations

Tool Description Parameters
SearchFiles Search for files by pattern directoryPath, searchPattern?, includeSubdirectories?, maxResults?
SearchInFiles Search for text in files directoryPath, searchText, filePattern?, includeSubdirectories?, caseSensitive?, maxResults?
SearchInFilesRegex Search using regex patterns directoryPath, regexPattern, filePattern?, includeSubdirectories?, caseSensitive?, maxResults?

Information & Utilities

Tool Description Parameters
GetFileInfo Get file/directory metadata path
PathExists Check if path exists path
GetCurrentDirectory Get current working directory -
SetCurrentDirectory Set current working directory path
GetDirectorySize Calculate directory size directoryPath

Example Responses

All tools return structured JSON responses:

Success Response

{
  "success": true,
  "message": "File written successfully",
  "path": "/path/to/file.txt",
  "size": 1024
}

Error Response

{
  "error": "File not found",
  "path": "/path/to/nonexistent.txt"
}

Search Results

{
  "success": true,
  "searchPath": "/search/directory",
  "matches": [
    {
      "file": "/path/to/match.txt",
      "fileName": "match.txt",
      "lineNumber": 42,
      "line": "Found matching content here",
      "matchPosition": 6
    }
  ],
  "count": 1,
  "truncated": false
}

Security Considerations

  • Path Validation: All file paths are validated to prevent directory traversal attacks
  • Error Handling: Comprehensive error handling prevents information leakage
  • Permission Respect: Operations respect file system permissions
  • Sandboxing: Consider running in a containerized environment for additional security

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Dependencies

  • Microsoft.Extensions.Hosting (9.0.7) - Application hosting framework
  • ModelContextProtocol (0.3.0-preview.2) - MCP server implementation
  • Microsoft.VisualStudio.Azure.Containers.Tools.Targets (1.22.1) - Docker support

License

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

Changelog

v1.0.0

  • Initial release with comprehensive file system operations
  • Support for file and directory operations
  • Advanced search capabilities with regex support
  • Docker deployment support
  • Complete MCP server implementation

Support

For questions, issues, or contributions, please visit the GitHub repository or open an issue.


Note: This MCP server provides powerful file system access. Ensure you understand the security implications and run it in appropriate environments with proper access controls.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated