No description
  • TypeScript 53.5%
  • JavaScript 46.5%
Find a file
2026-02-24 09:26:41 +01:00
src Initial commit: Seafile MCP server with working search 2026-02-23 18:36:43 +01:00
.gitignore Initial commit: Seafile MCP server with working search 2026-02-23 18:36:43 +01:00
.mcp.json Initial commit: Seafile MCP server with working search 2026-02-23 18:36:43 +01:00
package-lock.json Initial commit: Seafile MCP server with working search 2026-02-23 18:36:43 +01:00
package.json Initial commit: Seafile MCP server with working search 2026-02-23 18:36:43 +01:00
README.md Add README with setup, tools reference, and architecture overview 2026-02-24 09:26:41 +01:00
tsconfig.json Initial commit: Seafile MCP server with working search 2026-02-23 18:36:43 +01:00

herosea-mcp

MCP (Model Context Protocol) server for Seafile file management. Allows AI assistants like Claude to read, write, search, and manage files on a Seafile server.

Features

  • Dual token support: Account tokens (full multi-library access) or Repo tokens (single library, more secure)
  • Full CRUD: read, write, upload, delete files and directories
  • File search: search by filename across all libraries or within a specific one (uses Seafile v2.1 API, works on Community Edition)
  • Library management: list and browse all accessible libraries

Tools Provided

Tool Description Token
ping Test server connection both
list_libraries List all accessible libraries account
get_library_info Get connected library info repo
list_directory List files/folders in a directory both
get_file_info Get file metadata both
read_file Read text file contents both
upload_file Upload or update a file both
create_directory Create a new directory both
delete_item Delete a file or directory both
search_files Search files by name both

Setup

Prerequisites

  • Node.js >= 18
  • A Seafile server with API access
  • A Seafile API token (account or repo token)

Install & Build

npm install
npm run build

Configuration

Set environment variables:

export SEAFILE_URL="https://your-seafile-server.com"
export SEAFILE_TOKEN="your-api-token"
export SEAFILE_TOKEN_TYPE="account"  # or "repo"

Getting a Seafile API Token

# Account token (full access)
curl -d "username=you@example.com&password=yourpassword" \
  https://your-seafile-server.com/api2/auth-token/

# Repo token (single library) — generate via Seafile web UI

Claude Code Integration

Add to your .mcp.json:

{
  "mcpServers": {
    "seafile": {
      "command": "node",
      "args": ["dist/index.js"],
      "env": {
        "SEAFILE_URL": "https://your-seafile-server.com",
        "SEAFILE_TOKEN": "${SEAFILE_TOKEN}",
        "SEAFILE_TOKEN_TYPE": "account"
      }
    }
  }
}

Architecture

src/
├── index.ts            # MCP server, tool definitions, request handling
└── seafile-client.ts   # Seafile REST API client wrapper

The server uses stdio transport and exposes different tool sets depending on the token type. Account tokens get multi-library tools; repo tokens get single-library tools with implicit library context.

License

MIT