lightpdf-aipdf-mcp 0.1.37__py3-none-any.whl → 0.1.39__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/server.py +24 -29
- {lightpdf_aipdf_mcp-0.1.37.dist-info → lightpdf_aipdf_mcp-0.1.39.dist-info}/METADATA +2 -2
- {lightpdf_aipdf_mcp-0.1.37.dist-info → lightpdf_aipdf_mcp-0.1.39.dist-info}/RECORD +5 -5
- {lightpdf_aipdf_mcp-0.1.37.dist-info → lightpdf_aipdf_mcp-0.1.39.dist-info}/WHEEL +0 -0
- {lightpdf_aipdf_mcp-0.1.37.dist-info → lightpdf_aipdf_mcp-0.1.39.dist-info}/entry_points.txt +0 -0
lightpdf_aipdf_mcp/server.py
CHANGED
@@ -832,35 +832,30 @@ async def handle_call_tool(name: str, arguments: dict | None) -> list[types.Text
|
|
832
832
|
file_handler = FileHandler(logger)
|
833
833
|
editor = Editor(logger, file_handler)
|
834
834
|
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
return [types.TextContent(type="text", text=report_msg)]
|
860
|
-
except Exception as e:
|
861
|
-
error_msg = f"PDF合并失败: {str(e)}"
|
862
|
-
await logger.error(error_msg)
|
863
|
-
return [types.TextContent(type="text", text=error_msg)]
|
835
|
+
# 提取文件路径和密码
|
836
|
+
file_paths = [file_obj["path"] for file_obj in file_objects]
|
837
|
+
passwords = [file_obj.get("password") for file_obj in file_objects]
|
838
|
+
|
839
|
+
# 由于merge_pdfs方法只接受一个密码参数,如果文件密码不同,可能需要特殊处理
|
840
|
+
# 此处简化处理,使用第一个非空密码
|
841
|
+
password = next((p for p in passwords if p), None)
|
842
|
+
|
843
|
+
# 直接调用merge_pdfs方法
|
844
|
+
result = await editor.merge_pdfs(file_paths, password)
|
845
|
+
|
846
|
+
# 构建结果报告
|
847
|
+
report_msg = generate_result_report(
|
848
|
+
[result],
|
849
|
+
"PDF合并",
|
850
|
+
"合并成功",
|
851
|
+
"合并失败"
|
852
|
+
)
|
853
|
+
|
854
|
+
# 如果失败,记录错误
|
855
|
+
if not result.success:
|
856
|
+
await logger.error(report_msg)
|
857
|
+
|
858
|
+
return [types.TextContent(type="text", text=report_msg)]
|
864
859
|
|
865
860
|
# 调用通用处理函数
|
866
861
|
result = await process_tool_call(logger, file_objects, operation_config)
|
@@ -1,10 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lightpdf-aipdf-mcp
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.39
|
4
4
|
Summary: MCP Server for LightPDF AI-PDF
|
5
5
|
Author: LightPDF Team
|
6
6
|
License: Proprietary
|
7
|
-
Requires-Python: >=3.
|
7
|
+
Requires-Python: >=3.8
|
8
8
|
Requires-Dist: httpx-sse>=0.4.0
|
9
9
|
Requires-Dist: httpx>=0.28.1
|
10
10
|
Requires-Dist: mcp>=1.6.0
|
@@ -2,8 +2,8 @@ lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6
|
|
2
2
|
lightpdf_aipdf_mcp/common.py,sha256=ZPm_Wzn7GpMLl9xJXOrTgNgd0hqdI931JVKm57WRa14,6433
|
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=
|
6
|
-
lightpdf_aipdf_mcp-0.1.
|
7
|
-
lightpdf_aipdf_mcp-0.1.
|
8
|
-
lightpdf_aipdf_mcp-0.1.
|
9
|
-
lightpdf_aipdf_mcp-0.1.
|
5
|
+
lightpdf_aipdf_mcp/server.py,sha256=jXAcfLWhef5E3cle28bytDTTuMiwTMYAglbAFVF6Wlw,35737
|
6
|
+
lightpdf_aipdf_mcp-0.1.39.dist-info/METADATA,sha256=USG1KkrGGjJ75mf2hB0fuoFTas5noxVK0VcxlTN_Ooc,7931
|
7
|
+
lightpdf_aipdf_mcp-0.1.39.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
8
|
+
lightpdf_aipdf_mcp-0.1.39.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
|
9
|
+
lightpdf_aipdf_mcp-0.1.39.dist-info/RECORD,,
|
File without changes
|
{lightpdf_aipdf_mcp-0.1.37.dist-info → lightpdf_aipdf_mcp-0.1.39.dist-info}/entry_points.txt
RENAMED
File without changes
|