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

64 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 夸克网盘 — 安装配置
## 前置依赖
- Node.js >= 18
- mcporter
- curlWindows Git Bash 自带)
```bash
mcporter --version || npm i -g mcporter
```
## 安装 MCP Server
```bash
npm i -g @ptbsare/netdisk-mcp-server
```
## 配置到 mcporter
### 1. 获取夸克 Cookie
浏览器打开 [pan.quark.cn](https://pan.quark.cn/) 并登录 → F12 开发者工具 → Network 标签 → 刷新页面 → 复制任意请求的 `Cookie` 请求头完整内容。
### 2. 配置
```bash
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. 验证
```bash
mcporter call netdisk.health
```
输出 ✅ `Quark: Quark cookie is valid` 表示成功。
```bash
# 列出根目录
mcporter call 'netdisk.list(cloud: "quark", path: "/")'
```
## API 补全配置
MCP 工具缺少创建文件夹/移动/删除功能,这些操作通过直调 Quark API 实现。API 调用同样使用 Cookie 认证,无需额外配置。
API base URL`https://drive-h.quark.cn`
```bash
# 验证 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` 中的对应章节。