跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Yandex Disk,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 在 Yandex Disk 中工作:浏览文件夹,列出全部文件或最近上传,查看文件详情,获取下载链接,创建文件夹,复制、移动、公开或取消公开文件,从 URL 保存文件,并从回收站恢复。使用你的 Yandex 账号登录。
试试这样问
Yandex Disk 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Yandex Disk、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Yandex Disk + Gemini
让你的 AI 在 Yandex Disk 中工作:浏览文件夹,列出全部文件或最近上传,查看文件详情,获取下载链接,创建文件夹,复制、移动、公开或取消公开文件,从 URL 保存文件,并从回收站恢复。使用你的 Yandex 账号登录。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
YANDEX_DISK_CLIENT_ID, YANDEX_DISK_CLIENT_SECRET
步骤 1 — 获取凭证
设置大约需要 5 分钟。你需要 AI 要使用其 Disk 的那个 Yandex 账号,以及在 Yandex OAuth 中为它注册的一个应用。
- 用该 Yandex 账号登录,打开 oauth.yandex.ru/client/new(或 oauth.yandex.com)并创建应用。
- 平台选择 Web services。Redirect URI 填写
https://cloud.anythingmcp.com/api/mcp-oauth/callback。如果你自行托管 AnythingMCP,请改为填写https://your-anythingmcp-host/api/mcp-oauth/callback。 - 在数据访问中添加 Yandex Disk REST API 权限:
cloud_api:disk.read(读取整个 Disk)、cloud_api:disk.write(在 Disk 任意位置写入)和cloud_api:disk.info(Disk 信息)。不要只选cloud_api:disk.app_folder:那样应用只能访问它自己的文件夹。 - 创建应用,把 ClientID 复制到
YANDEX_DISK_CLIENT_ID,把 Client secret 复制到YANDEX_DISK_CLIENT_SECRET,然后安装连接器。 - 在连接器页面点击 Authorize with Provider,选择 Yandex 账号并允许访问。
- 先运行
yandex_disk_get_disk_info:它会显示连接器登录的是谁的 Disk、已用空间以及回收站大小。
权限与只读设置:Yandex 授予的权限与你在第 3 步中为应用勾选的完全一致。如需只读,只用 cloud_api:disk.read 和 cloud_api:disk.info 注册应用,并关闭 yandex_disk_create_folder、yandex_disk_copy、yandex_disk_move、yandex_disk_publish、yandex_disk_unpublish、yandex_disk_upload_from_url 和 yandex_disk_restore_from_trash。
登录:Yandex 令牌有效期约一年,并附带刷新令牌,AnythingMCP 用它续期。两者都加密存储。如果你在 id.yandex.ru/security 撤销了应用或修改了它的权限,请再次点击 Authorize with Provider。
路径:文件和文件夹用 disk:/folder/file.txt 表示,根目录是 disk:/,回收站中的条目是 trash:/...。你只需说出文件夹或文件的名称,AI 会使用包括扩展名在内的准确名称。
更改前先等你确认:创建文件夹、复制、移动或重命名、公开和取消公开、从 URL 保存文件以及从回收站恢复都会改变你的 Disk。AI 会先说明将发生什么并等你确认,只有在你同意时才会覆盖已有文件。yandex_disk_publish 让任何拿到链接的人都能打开文件或文件夹;yandex_disk_unpublish 让链接失效,再次公开会生成新链接。
安装时默认关闭:yandex_disk_delete。管理员开启后,它会把条目移到回收站,可以用 yandex_disk_restore_from_trash 恢复。只有在你明确要求时才会永久删除。
没有搜索功能:Yandex Disk API 不支持按名称或内容搜索。要查找文件,AI 会用 yandex_disk_list_folder 列出文件夹内容,用 yandex_disk_list_files 逐页浏览所有文件(也可只看图片、文档等)并比对名称,或者用 yandex_disk_list_last_uploaded 查看最近上传的文件。
文件内容:本连接器不读取也不上传文件内容。yandex_disk_get_download_link 返回一个可以打开的临时链接(文件夹会以 zip 下载),yandex_disk_upload_from_url 则保存一个已经在互联网上的文件。yandex_disk_get_public_resource 可以读取任何 Yandex Disk 公开链接,无论是你的还是别人的。
后台操作:复制、移动、恢复或删除大型文件夹,以及每一次从 URL 上传,都会在 Yandex 后台运行。AI 会用 yandex_disk_get_operation_status 检查进度,直到操作完成。
常见错误:401 UnauthorizedError 表示缺少登录、登录已被撤销或已过期,请重新授权。403:应用缺少第 3 步中的某项权限(例如进行更改需要 cloud_api:disk.write),Disk 超出配额,或处于只读模式。404:路径不存在,请检查拼写、扩展名和 disk:/ 前缀。409:目标已存在,或其上级文件夹不存在。423:条目被其他操作锁定,或上传已暂停,请稍后重试。507:Disk 可用空间不足。429:请求过多,请稍后重试。
本连接器不读取或上传文件内容,不编辑自定义属性,不清空回收站,不与特定人员共享文件夹,也不修改 Yandex 360 的管理设置。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
Yandex Disk的工具。
可用工具
| Tool | What it does |
|---|---|
yandex_disk_get_disk_info | Get the Disk's totals: total_space, used_space and trash_size in bytes, the owner (login, display_name), whether the account is paid, the… |
yandex_disk_list_folder | List what is inside one folder of the Disk (files and subfolders), one page at a time |
yandex_disk_get_resource | Get the details of one file or folder by its path (disk:/folder/file): name, type, size, mime_type, media_type, md5 and sha256, created and… |
yandex_disk_list_files | List every file on the Disk as one flat list, across all folders (folders themselves are not listed), optionally only certain kinds such as… |
yandex_disk_list_last_uploaded | List the files uploaded most recently, newest first, optionally only certain kinds such as images |
yandex_disk_get_download_link | Get a temporary download URL for a file or folder (a folder downloads as a zip archive) |
yandex_disk_list_public | List the files and folders the user has published (shared by public link) |
yandex_disk_get_public_resource | Read the details of a public Yandex Disk link, the user's own or anyone's: name, type, size, owner and, for a folder, its contents… |
yandex_disk_create_folder | Create a folder |
yandex_disk_copy | Copy a file or folder to a new path |
yandex_disk_move | Move or rename a file or folder |
yandex_disk_publish | Publish a file or folder: anyone with the link can then open and download it |
yandex_disk_unpublish | Stop sharing a published file or folder: its public link stops working (publishing again creates a new link) |
yandex_disk_upload_from_url | Save a file from a public internet URL onto the Disk |
yandex_disk_get_operation_status | Check a background operation started by upload from URL, copy, move, restore or delete: status is in-progress, success or failed |
yandex_disk_list_trash | List what is in the Trash |
yandex_disk_restore_from_trash | Restore an entry from the Trash to where it was deleted from (origin_path), optionally under a new name |
yandex_disk_delete | Delete a file or folder |
示例提示
- “我的 Yandex Disk 还剩多少空间?回收站占了多少?”
- “我上周上传了哪些照片?它们分别在哪些文件夹里?”
- “在我的 Disk 上创建 Clients/Acme 文件夹,然后把 Downloads 里的 Acme 合同 PDF 移进去。”
- “为 Presentations/Pitch.pdf 创建一个公开链接发给我,然后列出我公开分享的其他所有内容。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?