Skip to main content
Glama
Seafile MCP Server

Seafile MCP Server

by 5p00kyy

Seafile MCP Server

MCP (Model Context Protocol) server for Seafile cloud storage. Access your self-hosted files from AI assistants like Claude, OpenCode, and other MCP clients.

Features

  • List, read, and write files in your Seafile libraries

  • Create and manage directories

  • Move, copy, and rename files

  • Search across libraries

  • Supports both account-based and library-specific authentication

Related MCP server: SharePoint MCP Server

Installation

Using pip

pip install seafile-mcp

From source

git clone https://github.com/5p00kyy/seafile-mcp.git
cd seafile-mcp
pip install -e .

Configuration

Create a .env file or set environment variables:

Required

  • SEAFILE_SERVER_URL: Your Seafile server URL

Authentication (choose one)

Option 1: Account Authentication (access all libraries)

  • SEAFILE_USERNAME: Your email

  • SEAFILE_PASSWORD: Your password

Option 2: Library Token (single library, more secure)

  • SEAFILE_REPO_TOKEN: API token from library settings

  • SEAFILE_REPO_ID: Library UUID

Optional

  • SEAFILE_MAX_READ_SIZE: Max file size to read (default: 1MB)

  • SEAFILE_MAX_WRITE_SIZE: Max upload size (default: 10MB)

  • SEAFILE_TIMEOUT: Request timeout in seconds (default: 30)

Usage with OpenCode

Add to your OpenCode MCP configuration:

{
  "mcpServers": {
    "seafile": {
      "command": "python",
      "args": ["-m", "seafile_mcp"],
      "env": {
        "SEAFILE_SERVER_URL": "https://your-seafile.com",
        "SEAFILE_USERNAME": "user@example.com",
        "SEAFILE_PASSWORD": "your-password"
      }
    }
  }
}

Or with library token:

{
  "mcpServers": {
    "seafile": {
      "command": "seafile-mcp",
      "env": {
        "SEAFILE_SERVER_URL": "https://your-seafile.com",
        "SEAFILE_REPO_TOKEN": "your-api-token",
        "SEAFILE_REPO_ID": "library-uuid"
      }
    }
  }
}

Available Tools

Tool

Description

seafile_list_libraries

List all accessible libraries

seafile_get_library_info

Get library details

seafile_list_directory

List directory contents

seafile_read_file

Read file content

seafile_write_file

Write text to a file

seafile_upload_file

Upload binary file (base64)

seafile_create_directory

Create a folder

seafile_delete

Delete file or folder

seafile_move

Move file or folder

seafile_copy

Copy file or folder

seafile_rename

Rename file or folder

seafile_get_file_info

Get file metadata

seafile_get_download_link

Get download URL

seafile_search

Search files by name

File Handling

  • Text files: Content returned directly (up to MAX_READ_SIZE)

  • Binary files: Returns metadata and download URL

  • Large files: Returns download URL instead of content

Security Notes

  • Use library tokens for production (limits access to single library)

  • Never commit .env files with credentials

  • API tokens can be revoked from Seafile web interface

License

MIT

Available Tools

14 tools
seafile_copyA

Copy a file or directory within a Seafile library.

Args:
    repo_id: The library/repository ID.
    src_path: The path of the file or directory to copy.
    dst_path: The destination directory path.

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), src_path (required), dst_path (required). Returns: Represents the result of a file/directory operation.

seafile_create_directoryB

Create a new directory in a Seafile library.

Args:
    repo_id: The library/repository ID.
    path: The full path of the directory to create.

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), path (required). Returns: Represents the result of a file/directory operation.

seafile_deleteA

Delete a file or directory from Seafile.

Warning: This operation is irreversible. Deleted items may be recoverable
from the library's trash for a limited time, depending on server settings.

Args:
    repo_id: The library/repository ID.
    path: The path to the file or directory to delete.

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), path (required). Returns: Represents the result of a file/directory operation.

seafile_get_file_infoB

Get metadata about a file.

Args:
    repo_id: The library/repository ID.
    path: The path to the file within the library.

Returns:
    FileInfo containing file metadata including size, mtime, and MIME type.

Inputs: repo_id (required), path (required). Returns: Represents file metadata.

seafile_get_library_infoC

Get information about a specific library.

Args:
    repo_id: The unique identifier of the library.

Returns:
    Library object containing detailed library metadata.

Inputs: repo_id (required). Returns: Represents a Seafile library (repository).

seafile_list_directoryC

List files and folders in a directory.

Args:
    repo_id: The library/repository ID.
    path: The directory path to list (default: root "/").

Returns:
    List of DirEntry objects for files and subdirectories.

Inputs: repo_id (required), path. Returns: result

seafile_list_librariesA

List all accessible Seafile libraries.

Returns a list of all libraries (repositories) the authenticated user has access to.
Note: This operation requires account-based authentication and may not work
with repository token authentication.

Returns:
    List of Library objects containing library metadata.

Inputs: no named parameters. Returns: result

seafile_moveB

Move a file or directory within a Seafile library.

Args:
    repo_id: The library/repository ID.
    src_path: The current path of the file or directory.
    dst_path: The destination directory path.

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), src_path (required), dst_path (required). Returns: Represents the result of a file/directory operation.

seafile_read_fileA

Read a file from Seafile.

For text files within the size limit, returns the file content directly.
For binary files or files exceeding the size limit, returns a download URL.

Args:
    repo_id: The library/repository ID.
    path: The path to the file within the library.

Returns:
    FileContent with either text content or a download URL.

Inputs: repo_id (required), path (required). Returns: Represents file content or download information.

seafile_renameA

Rename a file or directory in Seafile.

Args:
    repo_id: The library/repository ID.
    path: The current path of the file or directory.
    new_name: The new name (not a path, just the name).

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), path (required), new_name (required). Returns: Represents the result of a file/directory operation.

seafile_upload_fileA

Upload a binary file to Seafile.

Use this for uploading binary files by providing the content as base64.
For text files, prefer seafile_write_file instead.

Args:
    repo_id: The library/repository ID.
    path: The path where the file should be uploaded.
    base64_content: The file content encoded as base64.

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), path (required), base64_content (required). Returns: Represents the result of a file/directory operation.

seafile_write_fileA

Create or update a text file in Seafile.

If the file exists, it will be overwritten. If it doesn't exist, it will be created.
Parent directories must exist.

Args:
    repo_id: The library/repository ID.
    path: The path where the file should be written.
    content: The text content to write.

Returns:
    OperationResult indicating success or failure.

Inputs: repo_id (required), path (required), content (required). Returns: Represents the result of a file/directory operation.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific file operations or metadata retrieval in Seafile. There is no overlap; for example, seafile_copy vs seafile_move, seafile_upload_file vs seafile_write_file, and seafile_read_file vs seafile_get_download_link all serve different functions with clear boundaries described in their documentation.

    Naming Consistency5/5

    All tools follow a consistent 'seafile_verb_noun' pattern with snake_case throughout, such as seafile_list_directory, seafile_create_directory, and seafile_get_file_info. This uniformity makes the tool set predictable and easy to navigate for an agent.

    Tool Count5/5

    With 14 tools, this server is well-scoped for managing a Seafile file storage system. It covers essential operations like CRUD for files and directories, metadata access, search, and upload/download, which is appropriate for the domain without being overly sparse or bloated.

    Completeness5/5

    The tool set provides comprehensive coverage for file management in Seafile, including create, read, update, delete, copy, move, rename, list, search, and metadata retrieval. There are no obvious gaps; it supports full lifecycle operations for files and directories, ensuring agents can handle typical workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects Claude to your self-hosted or cloud-based Seafile storage for managing libraries and files through natural language. It enables users to browse directories, read file contents, and perform file operations like moving, renaming, or searching across their private infrastructure.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to manage Microsoft SharePoint documents and folders through natural language, supporting operations like listing, reading, uploading, updating, deleting, and creating Office files.
      13
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Enables AI assistants to manage Seafile files, folders, and libraries through MCP, with multi-user credential storage and dual token-based authentication.
      27
      MIT