# 把 PDF Craft 接入你的 AI Agent

[HTML](https://pdfcraft.ai/zh-CN/connect/)
[Site index](https://pdfcraft.ai/llms.txt)

让 Claude、Cursor、Claude Code、Codex 等支持 MCP 的客户端直接调用扫描 PDF OCR、Markdown 与 EPUB 转换、整书翻译、余额查询和费用估算。

- Remote MCP URL: `https://api.pdfcraft.ai/v1/mcp`
- Transport: Streamable HTTP (MCP protocol `2026-07-28`)
- Auth: OAuth 2.1 (scope `pdfcraft:use`) or `Authorization: Bearer $PDFCRAFT_API_KEY`

## 选择你的 AI 客户端

### Claude

在 Claude 自定义连接器中一键预填地址，并在浏览器完成 pdfcraft:use 授权。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Claude Code

在终端运行一条命令注册远程 Streamable HTTP 服务，再执行 /mcp 完成登录。

```bash
claude mcp add --transport http -s user pdfcraft https://api.pdfcraft.ai/v1/mcp
```

### Cursor

一键唤起 Cursor 安装，或将远程服务写入 Cursor 的 MCP 配置文件。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### VS Code

一键安装到 VS Code，或在 .vscode/mcp.json 中添加 HTTP 服务配置。

```json
{
  "servers": {
    "pdfcraft": {
      "type": "http",
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Codex

在 Codex CLI 中注册远程 MCP 地址，支持浏览器 OAuth 或环境变量鉴权。

```bash
codex mcp add pdfcraft --url https://api.pdfcraft.ai/v1/mcp
```

### ChatGPT

在 ChatGPT 开发者模式中添加 https://api.pdfcraft.ai/v1/mcp 作为自定义 MCP 服务并完成 OAuth 登录。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Antigravity

复制一句接入指令，或将配置写入 ~/.gemini/config/mcp_config.json。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Windsurf

复制一句接入指令，或将远程服务写入 Windsurf 的 MCP 配置文件。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Cline

复制一句接入指令，或将远程 HTTP 服务配置写入 cline_mcp_settings.json。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Zed

复制一句接入指令，或在 Zed 设置的 context_servers 中添加 PDF Craft。

```json
{
  "context_servers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Trae

复制一句接入指令，或在 Trae 的 MCP 设置中添加远程服务。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### Cherry Studio

打开设置中的 MCP 服务器，点击“从 JSON 导入”粘贴配置后启用即可。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "type": "streamableHttp",
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

### OpenClaw

复制一句接入指令，或在 OpenClaw 中注册 Streamable HTTP 服务地址。

```json
{
  "mcp": {
    "servers": {
      "pdfcraft": {
        "url": "https://api.pdfcraft.ai/v1/mcp",
        "auth": "oauth"
      }
    }
  }
}
```

### 其他 MCP 客户端

任何支持 Streamable HTTP 与 OAuth 2.1（或 Bearer 请求头）的客户端均可直连 https://api.pdfcraft.ai/v1/mcp。

```json
{
  "mcpServers": {
    "pdfcraft": {
      "url": "https://api.pdfcraft.ai/v1/mcp"
    }
  }
}
```

## Agent 如何与 PDF Craft 协作

### 一次接入，按环境选择鉴权方式

交互式客户端直接走 OAuth 2.1（含 RFC 9728 受保护资源元数据与动态客户端注册）；无浏览器环境或脚本使用 API 密钥页签发的 Bearer 密钥。

### 先查余额和估费，确认后再启动

先调用 get_capabilities 确认支持的格式与语言，再查询余额并按页数或字数估算费用。MCP 任务与网站工作区共用同一套点数余额和费率。

### 上传真实文件内容并保留任务 UUID

远程服务无法直接读取本机路径，Agent 需要读取并上传文件的实际字节。保留任务 UUID 便于随时续查进度；若因欠费暂时无法下载完整版，充值后对同一任务重新获取链接即可，无需重跑。
