{"skill":{"slug":"baidudisk-mcp","displayName":"Baidudisk Mcp","summary":"Use Baidu Netdisk via mcporter + stdio MCP server with hot-reload token file credentials. Triggers when you need Baidu Netdisk operations (official 2.0 tools...","description":"---\nname: baidudisk-mcp\ndescription: Use Baidu Netdisk via mcporter + stdio MCP server with hot-reload token file credentials. Triggers when you need Baidu Netdisk operations (official 2.0 toolset + legacy aliases) from OpenClaw without storing access_token in repo files.\n---\n\n# baidudisk-mcp\n\nUse this skill to run Baidu Netdisk tools through `mcporter`.\n\n## 1) Enable server in mcporter\n\nRun:\n\n```bash\nbash scripts/baidudisk_mcporter.sh register\n```\n\nThis writes a `baidudisk` stdio server entry into `config/mcporter.json` with:\n\n- command: `/home/linuxbrew/.linuxbrew/bin/uv`\n- args: `--directory <workspace>/skills/baidudisk-mcp/server run netdisk.py`\n- env: `BAIDU_NETDISK_TOKEN_FILE=~/.openclaw/credentials/baidudisk.json`\n\nCheck status:\n\n```bash\nbash scripts/baidudisk_mcporter.sh check\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json list baidudisk\n```\n\n## 2) Credential file and hot update\n\nCredential file (local only):\n\n`~/.openclaw/credentials/baidudisk.json`\n\nExpected keys:\n\n- `access_token` (required)\n- `default_dir` (recommended)\n\nExample (do not commit real token):\n\n```json\n{\n  \"access_token\": \"<redacted>\",\n  \"default_dir\": \"/Openclaw/baidudisk\"\n}\n```\n\nThe MCP server reads this file on **every tool call**.\nSo token rotation only needs editing this file; no server restart is required.\n\n## 3) 2.0 tools\n\n### 3.1 Official-aligned tools (主推)\n\n四个基础列表接口与 MCP tool 对应关系：\n\n- `/rest/2.0/xpan/file?method=list` → `file_list(dir?, limit?, order?, desc?, start?)`\n- `/rest/2.0/xpan/file?method=imagelist` → `file_image_list(parent_path?, recursion?, page?, num?, order?, desc?, web=1)`\n- `/rest/2.0/xpan/file?method=doclist` → `file_doc_list(parent_path?, recursion?, page?, num?, order?, desc?)`\n- `/rest/2.0/xpan/file?method=videolist` → `file_video_list_api(parent_path?, recursion?, page?, num?, order?, desc?, web=1)`\n\n另保留一个历史兼容视频工具（非官方 videolist 参数模型）：\n\n- `file_video_list(dir?, recursion?, start?, limit?, order?, desc?)`（基于 `xpanfilelistall` 过滤视频）\n\n其他工具：\n\n- `category_info(category, parent_path='/', recursion=1)`\n- `category_info_multi(categories, parent_path='/', recursion=1)`\n- `image_gettags(type=1)`\n- `image_gettags_summary(type=1, top=50)`\n- `image_search(search_type, keyword, start=0, limit=100, size?)`\n- `recent_list(category=3, start=0, limit=100, sortby?, order?, stime?, etime?, resolution='off')`\n- `file_meta(fsids, dlink?, thumb?, extra?, needmedia?, path?)`\n- `make_dir(path, parent_dir?)`\n- `file_copy(src_path, dest_dir, new_name?, ondup?)`\n- `file_copy_batch(items, ondup='newcopy', async_mode=1, chunk_size=100, dry_run=false, allow_dest_prefixes=['/Openclaw'])`\n- `file_del(path, confirm)`\n- `file_move(src_path, dest_dir, new_name?, ondup?)`\n- `file_move_batch(items, ondup='fail', async_mode=1, chunk_size=100, dry_run=false, allow_dest_prefixes=['/Openclaw'])`\n- `file_rename(path, new_name)`\n- `file_rename_batch(items, async_mode=1, chunk_size=100, dry_run=false)`\n- `file_upload_stdio(local_file_path, remote_dir?, remote_name?)`\n- `file_upload_by_url(url, remote_dir?, remote_name?, timeout_s?, max_bytes?)`\n- `file_upload_by_text(text, remote_dir?, remote_name?, max_chars?, max_bytes?)`\n- `file_keyword_search(keyword, dir?, recursion?, num?, page?)`\n- `file_semantics_search(...)`（当前 `unsupported` stub）\n- `file_sharelink_set(...)`（当前 `unsupported` stub）\n- `user_info()`\n- `get_quota(checkexpire?, checkfree?)`\n\n### 3.2 Legacy aliases (兼容保留)\n\n- `list`\n- `search`\n- `mkdir`\n- `move`\n- `rename`\n- `delete`\n- `upload`\n- `download`\n\n## 4) mcporter examples\n\n```bash\n# 对齐 list：/rest/2.0/xpan/file?method=list\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_list dir=/ limit=3\n\n# 对齐 imagelist：/rest/2.0/xpan/file?method=imagelist\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_image_list parent_path='/来自：iPhone' recursion=0 page=1 num=3 order=time desc=1\n\n# 对齐 doclist：/rest/2.0/xpan/file?method=doclist\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_doc_list parent_path='/Openclaw' recursion=1 page=1 num=3 order=time desc=1\n\n# 对齐 videolist：/rest/2.0/xpan/file?method=videolist\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_video_list_api parent_path='/' recursion=1 page=1 num=3 order=time desc=1\n# 若根目录返回 count=0，可改 parent_path='/来自：iPhone' 或 '/Openclaw'\n\n# 官方同名：关键词搜索\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_keyword_search keyword=invoice num=20\n\n# 分类统计（单分类：图片=3）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.category_info category=3 parent_path=/ recursion=1\n\n# 分类统计（多分类：JSON array）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.category_info_multi categories='[1,3,4,6]' parent_path=/ recursion=1\n\n# 图片智能标签\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.image_gettags type=1\n\n# 图片智能标签摘要（按 count 取前 20）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.image_gettags_summary type=1 top=20\n\n# 图片关键字检索（search_type=2 表示汉字）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.image_search \\\n  search_type=2 keyword=截图 limit=20 size='c256_u256,c512_u512'\n\n# 图片列表（imagelist，默认 web=1 返回缩略图字段）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_image_list \\\n  parent_path='/Openclaw' recursion=1 page=1 num=10 order=time desc=1\n\n# 按上传时间拉取最近图片\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.recent_list \\\n  category=3 limit=20 resolution=off\n\n# 官方同名：创建目录\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.make_dir path=reports/2026\n\n# 批量移动（默认 ondup=fail，不覆盖；dest 限制在 /Openclaw）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_move_batch \\\n  items='[{\"src_path\":\"/Openclaw/inbox/a.txt\",\"dest_dir\":\"/Openclaw/archive\"},{\"src_path\":\"/Openclaw/inbox/b.txt\",\"dest_dir\":\"/Openclaw/archive\"}]' \\\n  chunk_size=100 async_mode=1\n\n# 批量复制（显式冲突策略 newcopy：冲突时自动副本，不覆盖原文件）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_copy_batch \\\n  items='[{\"src_path\":\"/Openclaw/inbox/a.txt\",\"dest_dir\":\"/Openclaw/archive\"}]' \\\n  ondup=newcopy async_mode=1\n\n# 批量重命名（dry_run 先演练）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_rename_batch \\\n  items='[{\"path\":\"/Openclaw/archive/a.txt\",\"new_name\":\"a-20260228.txt\"}]' \\\n  dry_run=true\n\n# 官方同名：本地文件上传\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_upload_stdio local_file_path=/tmp/demo.txt\n\n# 官方同名：按 URL 上传（HTTP/HTTPS，带大小/超时限制）\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_upload_by_url url=https://example.com/demo.txt remote_dir=/Openclaw/baidudisk\n\n# 官方同名：文本上传\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_upload_by_text text='hello world' remote_name=hello.txt\n\n# 官方同名：配额\nmcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.get_quota\n```\n\n## 5) Batch return envelope（8.2）\n\n`file_move_batch / file_copy_batch / file_rename_batch` 统一返回：\n\n- `status`, `tool`, `dry_run`, `async_mode`, `ondup`, `chunk_size`\n- `total_items`, `chunks`\n- `summary`（`ok_chunks/failed_chunks/ok_items_est/failed_items_est`）\n- `results`（每个 chunk：`chunk_index/items/request_preview/response(errno/taskid/info)`）\n- `errors`（失败 chunk 的 `chunk_index/message/items_preview`）\n\n## 6) Minimal self-check（不含 delete）\n\n> 请不要直接用 `python3`（容易缺 `mcp` 依赖）。\n\n```bash\ncd /home/ubuntu/.openclaw/workspace/skills/baidudisk-mcp\nserver/.venv/bin/python server/selfcheck_batch_filemanager.py\nserver/.venv/bin/python server/selfcheck_misc_readonly.py\n# 下两项为真实只读联网检查（需要 token）\nBAIDU_NETDISK_TOKEN_FILE=~/.openclaw/credentials/baidudisk.json server/.venv/bin/python server/selfcheck_image_recent_readonly.py\nBAIDU_NETDISK_TOKEN_FILE=~/.openclaw/credentials/baidudisk.json server/.venv/bin/python server/selfcheck_lists_readonly.py\n\n# 等价写法（如果你用 uv）\n# uv run --directory server python selfcheck_batch_filemanager.py\n# uv run --directory server python selfcheck_misc_readonly.py\n```\n\n覆盖点：\n\n- `file_move_batch`（10 条 + 分片降级）\n- `file_copy_batch`（`ondup=fail` 与 `ondup=newcopy`）\n- `file_rename_batch`\n- `category_info(category=3, parent_path='/', recursion=1)`\n- `image_gettags(type=1)`\n- 四个列表基础能力（只读）：\n  - `file_list(dir='/', limit=3)`\n  - `file_image_list(parent_path='/来自：iPhone', recursion=0, page=1, num=3, order='time', desc=1)`\n  - `file_doc_list(parent_path='/Openclaw', recursion=1, page=1, num=3, order='time', desc=1)`\n  - `file_video_list_api(parent_path='/', recursion=1, page=1, num=3, order='time', desc=1)`（根目录为空时回退 `/来自：iPhone` / `/Openclaw`）\n\n## 7) Safety defaults\n\n- Never store `access_token` in repo files.\n- Error messages sanitize `access_token` patterns.\n- `delete/file_del` rejects by default unless `confirm=\"DELETE\"`.\n- Batch move/copy restricts destination by `allow_dest_prefixes`（默认 `['/Openclaw']`）。\n- `file_move_batch` 默认 `ondup=fail`（不覆盖）；`file_copy_batch` 默认 `ondup=newcopy`（冲突产出副本，不覆盖）。\n- `file_upload_by_url` only allows `http(s)` and rejects localhost / 内网 / 保留地址；并限制下载大小与超时。\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":631,"installsAllTime":24,"installsCurrent":2,"stars":0,"versions":1},"createdAt":1772891224451,"updatedAt":1778491764944},"latestVersion":{"version":"1.0.0","createdAt":1772891224451,"changelog":"Initial release of baidudisk-mcp\n\n- Provides Baidu Netdisk access through mcporter with an MCP stdio server, supporting hot-reload of token credentials.\n- Implements a wide set of official-aligned file management tools (aligned with Baidu API 2.0) and maintains compatibility with legacy tool aliases.\n- Supports batch operations with unified return envelope format for copy, move, and rename.\n- Credentials are read from a local JSON file on every call, enabling seamless token updates without restart.\n- Includes extensive examples for mcporter usage and recommended server setup steps.","license":null},"metadata":null,"owner":{"handle":"forevershu","userId":"s178ywe9n79086xmkfryvxrnc9885shj","displayName":"forevershu","image":"https://avatars.githubusercontent.com/u/254035882?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089793758}}