Skip to main content
Glama
xtawa

mcp_file_manager

by xtawa

mcp_file_manager

通过 mcp 服务实现用户/ai agent 上传/下载文件并生成对应链接,每次进行上传操作时都生成对应标识码供 ai 查找,文件 24 小时后自动删除。

一个开箱即用的文件中转 MCP 服务:AI 和人都可以把文件扔进来,拿到一个标识码和一个可直接分享的下载链接;之后只要报出标识码,AI 就能重新找到并读取这个文件。所有文件默认保留 24 小时,到期自动删除

特点

  • 双向可用:AI 用 MCP 工具上传/下载;人用浏览器页面上传/下载。两边共用同一套存储与标识码。

  • 标识码友好:Crockford Base32(已剔除 I/L/O/U),展示为 7K2QF-9XM4T;查找时大小写、连字符、0/O 1/I/l 混淆全都宽容。

  • 24 小时自动清理:后台守护任务每 10 分钟扫一次,启动时也扫一次(覆盖停机期间到期的文件),同时回收无主文件与失效上传链接。

  • 全流式写盘:边写盘边算 SHA-256 并计数,超限立即中断,不把整个文件读进内存。

  • 四种上传源:base64 内容、纯文本、服务器本地路径、远程 URL。

  • 两种传输stdio(供 Claude Desktop / Cursor 等客户端拉起)与无状态 Streamable HTTP(供远程部署)。

  • 零依赖存储:本地文件系统 + 原子写入的 index.json,不需要数据库或对象存储。

关于保留期:仓库最初的描述是 14 天,本实现按最新要求改为 24 小时。保留期完全可配(FM_TTL_HOURS),如需恢复 14 天只需设为 336

Related MCP server: agent-drop

快速开始

需要 Node.js >= 20.11。

npm install
cp .env.example .env   # 可选,不改也能跑
npm run dev            # 开发模式:stdio + 本地文件服务
npm run build && npm start

启动后浏览器打开 http://localhost:8787 即为上传页面。

作为远程 HTTP 服务部署:

FM_HOST=0.0.0.0 FM_API_TOKEN=你的强密钥 npm run start:http
# MCP 端点:POST http://<host>:8787/mcp

接入 MCP 客户端(stdio)

参见 examples/claude_desktop_config.json

{
  "mcpServers": {
    "file-manager": {
      "command": "node",
      "args": ["/结对路径/mcp_file_manager/dist/index.js"],
      "env": {
        "FM_DATA_DIR": "/结对路径/mcp_file_manager/data",
        "FM_PUBLIC_BASE_URL": "http://localhost:8787",
        "FM_TTL_HOURS": "24"
      }
    }
  }
}

stdio 模式下会同时启动本地文件 HTTP 服务,否则生成的下载链接没人响应。不需要时加 --no-http。 日志一律输出到 stderr,stdout 留给 MCP 的 JSON-RPC 通道。

前端页面

页面在 public/ 下,是三个普通静态文件(HTML + CSS + 原生 JS),无构建步骤、无前端依赖,由 Express 直接托管:

入口

用途

GET /

完整上传页:自己传文件、拿标识码、反查旧标识码

GET /u/:ticket

同一份页面的“一次性上传链接”形态,发给外部的人使用

GET /assets/*

public/ 里的样式与脚本

功能:

  • 三种选文件方式:拖拽、点击选择、Ctrl / ⌘ + V 直接粘贴文件或截图;支持多文件排队逐个上传。

  • 真实上传进度:用 XHR 上传,逐文件显示百分比进度条,失败的条目会留在列表里可直接重试。

  • 标识码是主角:上传完成后用大号等宽字体展示 7K2QF-9XM4T,点一下即复制;另外提供“复制链接”与“复制给 AI”(一次拿到标识码 + 文件名 + 下载地址 + 到期时间)。

  • 到期倒计时:每张卡片把 expiresAt 渲染为本地时间并满上“还剩 N 小时”,过期后变红并提示已被自动删除。

  • 标识码反查:输入标识码即可重新拿回下载链接(走 GET /api/files/:code,大小写与连字符不敏感)。

  • 本机历史:最近 20 次上传存在 localStorage(不上传服务器、到期自动消失),方便事后回查标识码。

  • 高级选项:备注、标签、自定义保留小时数(上限受 FM_MAX_TTL_HOURS 约束)。

  • 自适应:页面启动时拉 GET /api/config,自动展示当前保留策略与单文件上限(超限文件在上传前就被拦住);仅当服务端设了 FM_API_TOKEN 时才显示 Token 输入框(保存在 sessionStorage)。

  • 适配手机屏幕,跟随系统浅色/深色主题。

部署时请让 public/dist/ 一同发布(npm 包的 files 与 Dockerfile 都已包含);缺少时页面会直接提示而不是返回空白。

MCP 工具

工具

作用

关键参数

upload_file

上传文件,返回标识码与链接

content(base64) / text / path / url 四选一,nametagsttlHours

download_file

按标识码取回内容

codesavePathencoding(auto/utf-8/base64/none)

get_file_info

只看元数据与链接

code

list_files

列表/搜索(忘记标识码时用)

querytaglimitsort

delete_file

不等到期,立即删除

code

extend_expiry

重算为“从现在起再保留 N 小时”

codehours

create_upload_link

生成给人用的临时上传页面

noteexpiresInMinutesmaxUsesfileTtlHours

sweep_expired

手动触发一次到期清理

get_storage_stats

文件数、占用、保留策略、下一个到期时间

典型对话:

  1. 用户:“把这份报价单存一下。” → AI 调 upload_file → 回复标识码 7K2QF-9XM4T + 下载链接 + “24 小时后自动删除”。

  2. 用户(稍后):“7K2QF-9XM4T 里的金额是多少?” → AI 调 download_file 直接读内容。

  3. 需要用户提供文件时:AI 调 create_upload_link → 发出一个 /u/<ticket> 链接 → 用户上传后页面直接展示标识码。

HTTP 接口

方法

路径

说明

需 Token

GET

/

上传页面

GET

/assets/*

前端静态资源

GET

/healthz

健康检查

GET

/api/config

页面渲染用的公开配置(保留期、上限、是否需 Token)

POST

/api/upload

multipart 上传(字段名 file

GET

/f/:code · /f/:code/:filename

下载(?inline 可在浏览器内预览)

否(标识码即凭证)

GET

/api/files/:code

单文件元数据 JSON

GET

/api/files

列表/搜索

DELETE

/api/files/:code

删除

POST

/api/files/:code/extend

延期,体 {"hours":48}

GET

/api/stats · POST /api/sweep

状态与手动清理

GET/POST

/u/:ticket

临时上传页面与提交

否(票据即凭证)

GET

/api/tickets/:ticket

票据详情(页面用于判定链接是否还有效)

否(票据即凭证)

POST

/mcp

无状态 Streamable HTTP MCP 端点

鉴权方式(三者均可,仅在设置了 FM_API_TOKEN 时生效):Authorization: Bearer <token>X-API-Token: <token>?token=<token>

# 上传
curl -X POST http://localhost:8787/api/upload \
  -H "Authorization: Bearer $FM_API_TOKEN" \
  -F "file=@./report.pdf" -F "tags=财务,Q3" -F "ttlHours=48"

# 下载
curl -OJ http://localhost:8787/f/7K2QF9XM4T

环境变量

变量

默认值

说明

FM_TTL_HOURS

24

默认保留时长(小时),到期自动删除

FM_MAX_TTL_HOURS

720

单次请求可申请的保留上限(30 天)

FM_SWEEP_INTERVAL_MINUTES

10

到期清理扫描间隔

FM_DATA_DIR

./data

数据目录(files/tmp/index.json

FM_HOST / FM_PORT

127.0.0.1 / 8787

HTTP 监听地址

FM_PUBLIC_BASE_URL

http://<host>:<port>

拼接对外链接用,反代/域名下必须设置

FM_API_TOKEN

写接口鉴权;非本机部署强烈建议设置

FM_MAX_UPLOAD_MB

100

单文件上限

FM_MAX_INLINE_MB

4

MCP 内联返回内容的上限,超过则只给链接

FM_ALLOW_REMOTE_FETCH

1

是否允许 url 源上传

FM_ALLOW_LOCAL_PATH

1

是否允许 path 源上传

FM_LOG_LEVEL

info

debug / info / warn / error

保留与清理策略

  • 每个文件写入时记录 expiresAt = 上传时间 + 24 小时

  • 三个时机会执行清理:服务启动时、每 10 分钟的守护任务、手动调用 sweep_expired

  • 另外,任何一次对已过期标识码的访问会返回 410 expired 并顺手删除该文件,不依赖守护任务的时序。

  • 清理同时回收:到期文件实体 + 元数据、用尽/过期的上传票据、失去元数据的孤儿文件。

  • 需要保留更久:上传时传 ttlHours,或事后调 extend_expiry;全局改默认值用 FM_TTL_HOURS

项目结构

public/
  index.html        上传页(/ 与 /u/:ticket 共用这一份)
  styles.css        样式(含深色模式与移动端适配)
  app.js            原生 JS:拖拽/粘贴、进度条、标识码复制、反查、本机历史
src/
  index.ts          启动入口(参数解析、传输选择、优雅退出)
  service.ts        全部业务逻辑(上传/下载/列表/延期/清理/统计)
  store.ts          元数据索引(串行写队列 + 临时文件原子 rename)
  storage.ts        文件实体存储(标识码命名,彻底隔结路径穿越)
  codes.ts          标识码生成 / 归一化 / 展示格式
  retention.ts      24h 到期守护任务
  config.ts errors.ts logger.ts mime.ts utils.ts version.ts
  mcp/server.ts     9 个 MCP 工具定义
  http/app.ts       Express 路由 + 静态资源 + 无状态 MCP 端点
  http/pages.ts     前端目录定位与页面下发
tests/service.test.ts

分层原则:FileManagerService 是唯一真相,MCP 层、HTTP 层与前端都只是它的薄封装,保证各入口的标识码、链接与保留期行为完全一致。

开发

npm run typecheck   # tsc --noEmit
npm test            # node --test(含“默认 24 小时”与清理行为的回归用例)
npm run build       # 只编译 TypeScript;public/ 直接发布,无需构建

Docker

docker compose up -d --build
# 或
docker build -t mcp-file-manager . && docker run -p 8787:8787 -v "$PWD/data:/data" mcp-file-manager

安全提醒

  • 标识码即凭证:拿到标识码即可下载(无需 Token),分享链接前请确认接收方。标识码空间为 32^10,无法枚举。

  • 对外暴露时请务必设置 FM_API_TOKEN,并在反代层加上 HTTPS 与频率限制。

  • 页面上的 Token 只存在当前浏览器会话(sessionStorage),不会写入磁盘持久保存。

  • 如无需让 AI 读写服务器本地文件或抓取外网,请设 FM_ALLOW_LOCAL_PATH=0FM_ALLOW_REMOTE_FETCH=0

  • 上传的原始文件名只保存在元数据里,磁盘上使用“标识码 + 白名单扩展名”命名。

后续可做

  • 可插拔存储后端(S3 / R2)与预签名直传

  • 多负载部署时把元数据换成 SQLite / Redis

  • 可选的服务端加密与病毒扫描钩子

  • 按上传者维度的配额与审计日志

Available Tools

9 tools
delete_file删除文件A
DestructiveIdempotent

立即删除指定标识码的文件与元数据,不等到期。操作不可恢复。

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes上传时返回的标识码,大小写与连字符都可以,例如 7K2QF-9XM4T 或 7k2qf9xm4t

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (destructiveHint=true, idempotentHint=true), the description adds that both file and metadata are deleted immediately and that the operation is irreversible. This provides context about scope and immediacy.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences in Chinese convey the action, target, timing, and irreversibility with zero redundant content. Information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter destructive tool with good annotations and full schema coverage, the description is adequate. It clarifies what is deleted and the immediate nature, though it doesn't describe error behavior or return values (no output schema).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema fully documents the 'code' parameter with details on case-insensitivity and examples. The description does not add further parameter details, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'immediately delete the file and metadata with the specified ID code.' It distinguishes from siblings like extend_expiry (which preserves files) and sweep_expired (bulk deletion of expired files), and explicitly mentions it is irreversible.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when you need to delete a file before its natural expiration ('不等到期'), but does not explicitly contrast with alternatives like extend_expiry or sweep_expired. Sibling list is provided but not referenced.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

download_file下载文件A
Read-only

根据标识码取回文件内容。 默认自动选择编码:文本类直接返回正文,二进制返回 base64。 传 savePath 可以直接写到服务器本地路径;文件过大时只返回链接。

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes上传时返回的标识码,大小写与连字符都可以,例如 7K2QF-9XM4T 或 7k2qf9xm4t
encodingNonone 表示只要元数据与链接
savePathNo将内容写入这个本地路径,而不是内联返回
maxInlineBytesNo内联返回的字节上限

TDQS

A3.5/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotation contradiction: the description states '传 savePath 可以直接写到服务器本地路径' (passing savePath writes directly to a server local path), which implies a write side effect, while annotations declare readOnlyHint=true. This directly contradicts the annotation's indication that the tool does not modify state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three concise, front-loaded sentences. The first sentence states the primary purpose, and the next two add essential behavior details without unnecessary filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description carries the burden of explaining return behavior; it does cover text/base64/link outcomes. However, it lacks explicit error cases, prerequisites, and alternative-tool guidance, and the readOnly/savePath contradiction reduces overall reliability.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, providing a baseline of 3. The description adds meaningful semantics beyond the schema: it explains the default auto-encoding behavior (text returns body, binary returns base64), the savePath side effect, and the 'file too large returns link' fallback, which clarifies how parameters like encoding and maxInlineBytes behave.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '根据标识码取回文件内容' (retrieve file content by identifier code). It uses a specific verb and resource, and is easily distinguished from siblings like upload_file, get_file_info, and delete_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context for use is implied: you use this when you have a file code and need its content. However, there is no explicit guidance on when to prefer this tool over alternatives (e.g., get_file_info for metadata) and no when-not-to-use exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extend_expiry延长保留时间A
Idempotent

把文件的到期时间重算为“从现在起再保留 N 小时”,上限 720 小时。

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes上传时返回的标识码,大小写与连字符都可以,例如 7K2QF-9XM4T 或 7k2qf9xm4t
hoursNo新的保留时长(小时),缺省 24

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already indicate a mutating, non-destructive, idempotent operation. The description adds valuable behavioral specifics: the expiry is recalculated from 'now', and there is a hard limit of 720 hours. This goes beyond the annotations and clarifies the operation's semantics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that immediately conveys the core behavior. It is succinct with no redundant wording, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two parameters and no output schema, the description covers the essential behavior and constraints. It does not mention return values or error handling, but given the annotations and schema coverage, it is sufficiently complete for an agent to understand when and how to invoke it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While the schema provides full descriptions for both parameters, the description enhances understanding by clarifying that hours are relative to 'now' and specifying the 720-hour upper bound, which the schema does not include. This adds semantic meaning beyond the formal schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: recalculate a file's expiration time to be retained for N hours from now, with a 720-hour cap. It uses a specific verb (recalculate/extend) and resource (file expiry), distinguishing it from siblings like delete_file or sweep_expired.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly specify when to use this tool versus alternatives. It explains what it does but lacks context like 'Use this when you need to keep a file longer' or exclusions (e.g., instead of delete_file). No when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_file_info查看文件信息A
Read-only

根据标识码查看文件名、大小、校验值、下载链接与剩余保留时间,不返回文件内容。

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes上传时返回的标识码,大小写与连字符都可以,例如 7K2QF-9XM4T 或 7k2qf9xm4t

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds valuable behavioral context beyond the readOnlyHint annotation by enumerating the exact fields returned and stating that file content is omitted. This is particularly useful since there is no output schema. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, dense sentence that efficiently conveys the action, the target resource, and the critical exclusion. It is front-loaded and every phrase earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read-only tool without an output schema, the description sufficiently lists the return fields and notes the content exclusion. It could optionally mention error behavior or permission requirements, but these are not critical given the read-only nature and annotation coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed parameter documentation including format examples and case-insensitivity. The description's reference to '标识码' adds no extra meaning beyond the schema, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies a read-only 'view' operation for file metadata (name, size, checksum, download link, retention time) and explicitly distinguishes itself from content-fetching by stating it does not return file content. This provides a specific verb, resource, and scope that differentiates it from sibling tools like download_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies that this tool is for metadata retrieval when file content is not needed, and the explicit 'does not return file content' provides a clear when-not-to-use. However, it does not name specific alternative tools like download_file, so it lacks explicit alternative guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_storage_stats查看存储状态A
Read-only

查看当前文件数量、占用空间、保留策略与下一个到期时间。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The readOnlyHint and openWorldHint annotations already communicate safety, so the description adds value by specifying the exact data returned (file count, space, retention policy, next expiry). It does not disclose potential performance costs, but that is a minor gap given the simple read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One concise sentence conveys all essential information without redundancy. It is front-loaded and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description sufficiently covers the return information by listing the four metrics. The read-only annotation completes the safety context, making this fully adequate for agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the schema provides complete coverage. The description correctly omits parameter details, and the baseline of 4 for zero-parameter tools is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: viewing current file count, occupied space, retention policy, and next expiration time. This is a specific verb-resource pair that distinguishes it from siblings like list_files (file listing) and get_file_info (single file details).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for monitoring storage overview but does not explicitly contrast with alternatives such as list_files or get_file_info. There are no exclusions or when-not-to-use conditions, so it meets the 'implied usage' level.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_files列出文件A
Read-only

列出当前未过期的文件,支持关键词、标签过滤与分页。忘记标识码时用它找回文件。

ParametersJSON Schema
NameRequiredDescriptionDefault
tagNo按标签筛选
sortNo排序方式,默认 newest
limitNo每页数量,默认 20
queryNo匹配文件名、备注、标签或标识码
offsetNo偏移量,默认 0
includeExpiredNo是否包含已到期但尚未被清理的记录

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true, so the read-only nature is already known. The description adds meaningful behavioral context: it lists only current non-expired files by default, supports filtering/pagination, and includes an includeExpired parameter for pending cleanup records. This goes beyond the annotations to clarify default scope and edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loads the core purpose, and includes a practical usage tip. Every sentence earns its place, with no fluff or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only list tool with no output schema, the description adequately explains the default scope (non-expired), filtering/pagination capabilities, and a use case. It could mention that includeExpired covers not-yet-cleaned records, but that's already in the schema. The description is sufficiently complete for selecting this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for all 6 parameters, so the schema already documents each parameter's meaning. The description adds a high-level summary of what filtering is possible (keyword, tag, pagination) but doesn't add details beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb ('列出' - list) and resource ('当前未过期的文件' - current non-expired files), and explicitly mentions filtering and pagination capabilities. It also distinguishes itself by noting this is the tool to use when the identifier is forgotten ('忘记标识码时用它找回文件'), which differentiates it from siblings like get_file_info and download_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context: it's for browsing/finding files when you don't have the identifier, and mentions it lists non-expired files. However, it doesn't explicitly list alternatives or exclusions (e.g., when to use get_file_info instead). The sibling context helps but the description itself could be more explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sweep_expired立即清理到期文件A
DestructiveIdempotent

手动触发一次到期清理(后台任务已经定时执行,一般无需调用)。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructive and idempotent behavior. The description adds valuable context that this is a manual supplement to a scheduled background task, which prevents an agent from calling it redundantly. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that is front-loaded with the purpose and immediately follows with usage context. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with strong annotations, the description is sufficient. It explains the purpose and when to avoid use, though it could explicitly mention that 'cleanup' implies permanent deletion of expired files, especially given the destructiveHint.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With zero parameters and 100% schema coverage, the description appropriately adds no parameter details. The baseline of 4 is appropriate since there is no additional semantic burden to carry.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action: '手动触发一次到期清理' (manually trigger an expired-file cleanup). It distinguishes itself from all sibling tools, which focus on file operations, by targeting the cleanup task directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when not to use it: '一般无需调用' because a background task already runs the cleanup. This gives clear guidance for an agent to avoid unnecessary invocation, though it doesn't provide alternative tool names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

upload_file上传文件A

上传一个文件并获得标识码与下载链接。 content / text / path / url 四个来源参数只能传其中一个:

  • content:base64 内容(二进制文件用这个)

  • text:纯文本内容

  • path:服务器本地文件路径

  • url:远程文件地址,由服务端抓取 默认保留 24 小时,到期自动删除;如需其他时长用 ttlHours。

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNohttp/https 远程文件地址
nameNo文件名(建议带扩展名,例如 report.pdf)
pathNo服务器可读的本地文件绝对路径
tagsNo标签,方便分类检索
textNo直接上传的纯文本内容
contentNo文件内容的 base64 编码,允许带 data URL 前缀
mimeTypeNo内容类型,缺省根据扩展名推断
ttlHoursNo保留时长(小时),默认 24,上限 720
uploadedByNo上传者标识,例如用户名或 agent 名称
descriptionNo备注,方便后续用 list_files 搜索

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already signal readOnly=false and destructive=false, and the description adds non-obvious behaviors: default 24-hour retention with auto-deletion, base64 for binary content, server-side URL fetching, and source mutual exclusivity. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the main purpose, followed by a practical bulleted list. Every sentence earns its place by conveying non-obvious constraints or defaults.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter upload tool with no output schema, the description covers core behavior, source alternatives, and retention policy. It could mention response format or size limits, but the provided guidance is sufficient for selecting and invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds critical semantics beyond the schema: mutual exclusivity among source parameters, binary vs. text handling, and the default/range of ttlHours. Other params like tags and uploadedBy rely on the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool uploads a file and returns an identification code and download link, with a specific verb and resource. It is distinct from sibling tools like download_file, delete_file, and list_files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly explains that only one of content/text/path/url may be used and describes the appropriate scenario for each. It also gives the default retention and how to override via ttlHours, though it does not explicitly contrast with sibling upload link creation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 9 tool updatesv0.1.0
    • First observedcreate_upload_link
    • First observeddelete_file
    • First observeddownload_file
    • First observedextend_expiry
    • First observedget_file_info
    • First observedget_storage_stats
    • First observedlist_files
    • First observedsweep_expired
    • First observedupload_file

TDQS

A4.2/5.0
Disambiguation5/5

Each tool targets a distinct operation: upload, download, metadata lookup, listing, deletion, expiry extension, upload link creation, cleanup, and stats. There is no overlap that would cause an agent to confuse one tool with another.

Naming Consistency5/5

All tool names follow a strict verb_noun pattern in snake_case (e.g., download_file, list_files, extend_expiry). The naming is perfectly uniform and predictable.

Tool Count5/5

With 9 tools, the set is well-scoped for a file management server. Each tool serves a clear purpose without redundancy, and the count falls comfortably in the optimal 3-15 range.

Completeness5/5

The tool surface covers the full lifecycle of temporary file storage: create (upload_file, create_upload_link), read (download_file, get_file_info), list (list_files), update (extend_expiry), delete (delete_file, sweep_expired), and additional management (get_storage_stats). There are no obvious gaps.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to autonomously manage files on the Filecoin decentralized network through folder management, file uploads, and AI-powered semantic search. Provides seamless integration with Filecoin storage through simple MCP tool calls.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables local file exchange between users and CLI agents via a web UI and MCP server, allowing agents to read/uploads and deliver artifacts without copy-paste.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A hybrid REST + MCP file server for managing files with large file streaming support, enabling AI agents and web frontends to perform file operations via MCP tools and REST APIs.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to securely transfer files between machines via encrypted, expiring share links, with tools for upload, download, status checks, and link management.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xtawa/mcp_file_manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server