lightpdf-aipdf-mcp 0.1.32__py3-none-any.whl → 0.1.33__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.
@@ -158,7 +158,7 @@ async def process_edit_file(
158
158
  opacity=extra_params.get("opacity", 0.5),
159
159
  deg=extra_params.get("deg", "0"),
160
160
  range=extra_params.get("range", ""),
161
- layout=extra_params.get("layout", "under"),
161
+ layout=extra_params.get("layout", "on"),
162
162
  font_family=extra_params.get("font_family"),
163
163
  font_size=extra_params.get("font_size"),
164
164
  font_color=extra_params.get("font_color"),
@@ -479,7 +479,7 @@ async def handle_list_tools() -> list[types.Tool]:
479
479
  "type": "string",
480
480
  "description": "布局位置:在内容上(on)或在内容下(under)",
481
481
  "enum": ["on", "under"],
482
- "default": "under"
482
+ "default": "on"
483
483
  },
484
484
  "font_family": {
485
485
  "type": "string",
@@ -774,7 +774,7 @@ async def handle_call_tool(name: str, arguments: dict | None) -> list[types.Text
774
774
  "opacity": 0.5,
775
775
  "deg": "0", # 更新为"0"以匹配handle_list_tools中的默认值
776
776
  "range": "",
777
- "layout": "under", # 添加layout默认值
777
+ "layout": "on", # 添加layout默认值
778
778
  "image_quantity": 60,
779
779
  "split_type": "page",
780
780
  "merge_all": 1,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lightpdf-aipdf-mcp
3
- Version: 0.1.32
3
+ Version: 0.1.33
4
4
  Summary: MCP Server for LightPDF AI-PDF
5
5
  Author: LightPDF Team
6
6
  License: Proprietary
@@ -18,6 +18,31 @@ Description-Content-Type: text/markdown
18
18
 
19
19
  LightPDF AI助手 MCP Server 是一个基于 MCP (Model Control Protocol) 的文档格式转换工具,支持多种文档格式之间的相互转换以及PDF的各种处理功能。该工具需要在支持 MCP 功能的软件(如 Cursor)中配置使用。
20
20
 
21
+ ## 安装指南
22
+
23
+ ### 前提条件
24
+
25
+ - Node.js 18+ 或 Python 3.12+
26
+ - uv 包管理器
27
+ - 有效的 API 密钥
28
+
29
+ ### 使用 uvx 安装
30
+
31
+ ```bash
32
+ # 安装 uvx(如果尚未安装)
33
+ curl -fsSL https://install.uvx.sh | sh
34
+
35
+ # 全局安装 LightPDF MCP 包
36
+ uvx install lightpdf-aipdf-mcp@latest
37
+ ```
38
+
39
+ ### 使用 pip 安装
40
+
41
+ ```bash
42
+ # 如果使用 pip
43
+ pip install lightpdf-aipdf-mcp
44
+ ```
45
+
21
46
  ## 配置说明
22
47
 
23
48
  在 Cursor 中配置 LightPDF AI助手 MCP Server 工具需要修改 `~/.cursor/mcp.json` 文件。添加以下配置:
@@ -43,10 +68,20 @@ LightPDF AI助手 MCP Server 是一个基于 MCP (Model Control Protocol) 的文
43
68
  - `args`: 命令行参数
44
69
  - 使用最新版的 `lightpdf-aipdf-mcp` 包
45
70
  - `env`: 环境变量配置
46
- - `API_KEY`: 你的API密钥
71
+ - `API_KEY`: 你的API密钥(必填)
47
72
 
48
73
  配置完成后,重启 Cursor 使配置生效。
49
74
 
75
+ ## 验证安装
76
+
77
+ 安装和配置完成后,可以在 Cursor 中通过以下命令验证 MCP 服务是否正常工作:
78
+
79
+ ```
80
+ @lightpdf help
81
+ ```
82
+
83
+ 如果显示帮助信息,表示安装和配置成功。
84
+
50
85
  ## 功能特性
51
86
 
52
87
  - 支持多种文档格式的转换
@@ -100,24 +135,47 @@ LightPDF AI助手 MCP Server 是一个基于 MCP (Model Control Protocol) 的文
100
135
 
101
136
  ## 使用方法
102
137
 
103
- 1. 确保你使用的软件支持 MCP 功能(如 Cursor)
104
- 2. 在软件中完成 LightPDF AI助手 MCP Server 工具的配置
105
- 3. 调用相应的工具,指定输入文件和所需参数
106
- 4. 处理完成后,系统会提供结果文件的在线下载链接
138
+ ### 基本使用格式
139
+
140
+ Cursor 中,使用 `@lightpdf <命令>` 格式调用工具,例如:
141
+
142
+ ```
143
+ @lightpdf convert_document --files=[{"path": "document.docx"}] --format=pdf
144
+ ```
107
145
 
108
146
  ### 格式转换
109
- 使用 `convert_document` 工具,指定输入文件和目标格式。
110
-
111
- ### PDF处理功能
112
- - 去除水印: `remove_watermark`
113
- - 添加水印: `add_watermark`
114
- - 添加页码: `add_page_numbers`
115
- - 拆分PDF: `split_pdf`
116
- - 合并PDF: `merge_pdfs`
117
- - 旋转PDF: `rotate_pdf`
118
- - 压缩PDF: `compress_pdf`
119
- - 加密PDF: `protect_pdf`
120
- - 解密PDF: `unlock_pdf`
147
+ 使用 `convert_document` 工具,指定输入文件和目标格式:
148
+
149
+ ```
150
+ @lightpdf convert_document --files=[{"path": "document.docx"}] --format=pdf
151
+ ```
152
+
153
+ ### PDF处理示例
154
+
155
+ 去除水印:
156
+ ```
157
+ @lightpdf remove_watermark --files=[{"path": "document.pdf"}]
158
+ ```
159
+
160
+ 添加水印:
161
+ ```
162
+ @lightpdf add_watermark --files=[{"path": "document.pdf"}] --text="机密文件" --opacity=0.5
163
+ ```
164
+
165
+ 添加页码:
166
+ ```
167
+ @lightpdf add_page_numbers --files=[{"path": "document.pdf"}] --start_num=1 --position=6
168
+ ```
169
+
170
+ 拆分PDF:
171
+ ```
172
+ @lightpdf split_pdf --files=[{"path": "document.pdf"}] --pages="1-5,8,10-15"
173
+ ```
174
+
175
+ 合并PDF:
176
+ ```
177
+ @lightpdf merge_pdfs --files=[{"path": "doc1.pdf"}, {"path": "doc2.pdf"}]
178
+ ```
121
179
 
122
180
  ## 参数说明
123
181
 
@@ -187,22 +245,48 @@ LightPDF AI助手 MCP Server 是一个基于 MCP (Model Control Protocol) 的文
187
245
  - `path`: 文件路径或URL
188
246
  - `password`: 文档的当前密码(必需)
189
247
 
248
+ ## 故障排除
249
+
250
+ ### 常见问题解决
251
+
252
+ 1. **服务无法启动**
253
+ - 检查 API 密钥是否正确
254
+ - 确认 Cursor 版本是否支持 MCP
255
+ - 检查 `mcp.json` 配置是否正确
256
+ - 确保使用Python 3.12+版本
257
+
258
+ 2. **文件处理失败**
259
+ - 检查文件格式是否受支持
260
+ - 确认文件路径是否正确
261
+ - 验证文件大小是否超出限制(通常为100MB)
262
+
263
+ 3. **转换结果不理想**
264
+ - 对于复杂格式,可能需要尝试不同的转换参数
265
+ - 某些特殊排版可能无法完全保留
266
+
267
+ ### 日志查看
268
+
269
+ 如果您遇到问题,请提供完整的错误信息以便获得更好的支持。
270
+
271
+ ## 更新与维护
272
+
273
+ ### 更新 MCP 包
274
+
275
+ ```bash
276
+ uvx install lightpdf-aipdf-mcp@latest
277
+ ```
278
+
279
+ ### 获取最新文档
280
+
281
+ 访问官方文档网站获取最新使用说明和API参考。
282
+
190
283
  ## 注意事项
191
284
 
192
- 1. 确保有足够的磁盘空间用于文件转换
285
+ 1. 确保有足够的网络带宽和磁盘空间
193
286
  2. 对于网络URL,确保URL可访问且文件大小在合理范围内
194
287
  3. 批量转换时会自动控制并发数,避免过度占用系统资源
195
288
  4. 某些格式转换可能需要较长时间,请耐心等待
196
289
  5. 水印去除功能仅适用于PDF格式文件
197
290
  6. 复杂水印可能无法完全去除,效果取决于水印类型
198
291
  7. 所有PDF编辑功能只支持PDF格式的输入文件
199
-
200
- ## 错误处理
201
-
202
- 工具会提供详细的错误信息,常见的错误包括:
203
-
204
- - API密钥未配置或无效
205
- - 文件格式不支持
206
- - 文件不存在或无法访问
207
- - 网络连接问题
208
- - PDF密码不正确或文件受保护
292
+ 8. 使用Python版本必须是3.12或更高版本
@@ -2,8 +2,8 @@ lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6
2
2
  lightpdf_aipdf_mcp/common.py,sha256=odXhuSYEgbw3eskjFQKOSv-iVellqK35UI05XWprX8k,6488
3
3
  lightpdf_aipdf_mcp/converter.py,sha256=5oTLHxXOiZ9_PDatWiYbgPZ0LFFqE0L4qHvamX3g9lM,11732
4
4
  lightpdf_aipdf_mcp/editor.py,sha256=mbCGXd1Xzu-ibDWJnn11fOP5Xlf1Vqxi0yQ8Vs_yUKg,21787
5
- lightpdf_aipdf_mcp/server.py,sha256=CSNSjHDwpc8UHcWxYX6bc5Xsx57KM2CBdSEu3KmiY9w,35707
6
- lightpdf_aipdf_mcp-0.1.32.dist-info/METADATA,sha256=dCSk8ODHBWGfuTsGkls0tCA7t354P9MErx59-p7w4FQ,6449
7
- lightpdf_aipdf_mcp-0.1.32.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- lightpdf_aipdf_mcp-0.1.32.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
9
- lightpdf_aipdf_mcp-0.1.32.dist-info/RECORD,,
5
+ lightpdf_aipdf_mcp/server.py,sha256=Ho7pSXa1iCD7LuAnC3uNBjYT5iwYSfr18WwmuVSpXSQ,35698
6
+ lightpdf_aipdf_mcp-0.1.33.dist-info/METADATA,sha256=gO3sk8IRknV4njsRtGo6w_X1HLeggu2wskbuyH9-e1U,7932
7
+ lightpdf_aipdf_mcp-0.1.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ lightpdf_aipdf_mcp-0.1.33.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
9
+ lightpdf_aipdf_mcp-0.1.33.dist-info/RECORD,,