
Sign Cli
io.github.DrBaher由 GitHub 帳號 DrBaher 發布v0.9.0更新於 Oct 24, 2026
Agent-first e-signature MCP server with offline PAdES signing and hash-chained audit.
概覽
用於電子簽名流程的本機 MCP 伺服器:建立、傳送、核准、簽署與驗證 PDF,支援離線 PAdES 簽章與雜湊鏈稽核。
- 可以做什麼
- 建立與管理簽名請求,支援多文件、多簽署人、CSV 批次傳送與供應商範本,傳送具冪等性,並在簽署前檢查雜湊、標題與簽署人電子郵件。以簽署人身分使用一次性、有時效的權杖核准、簽署或填寫理由拒絕,並可取得文件、查看既有簽章後再會簽。使用自簽憑證離線簽署 PDF,自動偵測簽章欄位、蓋章並封裝,一次呼叫完成 DOCX 轉為已封裝 PDF。檢查並驗證任何來源的已簽署 PDF,重算摘要、驗證 PKCS#7 簽章並標示信任標籤。檢視並驗證雜湊鏈稽核紀錄,以 RFC 3161 時間戳錨定並匯出封存包。
- 適用情境
- 適合讓助理端到端推動合約或 NDA 的簽署流程,而實際簽署動作仍由人完成;也適合需要完全離線、可驗證簽署 PDF 且不依賴第三方供應商的情境。另可用於稽核與驗證已簽署的 PDF。
- 執行需求
- 以本機程序執行,透過 npm 套件 @drbaher/sign-cli(Node.js)或獨立二進位檔安裝,僅支援桌面端。離線本機供應商無需註冊或 API 金鑰。託管供應商(Dropbox Sign、DocuSign、SignWell)需要各自的憑證,可在具名設定中透過環境變數引用。選用 HTTP API 使用 --auth-token 或 SIGN_HTTP_AUTH_TOKEN 提供的 Bearer 權杖。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Sign Cli,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
sign-cli
Fully-offline e-signature CLI. The built-in PAdES signer (PKCS#7 in /ByteRange, self-issued cert) produces real, cryptographically verifiable signed PDFs with no signup and no third-party provider — or routes through Dropbox Sign / DocuSign / SignWell when you need an external trust anchor. Per-signer approval tokens (TTL-bounded, scoped to one email), hash-chained audit events, RFC 3161 timestamping, named profiles, a 19-tool MCP server, and a 20-route HTTP API.
The asymmetry is the architecture: an agent can drive every step except the actual signing gesture, which stays gated behind a human.
Part of the contract-ops CLI suite — optional. sign-cli works entirely on its own; it's also the signing + audit step of the contract-ops suite: template-vault-cli → draft-cli → nda-review-cli → docx2pdf-cli → sign-cli, with drift detection via compare-cli.
Run this
That single command runs the entire lifecycle — create (consent + email-verification gates on) → send → watch the gates block signing → verify email → capture consent → approve → sign → verify chain → export receipt — against the offline local provider, then deletes everything. No signup. No keys. ~5 seconds.
Live demo → — read-only, resets every 4 hours. Self-host: see
deploy/README.md.
Where to go next
Concept deep-dives live in docs/reference/; task-oriented recipes in docs/recipes/.
Quick start
Or download a standalone binary from Releases — ./sign-linux-x64 demo. See DISTRIBUTION.md for every install path.
What this gives you
- Offline PAdES signing with a self-issued cert — real PKCS#7 signed PDFs, no signup, no API keys.
- Three hosted providers when you need them: Dropbox Sign, DocuSign, SignWell. Same surface across all four.
- Per-signer approval tokens (single-use, TTL-bounded, tied to one email). Tokens go to the human, not the agent.
- Consent + attribution evidence, opt-in per request:
--require-consentgates signing on a recorded intent-to-sign attestation + electronic-records consent (versioned canonical texts, hashed into the audit chain);--require-email-verificationgates it on a mailbox-control code;signer record-identitylogs how identity was checked out-of-band. No KYC data is collected — by design. See docs/reference/consent-and-identity.md. - Hash-chained audit chain with append-only DB triggers + RFC 3161 anchors. See docs/reference/audit-chain.md.
- Idempotent
request send— refuses to double-send unless--force true; pair with--idempotency-keyfor safe retries. - Multi-document + multi-signer requests; CSV-driven bulk send.
- Templates from each provider's dashboard via
request from-template. - Auto-detect signature field (
sign pdf detect-signature-field+sign sign --auto-place). Detects AcroForm/Sigwidgets and anchor text in English + French/EU conventions. - Inspect any signed PDF with
sign pdf inspect— parses PAdES PKCS#7 from sign-cli or any other producer (Adobe, DocuSign, Dropbox Sign, SignWell). Returns signer CN/email, cert subject + issuer, validity window, fingerprint, trust label (self_signed_local/self_signed_other/ca_signed/unknown), and message-digest match. - Counter-sign visibility —
signer fetch-documentand the MCPsigner_fetch_documenttool surfaceexistingSignatures, so a signer can see what they're countersigning before they sign. - One-shot DOCX → sealed PDF via
sign document(chains the bundled docx2pdf-cli, auto-place, stamp, PAdES-seal, verify in one call against a scoped temp DB). - Sandbox via
--read-only trueon bothmcp serveandserve. Mutating tools/routes returnFORBIDDEN_READ_ONLY. - Path-traversal guards on every input and output path. See docs/reference/security-controls.md.
- Named profiles bundle provider + dbPath + credentials (with
{{env:VAR}}references for shell-managed secrets). See docs/reference/profiles.md. - PDF verification end-to-end offline:
request verify-signed-pdfrecomputes the digest, extracts X.509 signer certs, supports--recipient <email>for a redacted single-signer view, and reports per-signertrustlabels.
Standard user journey
Or fully offline:
For full provider-specific setup, see docs/setup/.
One-shot DOCX → sealed PDF
sign document chains: convert (via the bundled docx2pdf-cli) → detect signature field → stamp → PAdES-seal → verify chain. All intermediate state lives in a scoped temp DB.
MCP server (for LLM agents)
19 tools, split read-only vs mutating. Backed by the same SignCliError envelopes you'd see at the CLI. The full discovery contract, wire-up snippets (Claude Desktop, Cursor), and read-only walkthrough are in AGENTS.md. Three resource shapes (request://<id> snapshot, .../document PDF blob, .../audit chain) and four agent-as-signer prompt templates (review_and_sign, policy_check, inbox_triage, verify_receipt) are also exposed.
HTTP API (for non-MCP clients)
Twenty routes under /v1/*, 1:1 parity with the MCP tool surface — same input shape, same path-traversal guards, same read-only gating. Bearer auth via --auth-token or SIGN_HTTP_AUTH_TOKEN. Responses are { ok, result } on success or the standard error envelope on failure.
Signer-side flow (agent-friendly)
For --provider local, an agent can act as a signer end-to-end without an email link. Set SIGN_LOCAL_AUTOCOMPLETE=false so the local provider holds at sent until each signer explicitly runs sign sign.
Multi-signer: status only flips to completed when every signer is in signedBy[]. Pre-sign safety checks (--require-hash / --require-title / --require-signer-email) throw PRE_SIGN_*_MISMATCH before any state mutation.
Templates
Reuse a template defined in the provider dashboard (no PDF upload):
Each --signer must include role:<roleName> matching a template role. --prefill name:K,value:V[,signer:N] populates template fields. Per-provider behavior: DocuSign uses per-signer text tabs; Dropbox uses custom_fields; SignWell uses placeholders.
Field placement
By default the hosted providers auto-append a generic signature page. For real contracts, pass --field (repeatable) on request create:
Spec: signer:<order> (required), doc:<i> (multi-doc index), type:signature|initials|date|text|name|email, page:<n> x:<pt> y:<pt> (coordinate), or DocuSign-only anchor:"text" with optional x-offset / y-offset / anchor-units. The fields persist on the request and forward to the provider at send time.
Auto-detect signature field
For --provider local, sign sign --auto-place calls the detector and uses the top candidate iff there's a unique high-confidence (≥0.8) match.
Adjustment strategies in priority order: underline-snap (0.95), below-anchor-probe (0.85, French/EU conventions), whitespace-probe (0.75), shrink-to-fit (0.50). Date anchors are detected separately via sign pdf detect-date-field. Full reference in docs/agent-guide.md §6.4a.
Bulk send
Each row becomes its own request with autoApprove: true. Title template supports {{email}}, {{name}}, {{row}}. Exit code 3 if any row failed; JSON output lists per-row results.
Trust beyond the provider
audit verify walks the local hash chain. request verify-signed-pdf recomputes the SHA-256 over the /ByteRange, compares it to the messageDigest in the embedded PKCS#7, and verifies the PKCS#7 signature value against the signer certificate's public key (RSA/ECDSA) — so a forged or tampered signature fails, exit 3, not just a modified-after-signing one. sign pdf inspect works on any signed PDF (no request id required). audit anchor issues a TimeStamp token from a TSA. See docs/reference/audit-chain.md for the full model.
Profiles
Resolution order: flag > env > project profile > user profile > built-in default. Credentials redacted by default in profile show (--show-secrets true to reveal). Over the MCP HTTP transport, show_secrets is refused unless an --http-auth-token is configured (it stays available on stdio MCP and the CLI). See docs/reference/profiles.md.
Doctor
preflight runs env-health checks (runtime:node_version, storage:db_path) on every provider, then provider-scoped checks layer on top. Branch on checks[].name for agent self-recovery.
Security notes
- Never commit
.envor API keys. - Rotate keys if shared in chat/logs.
- Keep test mode on during development.
- For path-traversal guards, secret redaction, idempotency, and read-only mode, see docs/reference/security-controls.md.
- For what the chain proves vs. what it doesn't, see docs/reference/security-model.md.
License
MIT. See LICENSE.
See also
- AGENTS.md — the agent quickstart (output contract, exit codes, discovery, failure recovery).
- docs/agent-guide.md — canonical agent reference (per-command schemas, side effects, idempotency).
- docs/setup/ — provider setup (Dropbox, DocuSign, SignWell, embedded).
- docs/recipes/ — task-oriented recipes (preflight, agent-loop-mcp, weekly anchor, auditor handoff, sign as Alice, EU NDA).
- docs/reference/ — concept deep-dives (audit chain, exit codes, profiles, security model, architecture, legal posture, comparison).
- TROUBLESHOOTING.md — error catalog.
- CHANGELOG.md — what landed and when.
- integrations/ — Claude Desktop config, langchain starter.
- deploy/ — Fly / Render / Railway configs for the hosted demo.
來源:README.md,提交 df6fe27
工具
0版本歷史
1- v0.9.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分