FieldCure MCP Filesystem Server

FieldCure MCP Filesystem Server

A secure MCP server that exposes local filesystem operations to AI clients with sandboxed access and runtime directory changes.

Category
Visit Server

README

FieldCure MCP Filesystem Server

NuGet License: MIT

A secure Model Context Protocol (MCP) server that exposes local filesystem operations to AI clients. Built with C# and the official MCP C# SDK.

Features

  • 17 filesystem tools: read, write, append, delete, search, copy, move, convert-to-markdown, and more
  • Sandboxed access: all operations restricted to explicitly allowed directories
  • MCP roots protocol: clients can change allowed directories at runtime without restarting the server
  • Security hardened: path traversal prevention, symlink resolution, NTFS ADS blocking, Windows reserved name rejection
  • Atomic writes: temp-file-then-rename pattern prevents data corruption
  • Binary detection: automatically returns base64 for binary files, UTF-8 for text
  • Built-in document parsing: supported document formats can be read directly and converted to markdown on disk
  • Stdio transport: standard MCP subprocess model via JSON-RPC over stdin/stdout

Installation

dotnet tool

dotnet tool install -g FieldCure.Mcp.Filesystem

From source

git clone https://github.com/fieldcure/fieldcure-mcp-filesystem.git
cd fieldcure-mcp-filesystem
dotnet build

Requirements

Configuration

Claude Desktop

{
  "mcpServers": {
    "filesystem": {
      "command": "fieldcure-mcp-filesystem",
      "args": [
        "C:\\Users\\me\\Documents",
        "C:\\Projects"
      ]
    }
  }
}

VS Code

{
  "servers": {
    "filesystem": {
      "command": "fieldcure-mcp-filesystem",
      "args": [
        "${workspaceFolder}"
      ]
    }
  }
}

Tools

File Operations

Tool Description
read_file Read file contents (text as UTF-8, binary as base64)
read_multiple_files Read multiple files at once with per-file error handling
read_file_lines Read a specific range of lines
convert_to_markdown Convert one supported document file into a markdown file on disk
convert_directory_to_markdown Batch-convert supported document files in a directory to markdown files
write_file Create or overwrite a file with atomic write
append_file Append content to end of file with auto-newline
modify_file Find and replace text (plain text or regex)
copy_file Copy a file or directory recursively
move_file Move or rename a file or directory
delete_file Delete a file or directory

Directory Operations

Tool Description
list_directory List contents with type markers, sizes, and dates
create_directory Create a directory recursively
directory_tree Hierarchical tree view with configurable depth

Search & Info

Tool Description
search_files Find files by glob pattern
search_within_files Search text content across files with line numbers
get_file_info File or directory metadata

MCP Roots Protocol

The server supports the MCP roots protocol for runtime directory changes. When the client changes roots:

  1. The server requests the updated roots list.
  2. Allowed directories are replaced entirely.
  3. CLI args provide the initial sandbox.
  4. An empty roots list means all file access is denied.

Security Model

All paths are validated through IPathValidator before any filesystem operation:

  1. Allowed directories define the sandbox boundary.
  2. . and .. are normalized via Path.GetFullPath().
  3. Symlinks must resolve within allowed directories.
  4. Prefix matching is directory-separator-aware.
  5. NTFS alternate data streams are blocked.
  6. Windows reserved names are rejected.
  7. Allowed directory updates are thread-safe.

The markdown conversion tools validate both source and output paths through the same sandbox rules. They write converted markdown directly to disk instead of returning full document text through MCP, which is usually more token-efficient than read_file plus write_file.

Project Structure

src/FieldCure.Mcp.Filesystem/
|- Program.cs
|- Security/
|  |- IPathValidator.cs
|  \- PathValidator.cs
|- Tools/
|  |- FileOperationTools.cs
|  |- DirectoryTools.cs
|  \- SearchTools.cs
\- Utilities/
   |- EncodingDetector.cs
   \- FileSize.cs

Development

dotnet build
dotnet test
dotnet pack src/FieldCure.Mcp.Filesystem -c Release

Limitations

Supported Not Yet Supported
Text file read/write (UTF-8) Non-UTF-8 encoding auto-detection
Binary file detection + base64 Streaming for very large files (>100 MB)
Atomic writes File watching / change notifications
Glob pattern search Full-text indexing
Regex find-and-replace Multi-file transactional writes
Symlink resolution Cross-platform symlink creation
MCP roots protocol HTTP transport
Document text extraction / markdown conversion for formats supported by DocumentParsers OCR for scanned documents

See Also

Part of the AssistStudio ecosystem.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured