What we built

SignLoop is an agent workflow that turns a plain-language instruction — "draft an NDA between U-King and Acme, 2-year term, RMB 500k penalty, send it to both parties to sign" — into a signed, archived document. The full chain runs automatically: an LLM drafting agent writes the contract, a generation agent renders it to PDF through the Foxit PDF Services MCP server, a signing agent creates the signature request through the Foxit eSign API, a real human reviews and signs in the email flow, and an archiving agent stores the executed PDF together with a complete audit trail of every agent action.

Why we built it

Businesses already trust AI to draft contracts, but every "signature" in today's AI pipeline is a fake click or a rubber stamp. Signing is a legal fact act — contract validity, responsibility and liability attach at the moment a person signs. Foxit deliberately excluded signing from the MCP tool set. We believe that boundary is correct, and we built SignLoop to defend it: the agent prepares everything, the human presses the signature. That handoff point is not a bug to work around — it is the product.

The human-in-the-loop design (our argument)

The agent never signs. It can draft, generate, OCR, extract, and request — the 40 Foxit tools plus the eSign API's request-creation endpoints. But the signature itself is always performed by a human recipient in the eSign flow. We make the handoff explicit and auditable: every agent action (which agent, which tool, which action, at what timestamp) is written to a JSONL trace, and the human's signing events appear in that same trace. The deliverable is a signed PDF plus a chain of custody showing exactly where the machine stopped and the human took over. This is what makes the document legally defensible — and it is the difference between "AI-generated paperwork" and "a real contract".

How we built it

  • Orchestration: multi-agent chain (draft → generate → sign → archive) with per-step tracing
  • Drafting: LLM + contract template with field extraction from the plain-language prompt
  • PDF generation: official Foxit PDF API MCP server (vendored as a git submodule) — HTML → PDF via pdf-from-html
  • Signing: Foxit eSign API wrapper — creates signature requests, emails signers, polls status, downloads the executed PDF
  • Audit: JSONL trace per agent action, archived with the signed document
  • Demo: CLI + animated web dashboard showing the agent chain live

Challenges we ran into

  • pnpm 11 blocks esbuild build scripts by default → switched the vendored MCP server build to npm
  • Foxit eSign API docs are behind the developer portal login → wrapped the endpoints with a credential-stubbed REST client so the flow is demoable before credentials arrive
  • CJK rendering in generated PDFs → use HTML→PDF path with proper font stack

Accomplishments that we're proud of

  • A complete signed-document closed loop from a single sentence
  • The audit trail: every machine action and every human signature in one trace file
  • The demo runs end-to-end today (dry-run mode) and goes live the moment eSign credentials are added

What's next

  • Webhook-driven completion notifications and contract expiry reminders
  • Multi-document types (quotes, purchase orders) and bilingual generation
  • SerpApi company lookup to auto-fill counterparty details

Built With

  • deepseek
  • foxit-esign-api
  • foxit-pdf-services-api
  • html/css/javascript
  • mcp
  • node.js
  • u-king
Share this project:

Updates

Submission history