百度云MCP(Baidudisk Mcp)
v1.0.0通过 mcporter + stdio MCP 服务器和热重载 token 文件凭证使用 Baidu Netdisk。当您需要从 OpenClaw 执行 Baidu Netdisk 操作(官方 2.0 工具集 + 旧别名)而不将 access_token 存储在仓库文件中时触发。
运行时依赖
安装命令
点击复制技能文档
使用 baidudisk-mcp 技能通过 mcporter 运行百度网盘工具。
1) 启用 mcporter 服务器 运行:bash scripts/baidudisk_mcporter.sh register 这会在 config/mcporter.json 中写入一个 baidudisk stdio 服务器条目,内容包括: 命令:/home/linuxbrew/.linuxbrew/bin/uv 参数:--directory /skills/baidudisk-mcp/server 运行 netdisk.py 环境变量:BAIDU_NETDISK_TOKEN_FILE=~/.openclaw/credentials/baidudisk.json 检查状态:bash scripts/baidudisk_mcporter.sh check mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json list baidudisk
2) 凭证文件和热更新 凭证文件(仅本地):~/.openclaw/credentials/baidudisk.json 预期键值: access_token(必需) default_dir(推荐) 示例(请勿提交真实令牌): { "access_token": "", "default_dir": "/Openclaw/baidudisk" } MCP 服务器在每次工具调用时都会读取此文件,因此令牌轮换只需要编辑此文件,无需重启服务器。
3) 2.0 工具 3.1 官方对齐工具 四个基础列表接口与 MCP 工具对应关系: /rest/2.0/xpan/file?method=list → file_list(dir?, limit?, order?, desc?, start?) /rest/2.0/xpan/file?method=imagelist → file_image_list(parent_path?, recursion?, page?, num?, order?, desc?, web=1) /rest/2.0/xpan/file?method=doclist → file_doc_list(parent_path?, recursion?, page?, num?, order?, desc?) /rest/2.0/xpan/file?method=videolist → file_video_list_api(parent_path?, recursion?, page?, num?, order?, desc?, web=1) 另保留一个历史兼容视频工具(非官方 videolist 参数模型): file_video_list(dir?, recursion?, start?, limit?, order?, desc?)(基于 xpanfilelistall 过滤视频) 其他工具: category_info(category, parent_path='/', recursion=1) category_info_multi(categories, parent_path='/', recursion=1) image_gettags(type=1) image_gettags_summary(type=1, top=50) image_search(search_type, keyword, start=0, limit=100, size?) recent_list(category=3, start=0, limit=100, sortby?, order?, stime?, etime?, resolution='off') file_meta(fsids, dlink?, thumb?, extra?, needmedia?, path?) make_dir(path, parent_dir?) file_copy(src_path, dest_dir, new_name?, ondup?) file_copy_batch(items, ondup='newcopy', async_mode=1, chunk_size=100, dry_run=false, allow_dest_prefixes=['/Openclaw']) file_del(path, confirm) file_move(src_path, dest_dir, new_name?, ondup?) file_move_batch(items, ondup='fail', async_mode=1, chunk_size=100, dry_run=false, allow_dest_prefixes=['/Openclaw']) file_rename(path, new_name) file_rename_batch(items, async_mode=1, chunk_size=100, dry_run=false) file_upload_stdio(local_file_path, remote_dir?, remote_name?) file_upload_by_url(url, remote_dir?, remote_name?, timeout_s?, max_bytes?) file_upload_by_text(text, remote_dir?, remote_name?, max_chars?, max_bytes?) file_keyword_search(keyword, dir?, recursion?, num?, page?) file_semantics_search(...)(当前不支持) file_sharelink_set(...)(当前不支持) user_info() get_quota(checkexpire?, checkfree?)
3.2 兼容保留别名 list search mkdir move rename delete upload download
4) mcporter 示例 对齐 list:/rest/2.0/xpan/file?method=list mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_list dir=/ limit=3 对齐 imagelist:/rest/2.0/xpan/file?method=imagelist mcporter --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 对齐 doclist:/rest/2.0/xpan/file?method=doclist mcporter --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 对齐 videolist:/rest/2.0/xpan/file?method=videolist mcporter --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 若根目录返回 count=0,可改 parent_path='/来自:iPhone' 或 '/Openclaw' 官方同名:关键词搜索 mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_keyword_search keyword=invoice num=20 分类统计(单分类:图片=3) mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.category_info category=3 parent_path=/ recursion=1 分类统计(多分类:JSON 数组) mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.category_info_multi categories='[1,3,4,6]' parent_path=/ recursion=1 图片智能标签 mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.image_gettags type=1 图片智能标签摘要(按 count 取前 20) mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.image_gettags_summary type=1 top=20 图片关键字检索(search_type=2 表示汉字) mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.image_search search_type=2 keyword=截图 limit=20 size='c256_u256,c512_u512' 图片列表(imagelist,默认 web=1 返回缩略图字段) mcporter --config /home/ubuntu/.openclaw/workspace/config/mcporter.json call baidudisk.file_image_list parent_path='/Openclaw' recursion=1