From 4c911cb737890fc77206b1f5f1c54a4e51630b4f Mon Sep 17 00:00:00 2001 From: liangweihao <734499798@qq.com> Date: Fri, 27 Feb 2026 16:44:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=9A=84=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mcp_docx_server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mcp_docx_server.py b/mcp_docx_server.py index f6b52f8..6a8e43f 100644 --- a/mcp_docx_server.py +++ b/mcp_docx_server.py @@ -261,18 +261,19 @@ async def edit_docx(input_docx_path: str, replacements: Optional[List[Dict[str, img_pairs.append((idx, local_img)) # 复用原始处理函数 + output_docx = local_input.replace(".docx", "_output.docx") process( input_docx=local_input, - output_docx=local_input, + output_docx=output_docx, replacements=rep_pairs, image_replacements=img_pairs, color_keywords=color_keywords, ) - abs_out = os.path.abspath(local_input) + abs_out = os.path.abspath(output_docx) return { - "output_path": abs_out, - "output_url": _build_output_url(abs_out), + "output_path": output_docx, + "output_url": _build_output_url(output_docx), } finally: if tmp_input and os.path.exists(tmp_input):