# stagenth · file-relay MCP server

Cloud file relay: chunked uploads, folders, share links, inline text reads, ZIP packing.

## Links
- Registry page: https://www.getdrio.com/mcp/com-stagenth-file-relay

## Install
- Endpoint: https://stagenth.com/mcp/file-relay/
- Auth: Auth required by registry metadata

## Setup notes
- Remote header: Authorization (required; secret)
- The upstream registry signals required auth or secrets.
- Remote endpoint: https://stagenth.com/mcp/file-relay/
- Header: Authorization

## Tools
- get_user_quota - 查看当前用户的存储配额使用情况。 Endpoint: https://stagenth.com/mcp/file-relay/
- list_files - 列出当前用户的文件 (默认递归遍历整个文件夹层级).

        返回值同时附带 ``subfolders``(直接子文件夹列表) 与 ``has_subfolders``
        提示, 帮助 AI 感知层级结构。若用户问“目录结构 / 树”, 直接调
        ``get_folder_tree`` 拿到 ASCII 树状图更直观。

        每个 item 都有 ``folder_path`` 字段标注它的实际归属, 同名文件不会
        因递归而混淆。
         Endpoint: https://stagenth.com/mcp/file-relay/
- search_files - 在当前用户的所有文件中搜索。 Endpoint: https://stagenth.com/mcp/file-relay/
- get_file_info - 查询单个文件详情。file_id 与 file_uuid 提供其一即可。 Endpoint: https://stagenth.com/mcp/file-relay/
- delete_file - 删除一个文件。 Endpoint: https://stagenth.com/mcp/file-relay/
- delete_files - 批量删除文件（移入回收站，30 天内可在网页端恢复）。

        逐个删除，单个失败不影响其余；返回每个 ID 的结果。
         Endpoint: https://stagenth.com/mcp/file-relay/
- upload_file - 上传一个文件（base64 形式）到用户的文件中转站。

        仅在用户明确要求把某个文件存入中转站 / 传输到其他设备 / 分享给他人时调用。
        上传会占用用户的付费存储配额并按传输量扣 credit —— 不要主动上传
        中间结果、日志、临时文件或用户没有要求保存的命令输出。

        用 init + 单次分片 + complete 的方式复用现有服务。
        适合中小文件（< 20MB）。超大文件请使用 Web 端分片上传。

        新增 folder_path: 上传到指定文件夹, 默认根目录 "/"。
         Endpoint: https://stagenth.com/mcp/file-relay/
- upload_init - 发起分片上传会话 (第 1 步 / 共 3 步)。

        返回:
          - instant=true 时, file 字段是已秒传的文件元数据, 直接用即可
          - instant=false 时, 用 session_uuid + 服务端给的 chunk_size/total_chunks
            逐片调 upload_chunk, 最后调 upload_complete。
         Endpoint: https://stagenth.com/mcp/file-relay/
- upload_chunk - 上传单个分片 (第 2 步 / 共 3 步)。

        可并发调用, 后端内部会记录已上传索引。网络抖动重试同一 chunk_index
        安全 (服务端幂等写临时块)。
         Endpoint: https://stagenth.com/mcp/file-relay/
- upload_complete - 合并所有分片 (第 3 步 / 共 3 步)。

        两种路径:
          - 直传 (推荐, shim 走这条): parts 带齐所有 (part_number, etag),
            后端调 OSS CompleteMultipartUpload 服务端合并, 不耗 ECS 内存/带宽。
          - 中转 (兼容老 shim / 网页端): 不传 parts, 从临时分片合并。

        返回最终 file 元数据 (id, uuid, filename, size_bytes, sha256, ...).
         Endpoint: https://stagenth.com/mcp/file-relay/
- download_file - 下载一个文件, 按 MCP spec 2025-06-18 的原生 content 类型返回。

        根据文件 category 自动选择最合适的 MCP content block 类型:
        - image (jpg/png/webp/...)  → content[0].type = "image"
          (base64 + mimeType; AI 客户端原生显示图片, 多模态 LLM 可直接看图)
        - audio (mp3/wav/...)       → content[0].type = "audio"
          (base64 + mimeType; AI 客户端原生播放, 多模态模型可直接听)
        - text/code + as_text=true  → content[0].type = "text"
          (UTF-8 字符串; 适合代码/文档阅读分析)
        - 其他所有 (video / document / archive / 大文本 / ...)
                                    → content[0].type = "resource_link"
          (15 分钟有效的 URL + mimeType + size; 签名自带, 无需 Authorization;
           AI 用 bash curl 拉字节, 或提示用户点链接在浏览器下载)

        【限速】所有分支都遵守会员档位的 download_speed_bytes_per_sec 设定:
          - image / audio / text 分支走 astream_file(throttle=...) 读字节再 base64
          - resource_link 分支: 链接指向 /api/v1/mcp-download/{token}, 目标路由
            也用同一套 astream_file + throttle 算法 (详见 api/v1/mcp_download.py)

        【零副作用】不再使用 share_service.create_share —— MCP 下载不会在你的
        账号里留下任何公开分享记录, 不进分享面板, 不计分享审计。
         Endpoint: https://stagenth.com/mcp/file-relay/
- create_share_link - 为文件生成一个分享链接。 Endpoint: https://stagenth.com/mcp/file-relay/
- download_shared_file - 通过分享链接下载文件（无需是文件拥有者）。

        适合别人发给你一个 /s/<uuid> 链接,你想让 AI 直接读取其内容的场景。
        不会占用你的存储配额。下载计入分享者的月流量。
         Endpoint: https://stagenth.com/mcp/file-relay/
- import_shared_file - 把别人分享的文件导入到当前登录用户的文件列表。

        等价于「下载后再上传」,但服务端直接从源文件拷贝字节流、仍走配额/白名单/秒传检查,
        所以比本地往返更快、也不消耗带宽。
        下载量计入分享者的月流量;存储占用计入当前用户的配额。
         Endpoint: https://stagenth.com/mcp/file-relay/
- list_folders - 列出文件夹 (类似 ``ls -d`` 只看目录)。

        路径不存在抛 folder_not_found。要列文件用 list_files。
         Endpoint: https://stagenth.com/mcp/file-relay/
- create_folder - 创建文件夹 (类似 ``mkdir -p``)。

        幂等: 如果路径已经存在, 直接返回该文件夹元数据, 不抛错。
         Endpoint: https://stagenth.com/mcp/file-relay/
- move_file - 把文件挪到指定文件夹 (类似 ``mv file /target/dir/``)。

        OSS 字节不动, 只改逻辑路径, 操作几毫秒完成。
         Endpoint: https://stagenth.com/mcp/file-relay/
- move_folder - 移动整个文件夹 (类似 ``mv /工作/项目A /归档/``)。

        会递归更新所有后代的逻辑路径。OSS 字节不动。
         Endpoint: https://stagenth.com/mcp/file-relay/
- rename_folder - 改名 (不动 parent)。 Endpoint: https://stagenth.com/mcp/file-relay/
- delete_folder - 删除文件夹 (类似 ``rmdir`` 或 ``rm -r``)。

        内部 ready/locked 文件按"软删进回收站"处理, 30 天后才物删 OSS 字节;
        用户可在该窗口期内通过回收站恢复。
         Endpoint: https://stagenth.com/mcp/file-relay/
- delete_folders - 批量删除文件夹 (delete_folder 的批量版)。

        逐个删除, 单个失败不影响其余; 返回每个路径的结果。
        文件按软删进回收站处理, 30 天内可在网页端恢复。
         Endpoint: https://stagenth.com/mcp/file-relay/
- get_folder_tree - 以 ASCII 树状图返回用户的文件夹/文件层级 (推荐: 用户问“目录结构”时用这个).

        返回:
          {
            "root_path": "/",
            "tree": "ASCII 字符串",
            "stats": {"folders": N, "files": M, "truncated": bool}
          }
         Endpoint: https://stagenth.com/mcp/file-relay/
- scrape_url - 抓取一个公开网页，返回干净的 Markdown（供 AI 阅读/总结/提取）。

        只抓公开网页，禁止内网/保留地址；不生成任何内容，只做抓取与格式转换。
         Endpoint: https://stagenth.com/mcp/file-relay/
- file_read - 直接返回文本类文件的内容（txt/md/csv/json/日志/代码等），AI 免下载即读。

        二进制文件（图片/压缩包/Office 等）请用 download_file；超长文本按 max_bytes 截断并标记。
         Endpoint: https://stagenth.com/mcp/file-relay/
- zip_files - 把多个文件打包成一个 ZIP，存入文件中转站并返 15 分钟下载 URL。

        单包上限 50 个文件 / 200MB 原始体积；同名文件自动加序号。
         Endpoint: https://stagenth.com/mcp/file-relay/

## Resources
Not captured

## Prompts
Not captured

## Metadata
- Owner: com.stagenth
- Version: 1.1.0
- Runtime: Streamable Http
- Transports: HTTP
- License: Not captured
- Language: Not captured
- Stars: Not captured
- Updated: Jul 5, 2026
- Source: https://registry.modelcontextprotocol.io
