MM

meonji-mon/mcp-synolink

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

27 stars 9 forks 质量 53 趋势 0

用于Synology NAS文件操作的MCP服务器

概览

一台Node.js服务器,实现了用于 Synology NAS 文件操作的模型上下文协议(MCP)。该服务器允许您通过 Claude 或其他兼容的 AI 助手与您的 Synology NAS 设备交互。 - 登录/登出Synology DSM - 列表文件和文件夹 - 下载文件内容 - 上传文件 - 创建文件夹 - 删除文件/文件夹 - 移动/重命名文件和文件夹 - 搜索功能 - 创建和列表共享链接 - 获取服务器信息 - 获取配额信息 - Node.js 18及以上 - npm或纱线 - 带有DSM 6.0及以上标准的Synology NAS - 可访问您的Synology NAS 把这点记到你的claude_desktop_config.json里: 然后把这句话加到你的claude_desktop_config.json里: 始终注意使用凭证。当前实现以命令行参数形式发送密码,可能在进程列表中可见。为了在生产环境中提升安全性,考虑实现替代认证方法。

概述(AI 翻译)

一台Node.js服务器,实现了用于 Synology NAS 文件操作的模型上下文协议(MCP)。该服务器允许您通过 Claude 或其他兼容的 AI 助手与您的 Synology NAS 设备交互。

特色

  • 登录/登出至Synology DSM
  • 列表文件和文件夹
  • 下载文件内容
  • 上传文件
  • 创建文件夹
  • 删除文件/文件夹
  • 移动/重命名文件和文件夹
  • 搜索功能
  • 创建和列表共享链接
  • 获取服务器信息
  • 获取配额信息

先修条件

  • Node.js 18岁及以上
  • NPM或纱线
  • 配备DSM 6.0及以上版本的Synology NAS
  • 访问你的Synology NAS网络

安装

克隆这个仓库:

安装依赖:

构建项目:

使用 Claude Desktop

Node.js方法

将此加到你的claude_desktop_config.json中:

Docker 方法

构建 Docker 镜像:

然后把这个加到你的claude_desktop_config.json上:

安全说明

始终注意使用凭证。当前实现以命令行参数形式发送密码,可能在进程列表中可见。为了在生产环境中提升安全性,考虑实现替代认证方法。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

SynoLink MCP Server

A Node.js server implementing Model Context Protocol (MCP) for Synology NAS file operations. This server allows you to interact with your Synology NAS device through Claude or other compatible AI assistants.

Features

  • Login/logout to Synology DSM
  • List files and folders
  • Download file contents
  • Upload files
  • Create folders
  • Delete files/folders
  • Move/rename files and folders
  • Search functionality
  • Create and list sharing links
  • Get server information
  • Get quota information

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • Synology NAS with DSM 6.0 or higher
  • Network access to your Synology NAS

Installation

Clone this repository:

git clone https://github.com/Do-Boo/MCP-SynoLink.git
cd MCP-SynoLink

Install dependencies:

npm install

Build the project:

npm run build

Usage with Claude Desktop

Node.js Method

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "synolink": {
      "command": "node",
      "args": [
        "/path/to/MCP-SynoLink/dist/index.js",
        "https://your-synology-url:port",
        "your-username",
        "your-password"
      ]
    }
  }
}

Docker Method

Build the Docker image:

docker build -t mcp/synolink .

Then add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "synolink": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/synolink",
        "https://your-synology-url:port",
        "your-username",
        "your-password"
      ]
    }
  }
}

Security Note

Always be careful with credentials. The current implementation sends the password as a command-line argument, which may be visible in process listings. For improved security in a production environment, consider implementing alternative authentication methods.

API Documentation

The server provides the following tools:

Authentication Tools

  • login

    • Authenticates with the Synology NAS
    • No parameters required (uses credentials from command line)
  • logout

    • Logs out from the Synology NAS
    • No parameters required

File Management Tools

  • list_folders

    • Lists files and folders in a directory
    • Input: path (string) - Path to list files from, e.g., ‘/photos’
  • get_file

    • Gets the content of a file
    • Input: path (string) - Full path to the file on Synology NAS
  • upload_file

    • Uploads a file to Synology NAS
    • Inputs:
      • path (string) - Destination path on Synology NAS including filename
      • content (string) - Content of the file to upload
  • create_folder

    • Creates a new folder
    • Inputs:
      • path (string) - Full path to create folder at
      • name (string) - Name of the new folder
  • delete_item

    • Deletes a file or folder
    • Input: path (string) - Full path to the file or folder to delete
  • move_item

    • Moves or renames a file or folder
在 GitHub 查看完整 README

安装

docker run -i --rm mcp/synolink https://your-synology-url:port your-username your-password
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "synolink": { "command": "node", "args": [ "/path/to/MCP-SynoLink/dist/index.js", "https://your-synology-url:port", "your-username", "your-password" ] } } }