lightpdf-aipdf-mcp 0.1.148__py3-none-any.whl → 0.1.150__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lightpdf_aipdf_mcp/__init__.py +2 -2
- lightpdf_aipdf_mcp/api/__init__.py +6 -0
- lightpdf_aipdf_mcp/api/adapter.py +193 -0
- lightpdf_aipdf_mcp/api/server.py +714 -0
- lightpdf_aipdf_mcp/core/__init__.py +1 -0
- lightpdf_aipdf_mcp/core/processor.py +460 -0
- lightpdf_aipdf_mcp/models/__init__.py +1 -0
- lightpdf_aipdf_mcp/models/schemas.py +9 -0
- lightpdf_aipdf_mcp/services/__init__.py +1 -0
- lightpdf_aipdf_mcp/{converter.py → services/converter.py} +44 -6
- lightpdf_aipdf_mcp/{create_pdf.py → services/create_pdf.py} +2 -1
- lightpdf_aipdf_mcp/{editor.py → services/editor.py} +2 -5
- lightpdf_aipdf_mcp/{ocr.py → services/ocr.py} +2 -5
- lightpdf_aipdf_mcp/{summarizer.py → services/summarizer.py} +2 -5
- lightpdf_aipdf_mcp/{translator.py → services/translator.py} +2 -5
- lightpdf_aipdf_mcp/utils/__init__.py +1 -0
- lightpdf_aipdf_mcp/{common.py → utils/common.py} +61 -1
- lightpdf_aipdf_mcp-0.1.150.dist-info/METADATA +199 -0
- lightpdf_aipdf_mcp-0.1.150.dist-info/RECORD +21 -0
- lightpdf_aipdf_mcp/server.py +0 -1718
- lightpdf_aipdf_mcp-0.1.148.dist-info/METADATA +0 -305
- lightpdf_aipdf_mcp-0.1.148.dist-info/RECORD +0 -13
- {lightpdf_aipdf_mcp-0.1.148.dist-info → lightpdf_aipdf_mcp-0.1.150.dist-info}/WHEEL +0 -0
- {lightpdf_aipdf_mcp-0.1.148.dist-info → lightpdf_aipdf_mcp-0.1.150.dist-info}/entry_points.txt +0 -0
@@ -1,305 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: lightpdf-aipdf-mcp
|
3
|
-
Version: 0.1.148
|
4
|
-
Summary: MCP Server for LightPDF AI-PDF
|
5
|
-
Author: LightPDF Team
|
6
|
-
License: Proprietary
|
7
|
-
Requires-Python: >=3.8
|
8
|
-
Requires-Dist: httpx
|
9
|
-
Requires-Dist: httpx-sse
|
10
|
-
Requires-Dist: mcp
|
11
|
-
Requires-Dist: mcp[cli]
|
12
|
-
Requires-Dist: pydantic
|
13
|
-
Requires-Dist: pydantic-settings
|
14
|
-
Requires-Dist: python-dotenv
|
15
|
-
Requires-Dist: starlette
|
16
|
-
Requires-Dist: uvicorn
|
17
|
-
Description-Content-Type: text/markdown
|
18
|
-
|
19
|
-
# LightPDF Agent MCP Server
|
20
|
-
|
21
|
-
LightPDF Agent MCP Server 是一个基于 MCP (Model Control Protocol) 的智能文档处理服务,提供全面的PDF处理和文档格式转换功能。该服务集成了先进的AI技术,可以智能处理文档,并提供高质量的转换结果。服务需要在支持 MCP 功能的软件(如 Cursor)中配置使用。
|
22
|
-
|
23
|
-
## 主要特性
|
24
|
-
|
25
|
-
- 智能文档处理:利用AI技术优化文档处理效果
|
26
|
-
- 全面的格式支持:支持多种文档格式之间的转换
|
27
|
-
- 专业的PDF工具:提供完整的PDF编辑、处理功能
|
28
|
-
- 高并发处理:支持批量处理和并发任务
|
29
|
-
- 详细的进度报告:实时反馈处理进度和结果
|
30
|
-
- 安全可靠:支持文档加密和密码保护
|
31
|
-
|
32
|
-
## 安装指南
|
33
|
-
|
34
|
-
### 系统要求
|
35
|
-
|
36
|
-
- Python 3.8+
|
37
|
-
- uv 包管理器
|
38
|
-
- 有效的 API 密钥
|
39
|
-
- 支持 MCP 的 IDE(如 Cursor)
|
40
|
-
|
41
|
-
### 使用 uvx 安装
|
42
|
-
|
43
|
-
```bash
|
44
|
-
# 安装 uvx(如果尚未安装)
|
45
|
-
curl -fsSL https://install.uvx.sh | sh
|
46
|
-
```
|
47
|
-
|
48
|
-
## 配置说明
|
49
|
-
|
50
|
-
在 Cursor 中配置 LightPDF Agent MCP Server,需要修改 `~/.cursor/mcp.json` 文件:
|
51
|
-
|
52
|
-
```json
|
53
|
-
{
|
54
|
-
"mcpServers": {
|
55
|
-
"lightpdf": {
|
56
|
-
"command": "uvx",
|
57
|
-
"args": [
|
58
|
-
"lightpdf-aipdf-mcp@latest"
|
59
|
-
],
|
60
|
-
"env": {
|
61
|
-
"API_KEY": "your_api_key_here",
|
62
|
-
"API_ENDPOINT": "techsz.aoscdn.com/api"
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
```
|
68
|
-
|
69
|
-
配置说明:
|
70
|
-
- `command`: 使用 `uvx` 命令运行服务
|
71
|
-
- `args`: 启动参数
|
72
|
-
- 使用最新版的 `lightpdf-aipdf-mcp` 包
|
73
|
-
- `env`: 环境变量配置
|
74
|
-
- `API_KEY`: API密钥(必填),请在[轻闪PDF API文档](https://lightpdf.cn/edit-api-doc#/)申请
|
75
|
-
- `API_ENDPOINT`: API服务器地址(可选)
|
76
|
-
|
77
|
-
配置完成后,重启 Cursor 使配置生效。
|
78
|
-
|
79
|
-
## 验证安装
|
80
|
-
|
81
|
-
安装和配置完成后,可以在 Cursor 中通过以下命令验证 MCP 服务是否正常工作:
|
82
|
-
|
83
|
-
```
|
84
|
-
@lightpdf help
|
85
|
-
```
|
86
|
-
|
87
|
-
如果显示帮助信息,表示安装和配置成功。
|
88
|
-
|
89
|
-
## 功能特性
|
90
|
-
|
91
|
-
### 文档格式转换
|
92
|
-
- 支持多种文档格式之间的相互转换
|
93
|
-
- 智能优化转换质量
|
94
|
-
- 支持本地文件和网络URL
|
95
|
-
- 支持批量转换
|
96
|
-
- 并发处理,提高转换效率
|
97
|
-
|
98
|
-
### PDF高级处理
|
99
|
-
- PDF编辑:拆分、合并、旋转、压缩
|
100
|
-
- 水印处理:添加/去除水印
|
101
|
-
- 安全功能:加密/解密PDF
|
102
|
-
- 页面优化:去除白边、提取图片
|
103
|
-
- 详细的处理进度和结果报告
|
104
|
-
|
105
|
-
## 支持的格式
|
106
|
-
|
107
|
-
### 输入格式
|
108
|
-
- Office文档
|
109
|
-
- Word (DOCX)
|
110
|
-
- Excel (XLSX)
|
111
|
-
- PowerPoint (PPTX)
|
112
|
-
- 图像文件
|
113
|
-
- JPG/JPEG
|
114
|
-
- PNG
|
115
|
-
- 其他格式
|
116
|
-
- PDF
|
117
|
-
- CAD (DWG)
|
118
|
-
- CAJ
|
119
|
-
- OFD
|
120
|
-
|
121
|
-
### 输出格式
|
122
|
-
- PDF
|
123
|
-
- Office文档
|
124
|
-
- Word (DOCX)
|
125
|
-
- Excel (XLSX)
|
126
|
-
- PowerPoint (PPTX)
|
127
|
-
- 图像格式
|
128
|
-
- JPG/JPEG
|
129
|
-
- PNG
|
130
|
-
- 文本格式
|
131
|
-
- HTML
|
132
|
-
- TXT
|
133
|
-
|
134
|
-
### 图片提取格式
|
135
|
-
- BMP
|
136
|
-
- PNG
|
137
|
-
- GIF
|
138
|
-
- TIF
|
139
|
-
- JPG
|
140
|
-
|
141
|
-
## PDF处理功能
|
142
|
-
|
143
|
-
### PDF水印处理
|
144
|
-
- 支持去除PDF文档中的水印
|
145
|
-
- 支持添加自定义文本水印
|
146
|
-
- 可设置水印位置、透明度、角度和应用页面范围
|
147
|
-
|
148
|
-
### PDF页码添加
|
149
|
-
- 支持在PDF文档中添加页码
|
150
|
-
- 可自定义起始页码
|
151
|
-
- 可选择页码位置(左上、上中、右上、左下、下中、右下)
|
152
|
-
- 可设置页码边距
|
153
|
-
|
154
|
-
### PDF编辑功能
|
155
|
-
- **拆分PDF**: 支持按页码范围拆分,或每页生成一个新文件
|
156
|
-
- **合并PDF**: 将多个PDF文件合并为一个
|
157
|
-
- **旋转PDF**: 支持90°、180°、270°旋转,可指定页面范围
|
158
|
-
- **压缩PDF**: 优化PDF文件大小,可调整图像质量
|
159
|
-
|
160
|
-
### PDF安全功能
|
161
|
-
- **加密PDF**: 添加密码保护
|
162
|
-
- **解密PDF**: 移除密码保护(需提供原密码)
|
163
|
-
|
164
|
-
## 使用方法
|
165
|
-
|
166
|
-
### 基本命令格式
|
167
|
-
|
168
|
-
在 Cursor 中使用 `@lightpdf <命令>` 格式调用工具。所有命令都支持以下通用参数:
|
169
|
-
- `files`: 要处理的文件列表,每个文件对象包含:
|
170
|
-
- `path`: 文件路径或URL(必填)
|
171
|
-
- `password`: 文档密码(可选)
|
172
|
-
- `name`: 原始文件名(可选)
|
173
|
-
|
174
|
-
### 常用命令示例
|
175
|
-
|
176
|
-
#### 文档转换
|
177
|
-
```bash
|
178
|
-
# 转换为PDF
|
179
|
-
@lightpdf convert_document --files=[{"path": "document.docx"}] --format=pdf
|
180
|
-
|
181
|
-
# 转换为Word
|
182
|
-
@lightpdf convert_document --files=[{"path": "document.pdf"}] --format=docx
|
183
|
-
|
184
|
-
# 转换为图片
|
185
|
-
@lightpdf convert_document --files=[{"path": "document.pdf"}] --format=jpg
|
186
|
-
```
|
187
|
-
|
188
|
-
#### PDF编辑
|
189
|
-
```bash
|
190
|
-
# 拆分PDF
|
191
|
-
@lightpdf split_pdf --files=[{"path": "document.pdf"}] --pages="1-5,8,10-15"
|
192
|
-
|
193
|
-
# 合并PDF
|
194
|
-
@lightpdf merge_pdfs --files=[{"path": "doc1.pdf"}, {"path": "doc2.pdf"}]
|
195
|
-
|
196
|
-
# 旋转PDF
|
197
|
-
@lightpdf rotate_pdf --files=[{"path": "document.pdf"}] --angle=90 --pages="1-3"
|
198
|
-
|
199
|
-
# 压缩PDF
|
200
|
-
@lightpdf compress_pdf --files=[{"path": "document.pdf"}] --quality=60
|
201
|
-
```
|
202
|
-
|
203
|
-
#### 水印处理
|
204
|
-
```bash
|
205
|
-
# 添加水印
|
206
|
-
@lightpdf add_watermark --files=[{"path": "document.pdf"}] --text="机密文件" --position="center" --opacity=0.5
|
207
|
-
|
208
|
-
# 去除水印
|
209
|
-
@lightpdf remove_watermark --files=[{"path": "document.pdf"}]
|
210
|
-
```
|
211
|
-
|
212
|
-
#### 安全功能
|
213
|
-
```bash
|
214
|
-
# 加密PDF
|
215
|
-
@lightpdf encrypt_pdf --files=[{"path": "document.pdf"}] --password="your_password"
|
216
|
-
|
217
|
-
# 解密PDF
|
218
|
-
@lightpdf decrypt_pdf --files=[{"path": "document.pdf", "password": "your_password"}]
|
219
|
-
```
|
220
|
-
|
221
|
-
## 参数说明
|
222
|
-
|
223
|
-
### 文档转换 (convert_document)
|
224
|
-
- `format`: 目标格式
|
225
|
-
- 支持的值:`pdf`, `docx`, `xlsx`, `pptx`, `jpg`, `png`, `html`, `txt`
|
226
|
-
- `quality`: 输出质量(可选,默认80)
|
227
|
-
- 范围:1-100,仅对图片输出有效
|
228
|
-
|
229
|
-
### PDF编辑
|
230
|
-
#### 拆分PDF (split_pdf)
|
231
|
-
- `pages`: 页面范围
|
232
|
-
- 格式:`"1,3,5-7"`,支持单页和页面范围
|
233
|
-
- `split_type`: 拆分类型(可选)
|
234
|
-
- `page`: 按指定页面拆分(默认)
|
235
|
-
- `every`: 每页生成一个文件
|
236
|
-
|
237
|
-
#### 合并PDF (merge_pdfs)
|
238
|
-
- 无需额外参数,按files列表顺序合并
|
239
|
-
|
240
|
-
#### 旋转PDF (rotate_pdf)
|
241
|
-
- `angle`: 旋转角度
|
242
|
-
- 支持的值:90, 180, 270
|
243
|
-
- `pages`: 页面范围(可选,默认全部页面)
|
244
|
-
|
245
|
-
#### 压缩PDF (compress_pdf)
|
246
|
-
- `quality`: 压缩质量(可选,默认60)
|
247
|
-
- 范围:1-100
|
248
|
-
|
249
|
-
### 水印处理
|
250
|
-
#### 添加水印 (add_watermark)
|
251
|
-
- `text`: 水印文本
|
252
|
-
- `position`: 位置(可选,默认center)
|
253
|
-
- 支持的值:`center`, `topleft`, `topright`, `bottomleft`, `bottomright`
|
254
|
-
- `opacity`: 透明度(可选,默认0.5)
|
255
|
-
- 范围:0.1-1.0
|
256
|
-
- `pages`: 页面范围(可选,默认全部页面)
|
257
|
-
|
258
|
-
### 安全功能
|
259
|
-
#### 加密PDF (encrypt_pdf)
|
260
|
-
- `password`: 设置的密码
|
261
|
-
|
262
|
-
#### 解密PDF (decrypt_pdf)
|
263
|
-
- 密码通过files参数中的password字段提供
|
264
|
-
|
265
|
-
## 故障排除
|
266
|
-
|
267
|
-
### 常见问题解决
|
268
|
-
|
269
|
-
1. **服务无法启动**
|
270
|
-
- 检查 API 密钥是否正确
|
271
|
-
- 确认 Cursor 版本是否支持 MCP
|
272
|
-
- 检查 `mcp.json` 配置是否正确
|
273
|
-
- 确保使用Python 3.8+版本
|
274
|
-
- 确认uvx是否正确安装
|
275
|
-
|
276
|
-
2. **文件处理失败**
|
277
|
-
- 检查文件格式是否受支持
|
278
|
-
- 确认文件路径是否正确
|
279
|
-
- 验证文件大小是否超出限制(通常为100MB)
|
280
|
-
|
281
|
-
3. **转换结果不理想**
|
282
|
-
- 对于复杂格式,可能需要尝试不同的转换参数
|
283
|
-
- 某些特殊排版可能无法完全保留
|
284
|
-
|
285
|
-
### 日志查看
|
286
|
-
|
287
|
-
如果您遇到问题,请提供完整的错误信息以便获得更好的支持。
|
288
|
-
|
289
|
-
## 更新与维护
|
290
|
-
|
291
|
-
### 获取最新文档
|
292
|
-
|
293
|
-
访问官方文档网站获取最新使用说明和API参考。
|
294
|
-
|
295
|
-
## 注意事项
|
296
|
-
|
297
|
-
1. 确保有足够的网络带宽和磁盘空间
|
298
|
-
2. 对于网络URL,确保URL可访问且文件大小在合理范围内
|
299
|
-
3. 批量转换时会自动控制并发数,避免过度占用系统资源
|
300
|
-
4. 某些格式转换可能需要较长时间,请耐心等待
|
301
|
-
5. 水印去除功能仅适用于PDF格式文件
|
302
|
-
6. 复杂水印可能无法完全去除,效果取决于水印类型
|
303
|
-
7. 所有PDF编辑功能只支持PDF格式的输入文件
|
304
|
-
8. 使用Python版本必须是3.8或更高版本
|
305
|
-
9. 推荐使用uvx进行安装和管理包
|
@@ -1,13 +0,0 @@
|
|
1
|
-
lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
|
2
|
-
lightpdf_aipdf_mcp/common.py,sha256=VOipRuz2veRMhpvr0lJ2nZwuEZntx1MiRxDSNx0fSWs,9310
|
3
|
-
lightpdf_aipdf_mcp/converter.py,sha256=r8iO5R5vLNNKWdb6WSnwzTwwmp2TvgLXSIvvA4y___o,15336
|
4
|
-
lightpdf_aipdf_mcp/create_pdf.py,sha256=FKWttbR48foiwUwmSsCN6n6PfI25IpaXETPUscz9DjI,16073
|
5
|
-
lightpdf_aipdf_mcp/editor.py,sha256=BR-sWW9L7tybEPOhdc8W-uwdBoom19EPTmGDvy_2gMc,27941
|
6
|
-
lightpdf_aipdf_mcp/ocr.py,sha256=IyzxisA6qtXcGTHZofpUYXYDdcIjUaaHcVUKpM7DH9A,2832
|
7
|
-
lightpdf_aipdf_mcp/server.py,sha256=GR5OXnYO1uAHOOXFx5r_R3mktnf15bIxrtX2ZYLT3ps,81468
|
8
|
-
lightpdf_aipdf_mcp/summarizer.py,sha256=UPAftDKjp2NFE2Wfoi2yAsGfaWqihu-c_W_BwfhVy0c,3671
|
9
|
-
lightpdf_aipdf_mcp/translator.py,sha256=nuZa4FpsA0xeRWAEGqSPIM55aJuazJX1m32uajowo7I,2778
|
10
|
-
lightpdf_aipdf_mcp-0.1.148.dist-info/METADATA,sha256=ullwdslLzKvUmKTyjNcPa0tL4vm97ptwuvZah6fTAmM,8120
|
11
|
-
lightpdf_aipdf_mcp-0.1.148.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
12
|
-
lightpdf_aipdf_mcp-0.1.148.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
|
13
|
-
lightpdf_aipdf_mcp-0.1.148.dist-info/RECORD,,
|
File without changes
|
{lightpdf_aipdf_mcp-0.1.148.dist-info → lightpdf_aipdf_mcp-0.1.150.dist-info}/entry_points.txt
RENAMED
File without changes
|