Files
sutong 1cb565161c feat: add tmp/ directory for temp files and cookie, add .gitignore
- tmp/ 用于存放临时文件(文档缓存、cookie等),已加入 .gitignore
- 文档中所有临时文件和 cookie 路径统一指向 tmp/
- SKILL.md 架构图增加 tmp/ 说明

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-16 18:59:32 +08:00

1.5 KiB
Raw Permalink Blame History

夸克网盘 — 安装配置

前置依赖

  • Node.js >= 18
  • mcporter
  • curlWindows Git Bash 自带)
mcporter --version || npm i -g mcporter

安装 MCP Server

npm i -g @ptbsare/netdisk-mcp-server

配置到 mcporter

浏览器打开 pan.quark.cn 并登录 → F12 开发者工具 → Network 标签 → 刷新页面 → 复制任意请求的 Cookie 请求头完整内容。

2. 配置

mcporter config add netdisk \
  --stdio "npx -y @ptbsare/netdisk-mcp-server" \
  --env "NETDISK_QUARK_COOKIE=粘贴你的完整Cookie"

Cookie 是敏感信息,保存在 tmp/cookie_quark.txt(已加入 .gitignore), 使用时 COOKIE=$(cat tmp/cookie_quark.txt),避免在命令行历史中泄露。

3. 验证

mcporter call netdisk.health

输出 Quark: Quark cookie is valid 表示成功。

# 列出根目录
mcporter call 'netdisk.list(cloud: "quark", path: "/")'

API 补全配置

MCP 工具缺少创建文件夹/移动/删除功能,这些操作通过直调 Quark API 实现。API 调用同样使用 Cookie 认证,无需额外配置。

API base URLhttps://drive-h.quark.cn

# 验证 API 连通性
curl -s "https://drive-h.quark.cn/1/clouddrive/file/sort?pr=ucpro&fr=pc&pdir_fid=0" \
  -H "cookie: 你的Cookie" | head -c 200

文件整理

整理功能(建目录/移动/删除)依赖 Quark API 直调,详见 usage.md 中的对应章节。