Golang Filesystem Server

Golang Filesystem Server

Secure file operations with configurable access controls built with Go!

556
Stars
88
Forks
14
Releases

Overview

This MCP server exposes secure, MCP-enabled access to the host file system. It defines a File System resource (file://) that represents access to local files and directories. The server provides a rich set of tools for file operations (read_file, read_multiple_files, write_file, copy_file, move_file, delete_file, modify_file), directory operations (list_directory, create_directory, tree), and search/information utilities (search_files, search_within_files, get_file_info, list_allowed_directories). Each operation accepts structured parameters such as path(s), content, pattern, and flags, enabling precise, programmatic control over filesystem interactions while enforcing security constraints. The project emphasizes secure access to configured directories, path validation to prevent directory traversal, and symlink resolution with security checks. It also includes MIME type detection and support for various content types (text, binary, images) with size limits for inline content and base64 encoding. Getting started shows installation via Go, usage as a standalone server or as a library, and MCP integration examples. Docker deployment and MCP configuration snippets illustrate how to wire this server into MCP-enabled apps, including volume mounting support for host-container file sharing.

Details

Owner
mark3labs
Language
Go
License
MIT License
Updated
2025-12-07

Features

Secure access to specified directories

Restricts access to configured directories to prevent unauthorized filesystem access.

Path validation to prevent directory traversal attacks

Validates and normalizes requested paths to block traversal attempts.

Symlink resolution with security checks

Resolves symbolic links in a secure manner to avoid leaking or escaping permitted areas.

MIME type detection

Detects file MIME types to guide handling and display of content.

Support for text, binary, and image files

Handles a range of content types, including text, binary, and image data.

Size limits for inline content and base64 encoding

Applies configurable size limits to inline content and base64-encoded payloads.

Audience

DevelopersTo integrate MCP filesystem operations into applications or run as a standalone server.
SysadminsTo deploy and manage a secure filesystem service with controlled access in production.

Tags

MCPfilesystemsecure-accessfile-operationsdirectory-operationssearchMIME-typessymlink-securitypath-validationGoDockermcp-filesystem-server