No description
- TypeScript 53.5%
- JavaScript 46.5%
| src | ||
| .gitignore | ||
| .mcp.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
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