这是一个提供文件系统操作的Model Context Protocol (MCP)服务器,用于Claude AI。
此MCP服务器提供了以下文件系统操作:
read_file: 读取文件的全部内容
path (字符串)read_multiple_files: 同时读取多个文件
paths (字符串数组)write_file: 创建新文件或覆盖现有文件
path (字符串): 文件位置content (字符串): 文件内容create_directory: 创建新目录或确保其存在
path (字符串)list_directory: 列出带有[FILE]或[DIR]前缀的目录内容
path (字符串)move_file: 移动或重命名文件和目录
source (字符串)destination (字符串)search_files: 递归搜索文件/目录
path (字符串): 起始目录pattern (字符串): 搜索模式get_file_info: 获取详细的文件/目录元数据
path (字符串)list_allowed_directories: 列出服务器被允许访问的所有目录
服务器仅允许在通过命令行参数指定的目录内进行操作。
npm installnpm run build使用一个或多个允许的目录运行服务器:
node build/index.js /path/to/allowed/dir1 /path/to/allowed/dir2
将服务器添加到您的MCP配置文件中:
{
"mcpServers": {
"filesystem-server": {
"command": "node",
"args": [
"/path/to/filesystem-server/build/index.js",
"/path/to/allowed/dir1",
"/path/to/allowed/dir2"
],
"disabled": false,
"autoApprove": []
}
}
}
ISC