MCP Filesystem Server
:북마크: 정보
MCP 파일 시스템 서버는 모델 컨텍스트 프로토콜을 통해 AI 모델에 안전한 파일 시스템 액세스를 제공합니다. 엄격한 경로 검증을 시행하고 미리 정의된 디렉터리에만 액세스를 허용합니다.
Related MCP server: MCP Filesystem Server
:컴퓨터: 기술
:렌치: 도구
:패키지: 설치
:heavy_check_mark: 필수 조건
다음 소프트웨어를 설치해야 합니다.
노드.js (>=18.0.0)
pnpm (>=8.0.0)
Docker (선택 사항)
Docker Compose (선택 사항)
:arrow_down: 저장소 복제
지엑스피1
:arrow_forward: 애플리케이션 실행
지역 개발
# Install dependencies
$ pnpm install
# Build the application
$ pnpm build
# Run the server (specify directory to allow access to)
$ pnpm start /path/to/allowed/directory
# Or use configuration file
$ pnpm start --config=config.jsonNPM 패키지 사용
# Install globally
$ npm install -g @gabrielmaialva33/mcp-filesystem
# Run the server
$ mcp-filesystem /path/to/allowed/directory
# Or use with npx (no installation needed)
$ npx @gabrielmaialva33/mcp-filesystem /path/to/allowed/directory
# Create a sample configuration file
$ npx @gabrielmaialva33/mcp-filesystem --create-config=config.jsonDocker 사용
# Build the Docker image
$ docker build -t gabrielmaialva33/mcp-filesystem .
# Run using Docker
$ docker run -i --rm -v /path/to/data:/data:ro gabrielmaialva33/mcp-filesystem /data
# Use with config file
$ docker run -i --rm -v /path/to/config.json:/app/config.json -v /path/to/data:/data gabrielmaialva33/mcp-filesystem --config=/app/config.jsonDocker Compose 사용
# Create a data directory
$ mkdir -p data
# Start the server
$ docker-compose up -d:gear: 사용법
Claude Desktop과 함께 사용
Claude Desktop은 파일 시스템 접근을 위해 이 MCP 서버를 사용하도록 구성할 수 있습니다. claude_desktop_config.json 파일에 다음을 추가하세요.
로컬 설치 사용(권장)
{
"mcpServers": {
"filesystem": {
"command": "mcp-filesystem",
"args": [
"/Users/gabrielmaia/Documents",
"/Users/gabrielmaia/Desktop",
"/Users/gabrielmaia/Downloads"
]
}
}
}실행 파일을 전역적으로 사용할 수 있도록 하세요.
# Make the binary executable
chmod +x /Users/gabrielmaia/.nvm/versions/node/v22.14.0/bin/mcp-filesystemNPX 사용하기
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@gabrielmaialva33/mcp-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}Docker 사용
참고: Docker를 사용할 때 모든 디렉터리는 기본적으로 /projects 에 마운트되어야 합니다. ro 플래그를 추가하면 디렉터리가 읽기 전용으로 설정됩니다.
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
"--mount",
"type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
"--mount",
"type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
"gabrielmaialva33/mcp-filesystem",
"/projects"
]
}
}
}사용 가능한 도구
MCP 파일 시스템 서버는 다음과 같은 도구를 제공합니다.
파일 시스템 작업
read_file : 파일의 내용을 읽습니다.
read_multiple_files : 여러 파일을 한 번에 읽습니다.
write_file : 파일을 생성하거나 덮어씁니다.
edit_file : diff 미리보기로 정확한 편집을 수행합니다.
create_directory : 재귀적으로 디렉토리를 생성합니다
list_directory : 디렉토리 내용 나열
directory_tree : 재귀적 트리 뷰를 가져옵니다
move_file : 파일을 이동하거나 이름을 바꿉니다.
search_files : 패턴과 일치하는 파일 찾기
get_file_info : 파일 메타데이터 가져오기
list_allowed_directories : 접근 가능한 디렉토리를 확인하세요
시스템 및 네트워크 운영
get_metrics : 서버 성능 지표 보기(v0.3.0+)
execute_command : 시스템 명령을 안전하게 실행합니다(v0.3.1+)
curl_request : 외부 API에 대한 HTTP 요청 실행(v1.2.0에서 제공)
curl_request 도구 사용(v1.2.0에서 제공)
curl_request 도구를 사용하면 외부 API에 HTTP 요청을 할 수 있습니다.
// Example: Making a GET request with authentication
curl_request({
url: 'https://api.example.com/data',
method: 'GET',
headers: {
Authorization: 'Bearer your_token_here',
},
})
// Example: POST request with JSON data
curl_request({
url: 'https://api.example.com/create',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: '{"name":"Example","value":123}',
})더 자세한 예제는 docs/curl-tool-examples.md 파일을 참조하세요.
:sparkles: 특징
핵심 기능
보안 액세스 : 엄격한 경로 검증을 통해 무단 액세스를 방지합니다.
파일 작업 : 파일 읽기, 쓰기, 편집 및 이동
디렉토리 작업 : 디렉토리 생성, 나열, 트리 뷰 가져오기 및 검색
메타데이터 액세스 : 파일 및 디렉터리 정보 보기
명령 실행 : 엄격한 검증을 통해 시스템 명령을 안전하게 실행합니다.
Docker 지원 : Docker 및 Docker Compose를 통한 간편한 배포
v0.3.0의 새로운 기능
구조화된 로깅 : 다양한 수준(디버그, 정보, 경고, 오류)의 자세한 로깅
성능 측정 항목 : 작업 횟수, 오류 및 실행 시간 추적
구성 관리 : JSON 구성 파일 지원
경로 캐싱 : 자주 액세스되는 경로의 성능 향상
개선된 오류 처리 : 구조화된 정보를 포함하는 특수 오류 유형
파일 크기 검증 : 너무 큰 파일 로딩 방지
CLI 개선 사항 : 도움말 명령, 버전 정보 및 구성 생성
구성 옵션
다음을 사용하여 구성 파일을 만들 수 있습니다.
$ mcp-filesystem --create-config=config.json구성 예:
{
"allowedDirectories": ["/path/to/allowed/dir1", "/path/to/allowed/dir2"],
"logLevel": "info",
"logFile": "/path/to/logs/mcp-filesystem.log",
"serverName": "secure-filesystem-server",
"serverVersion": "0.3.0",
"cache": {
"enabled": true,
"maxSize": 1000,
"ttlMs": 60000
},
"metrics": {
"enabled": true,
"reportIntervalMs": 60000
},
"security": {
"maxFileSize": 10485760,
"allowSymlinks": true,
"validateRealPath": true
}
}:writing_hand: 저자
특허
Available Tools
16 toolsbash_executeB
Execute a Bash command directly with output capture. More flexible than execute_command but still with security restrictions. Allows for direct access to Bash functionality.
Inputs: command (required), env, timeout, workingDir.
bash_pipeB
Execute a sequence of Bash commands piped together. Allows for powerful command combinations with pipes. Results include both stdout and stderr.
Inputs: commands (required), env, timeout, workingDir.
create_directoryA
Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories.
Inputs: path (required).
curl_requestB
Execute a curl request to an external HTTP API. Allows specifying URL, method, headers, and data. Useful for integrating with external services via HTTP.
Inputs: url (required), data, followRedirects, headers, +3 more.
directory_treeA
Get a recursive tree view of files and directories as a JSON structure. Each entry includes 'name', 'type' (file/directory), and 'children' for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories.
Inputs: path (required).
edit_fileA
Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.
Inputs: edits (required), path (required), dryRun.
execute_commandB
Execute a system command with security restrictions. Validates commands for safety and provides detailed output. Limited to basic system operations with security checks.
Inputs: command (required), captureOutput, timeout, workingDir.
get_file_infoA
Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.
Inputs: path (required).
get_metricsB
Returns performance metrics about server operations. Useful for monitoring and debugging.
Inputs: no named parameters.
list_allowed_directoriesA
Returns the list of directories that this server is allowed to access. Use this to understand which directories are available before trying to access files.
Inputs: no named parameters.
list_directoryA
Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.
Inputs: path (required).
move_fileA
Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.
Inputs: destination (required), source (required).
read_fileA
Read the complete contents of a file from the file system. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Only works within allowed directories.
Inputs: path (required), encoding.
read_multiple_filesA
Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.
Inputs: paths (required), encoding.
search_filesA
Recursively search for files and directories matching a pattern. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.
Inputs: path (required), pattern (required), excludePatterns.
write_fileA
Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.
Inputs: content (required), path (required), encoding.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools have distinct purposes, but there is some overlap between bash_execute, bash_pipe, and execute_command, which could cause confusion about when to use each. The descriptions help differentiate them, but the boundaries are not entirely clear, especially between bash_execute and execute_command.
All tool names follow a consistent snake_case pattern with clear verb_noun structures, such as create_directory, read_file, and search_files. There are no deviations in naming conventions, making the set predictable and easy to understand.
With 16 tools, the count is slightly high but reasonable for a filesystem server covering operations like file management, directory handling, and system commands. It includes essential tools without being overly bloated, though some consolidation might improve efficiency.
The tool set provides comprehensive coverage for filesystem operations, including CRUD for files and directories, metadata retrieval, searching, editing, and system command execution. There are no obvious gaps; agents can perform typical filesystem tasks without dead ends.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that allows AI models to safely access and interact with local file systems, enabling reading file contents, listing directories, and retrieving file metadata.10 npm10MIT
- AlicenseAqualityFmaintenanceA Model Context Protocol server that provides secure and intelligent interaction with files and filesystems, offering smart context management and token-efficient operations for working with large files and complex directory structures.2167MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides AI agents with secure access to local filesystem operations, enabling reading, writing, and managing files through a standardized interface.10110 npm54Apache 2.0
- AlicenseAqualityDmaintenanceProvides secure filesystem access for AI models through the Model Context Protocol with strict path validation, file operations, directory management, and system command execution within predefined directories.1681 npmMIT