You can compare two versions of a document with an AI agent and get a short answer, a marked-up file, or both, while the files stay on your machine. Install the GroupDocs.Comparison.Mcp server, put both versions in one folder, and ask Claude Desktop, Claude Code, Cursor or GitHub Copilot locally:

Compare contract-v1.docx with contract-v2.docx. Summarize what changed, then give me a marked-up copy.

The step-by-step version with config and troubleshooting is in the documentation: How to compare documents with AI agents using MCP.

ทำไมเอเย่นต์ AI ไม่ควรเปรียบเทียบเอกสารโดยการอ่านมัน?

โมเดลภาษา ที่ “เปรียบเทียบ” เอกสารสองฉบับโดยการอ่านข้อความของมัน จะให้คำอธิบายของความแตกต่าง แทนที่จะเป็นการวัดความแตกต่างจริง ๆ มันอาจรายงานการเปลี่ยนแปลงที่ไม่มีอยู่จริงและพลาดการเปลี่ยนแปลงที่มีอยู่ MCP server จะย้ายงานนั้นไปยังเอนจินการเปรียบเทียบ เอเย่นต์ยังคงทำในสิ่งที่มันเก่ง: เข้าใจคำถามของคุณและอธิบายผลลัพธ์ ส่วนเอนจินทำการเปรียบเทียบที่รับรู้รูปแบบและส่งคืนการเปลี่ยนแปลงแต่ละรายการเป็นข้อมูล: ประเภทของการเปลี่ยนแปลง, หน้า, ส่วนประกอบ, ชิ้นส่วนที่เปลี่ยน, ข้อความรอบข้าง, และเซลล์ตารางเมื่อการเปลี่ยนแปลงอยู่ภายในตาราง การเปลี่ยนแปลงรูปแบบ เช่น ข้อความที่เปลี่ยนจากปกติเป็นตัวหนา จะถูกรายงานเป็นการเปลี่ยนแปลง

วิธีการเลือกใช้สามวิธีด้านล่างขึ้นอยู่กับคำถามเดียว: คุณต้องการคำตอบหรือเอกสาร?

วิธีที่ 1: ขอคำตอบและรับ analyze_changes

เมื่อคำถามเริ่มด้วย “what”, “did” หรือ “how many” เอเย่นต์จะเรียก analyze_changes เครื่องมือจะคืนความแตกต่างเป็นข้อมูลโครงสร้างและไม่เขียนไฟล์ใด ๆ

What changed between proposal-draft.docx and proposal-final.docx? Keep it short.

การตอบจะเริ่มด้วย <N> change(s) detected (หรือ No changes detected) ตามด้วยอาเรย์ JSON เอเย่นต์จะกรองและสรุปอาเรย์นั้น ดังนั้นการติดตามต่อเช่น “เฉพาะการลบ” หรือ “มีจำนวนที่เปลี่ยนหรือไม่?” จะไม่ต้องเข้าถึงไฟล์อีกครั้ง ใช้วิธีนี้เป็นค่าเริ่มต้น: มันข้ามขั้นตอนการเรนเดอร์ ทำให้เร็วและถูกกว่าทางเลือกอื่น

วิธีที่ 2: ขอเอกสารและรับ compare

เมื่อคำขอเป็น “give me a file” เอเย่นต์จะเรียก compare เครื่องมือจะเรนเดอร์เอกสารผลลัพธ์ที่ทำเครื่องหมายและบันทึกลงในโฟลเดอร์ผลลัพธ์ของคุณเป็น <source-stem>_compared<ext> ตัวอย่างเช่น contract-v1_compared.docx ไฟล์ที่มีอยู่แล้วจะไม่ถูกเขียนทับ; จะใช้ชื่อใหม่แทน

Give me a marked-up copy of contract-v1.docx and contract-v2.docx that I can send to legal.

ผู้ตรวจสอบของคุณจะเปิดผลลัพธ์ใน Word หรือโปรแกรมดูอื่น ๆ พวกเขาไม่ต้องการไคลเอนต์ MCP หรือเครื่องมือ AI รายการการเปลี่ยนแปลงเดียวกันจะถูกส่งกลับไปยังเอเย่นต์ ดังนั้นคุณยังคงสามารถถามคำถามเกี่ยวกับมันได้

วิธีที่ 3: ขอทั้งสองอย่างและให้เอเย่นต์เชื่อมต่อการเรียก

เอเย่นต์ที่มีความสามารถจะทำการเรียกสองครั้งจากพรอมต์เดียว: analyze_changes สำหรับสรุปและ compare สำหรับไฟล์ นี่คือพรอมต์จากจุดเริ่มต้นของโพสต์นี้ ใช้เมื่อคุณต้องการอ่านสรุปสั้น ๆ ตอนนี้และส่งไฟล์ให้คนอื่นต่อไป

ก่อนทำการเปรียบเทียบ คุณยังสามารถขอให้เอเย่นต์ตรวจสอบไฟล์ได้เช่นกัน:

How many pages is contract-v2.docx?

คำสั่งนี้จะเรียก get_document_info ซึ่งจะคืนประเภทไฟล์, จำนวนหน้า, ขนาดและมิติของแต่ละหน้าโดยไม่ต้องเปรียบเทียบอะไรเลย

วิธีตั้งค่าอย่างไร?

Run dnx GroupDocs.Comparison.Mcp --yes (with the .NET 10 SDK) or the Docker image ghcr.io/groupdocs-comparison/comparison-net-mcp, register the server in your client, and set GROUPDOCS_MCP_STORAGE_PATH to the folder that holds both versions.

รูปแบบการทำงานในไคลเอนต์เป็นอย่างไร?

ตัวอย่างเซสชัน (สรุปและอธิบาย; คำพูดจริงอาจแตกต่างตามไคลเอนต์และโมเดลของคุณ):

You:    Compare contract-v1.docx with contract-v2.docx. Summarize
        what changed, then give me a marked-up copy.

Agent:  [calls analyze_changes: contract-v1.docx, contract-v2.docx]
        [calls compare: contract-v1.docx, contract-v2.docx]

        The engine detected changes, including the payment schedule
        in a table on page 4 and a clause that changed from regular
        to bold. The marked-up copy is saved as
        contract-v1_compared.docx in your output folder.

ข้อจำกัดคืออะไร?

  • Evaluation cap. Without a license the server runs in evaluation mode: only the first 2 pages are compared, and the result carries a watermark. On a long document that gives a short, reassuring change list. Ask “what is the license status of the comparison server?” first; the agent calls get_license_status, and "mode": "evaluation" means the cap applies.
  • Same format on both sides. Compare like with like; convert first if the two files differ in format.

คำถามที่พบบ่อย

Claude สามารถเปรียบเทียบ PDF สองไฟล์โดยไม่อัปโหลดได้หรือไม่?
Yes, with the MCP server the comparison runs in a local process against files in a folder you choose. Your prompt and any fragments the agent quotes back still go to the model your client uses.

ความแตกต่างระหว่าง analyze_changes กับ compare คืออะไร?
Both detect the same changes. analyze_changes returns them as data and writes no file; compare also renders a marked-up document.

มันทำงานได้เฉพาะไฟล์ Word หรือไม่?
No. The tools accept PDF, DOCX, XLSX, PPTX, ODT, RTF, TXT, HTML and more than 30 other formats.

ไปให้ลึกขึ้น