
mark3labs/mcp-filesystem-server
Deployment & DevOpsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
ファイルシステム操作のためにモデルコンテキストプロトコル(MCP)を実装するGoサーバー。
概要
このMCPサーバーはモデルコンテキストプロトコル(MCP)を通じてローカルファイルシステムへの安全なアクセスを提供します。 - - 名前:ファイルシステム - 説明:ローカルファイルシステム上のファイルおよびディレクトリへのアクセス - - ファイルシステムからファイルの完全な内容を読み取る- パラメータ:パス(必須):読み取るファイルへのパス - - 複数のファイルの内容を1回の操作で読み取る- パラメータ:パス(必須):読み込むファイルパスの一覧 - - 新しいファイルを作成するか、既存のファイルを新しいコンテンツで上書きする- パラメータ:パス(必須):ファイルを書き込むパス、content(必須):ファイルに書き込むコンテンツ - - ファイルとディレクトリのコピー- パラメータ:ソース(必須):ファイルまたはディレクトリのソースパス、宛先(必須):宛先パス - - ファイルやディレクトリの移動または名前変更- パラメータ:ソース(必須):ファイルやディレクトリのソースパス、宛先(必須):宛先パス - - ファイルシステムからファイルやディレクトリを削除する- パラメータ:パス(必須):...
概要(AI 翻訳)
このMCPサーバーはモデルコンテキストプロトコル(MCP)を通じてローカルファイルシステムへの安全なアクセスを提供します。
構成要素
リソース
- file://
- 名称:ファイルシステム
- 説明:ローカルファイルシステム上のファイルやディレクトリへのアクセス
道具
ファイル操作
-
read_file
-
ファイルシステムからファイルの完全な内容を読み取る
-
パラメータ:
path(必須):読み取るファイルへのパス -
read_multiple_files
-
単一の操作で複数のファイルの内容を読み取る
-
パラメータ:
paths(必須):読み込むファイルパスの一覧 -
write_file
-
新しいファイルを作成するか、既存のファイルを新しいコンテンツで上書きする
-
パラメータ:
path(必須):ファイルを書き込むパス、content(必須):ファイルに書き込む内容 -
copy_file
-
コピーファイルおよびディレクトリ
-
パラメータ:
source(必須):ファイルまたはディレクトリのソースパス、destination(必須):宛先パス -
move_file
-
ファイルやディレクトリの移動や名前変更
-
パラメータ:
source(必須):ファイルまたはディレクトリのソースパス、destination(必須):宛先パス -
delete_file
-
ファイルシステムからファイルやディレクトリを削除する
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
MCP Filesystem Server
This MCP server provides secure access to the local filesystem via the Model Context Protocol (MCP).
Components
Resources
- file://
- Name: File System
- Description: Access to files and directories on the local file system
Tools
File Operations
-
read_file
- Read the complete contents of a file from the file system
- Parameters:
path(required): Path to the file to read
-
read_multiple_files
- Read the contents of multiple files in a single operation
- Parameters:
paths(required): List of file paths to read
-
write_file
- Create a new file or overwrite an existing file with new content
- Parameters:
path(required): Path where to write the file,content(required): Content to write to the file
-
copy_file
- Copy files and directories
- Parameters:
source(required): Source path of the file or directory,destination(required): Destination path
-
move_file
- Move or rename files and directories
- Parameters:
source(required): Source path of the file or directory,destination(required): Destination path
-
delete_file
- Delete a file or directory from the file system
- Parameters:
path(required): Path to the file or directory to delete,recursive(optional): Whether to recursively delete directories (default: false)
-
modify_file
- Update file by finding and replacing text using string matching or regex
- Parameters:
path(required): Path to the file to modify,find(required): Text to search for,replace(required): Text to replace with,all_occurrences(optional): Replace all occurrences (default: true),regex(optional): Treat find pattern as regex (default: false)
Directory Operations
-
list_directory
- Get a detailed listing of all files and directories in a specified path
- Parameters:
path(required): Path of the directory to list
-
create_directory
- Create a new directory or ensure a directory exists
- Parameters:
path(required): Path of the directory to create
-
tree
- Returns a hierarchical JSON representation of a directory structure
- Parameters:
path(required): Path of the directory to traverse,depth(optional): Maximum depth to traverse (default: 3),follow_symlinks(optional): Whether to follow symbolic links (default: false)
Search and Information
-
search_files
- Recursively search for files and directories matching a pattern
- Parameters:
path(required): Starting path for the search,pattern(required): Search pattern to match against file names
-
search_within_files
- Search for text within file contents across directory trees
- Parameters:
path(required): Starting directory for the search,substring(required): Text to search for within file contents,depth(optional): Maximum directory depth to search,max_results(optional): Maximum number of results to return (default: 1000)
インストール
docker run -i --rm ghcr.io/mark3labs/mcp-filesystem-server:latest /path/to/allowed/directory設定
{
"mcpServers": {
"filesystem": {
"command": "mcp-filesystem-server",
"args": ["/path/to/allowed/directory", "/another/allowed/directory"]
}
}
}