A rare breed: an e-signature tool that works completely offline via PAdES with self-issued certs, then routes through Dropbox Sign, DocuSign, or SignWell when you need a third-party anchor. Exposes 19 MCP tools covering the full lifecycle: create multi-signer requests, issue scoped approval tokens, send, watch for completion, verify signed PDFs, and export hash-chained audit trails with RFC 3161 timestamps. The design keeps agents out of the signing gesture itself but lets them drive everything else: document prep, recipient orchestration, status polling, compliance checks. Ships with sandbox mode, path-traversal guards, and a parallel HTTP API. Useful when you're automating contract ops end-to-end but need a human-in-the-loop gate before ink hits paper.
Public tool metadata for what this MCP can expose to an agent.
signer_listList pending local-provider requests where the given signer is a recipient. Pass signer_email to scope; omit to list every pending local request the inbox can see.1 paramsList pending local-provider requests where the given signer is a recipient. Pass signer_email to scope; omit to list every pending local request the inbox can see.
signer_emailstringsigner_fetch_documentRead the unsigned PDF for a local signing request. Requires the per-signer token. If out_path is provided, also writes the file to disk. Records request.signer_fetched_document.4 paramsRead the unsigned PDF for a local signing request. Requires the per-signer token. If out_path is provided, also writes the file to disk. Records request.signer_fetched_document.
tokenstringout_pathstringrequest_idstringsigner_emailstringsignSign a local signing request as the holder of the given token. Requires --provider local. The token resolves the signer; pre-sign safety checks (require_hash, require_title, require_signer_email) throw with a structured error code before any state mutation.7 paramsSign a local signing request as the holder of the given token. Requires --provider local. The token resolves the signer; pre-sign safety checks (require_hash, require_title, require_signer_email) throw with a structured error code before any state mutation.
tokenstringrequest_idstringsigner_namestringrequire_hashstringsigner_emailstringrequire_titlestringrequire_signer_emailstringsigner_declineDecline a local signing request as the holder of the given token. Sets status to declined.4 paramsDecline a local signing request as the holder of the given token. Sets status to declined.
tokenstringreasonstringrequest_idstringsigner_emailstringrequest_showReturn the enriched request snapshot: request, approvals (with tokenHint/expiresAt/expired/signed), signedBy[], declinedBy/declineReason, and a nextSteps[] array of suggested commands.1 paramsReturn the enriched request snapshot: request, approvals (with tokenHint/expiresAt/expired/signed), signedBy[], declinedBy/declineReason, and a nextSteps[] array of suggested commands.
request_idstringrequest_statusPoll the provider for the latest status of a request. For dropbox/signwell, reads API keys from DROPBOX_SIGN_API_KEY / SIGNWELL_API_KEY in the server's environment.2 paramsPoll the provider for the latest status of a request. For dropbox/signwell, reads API keys from DROPBOX_SIGN_API_KEY / SIGNWELL_API_KEY in the server's environment.
providerstringdropbox · docusign · signwell · localrequest_idstringaudit_verifyVerify the cryptographic audit chain for a request and report any break.1 paramsVerify the cryptographic audit chain for a request and report any break.
request_idstringrequest_watchPoll a request's status until terminal (completed/declined/canceled/timeout). When the MCP client supplies a progressToken, emits notifications/progress on each poll.4 paramsPoll a request's status until terminal (completed/declined/canceled/timeout). When the MCP client supplies a progressToken, emits notifications/progress on each poll.
providerstringdropbox · docusign · signwell · localrequest_idstringtimeout_msnumberinterval_msnumberpdf_detect_signature_fieldDetect signature-field placement candidates in a PDF (AcroForm /Sig widgets + anchor-text matches). Returns ranked candidates with confidence + adjustment method. Read-only — does not modify the PDF.2 paramsDetect signature-field placement candidates in a PDF (AcroForm /Sig widgets + anchor-text matches). Returns ranked candidates with confidence + adjustment method. Read-only — does not modify the PDF.
verbosebooleanpdf_pathstringpdf_detect_date_fieldDetect date-field placement candidates in a PDF. Returns candidates with `alreadyFilled: true` when a date string is already present near the anchor — callers can skip those when stamping. Read-only.2 paramsDetect date-field placement candidates in a PDF. Returns candidates with `alreadyFilled: true` when a date string is already present near the anchor — callers can skip those when stamping. Read-only.
verbosebooleanpdf_pathstringpdf_inspect_signaturesInspect existing PADES signatures on ANY PDF — ours, Adobe's, DocuSign's, Dropbox Sign's, SignWell's. Returns per-signature signer CN/email, cert subject + issuer, validity window, fingerprint, trust label (self_signed_local | self_signed_other | ca_signed | unknown), message-...1 paramsInspect existing PADES signatures on ANY PDF — ours, Adobe's, DocuSign's, Dropbox Sign's, SignWell's. Returns per-signature signer CN/email, cert subject + issuer, validity window, fingerprint, trust label (self_signed_local | self_signed_other | ca_signed | unknown), message-...
pdf_pathstringprofile_listList the profiles configured in the user's profiles.json. Shows the active source so the agent knows whether a flag, env var, or default selected the currently-active profile.List the profiles configured in the user's profiles.json. Shows the active source so the agent knows whether a flag, env var, or default selected the currently-active profile.
No parameter schema in public metadata yet.
profile_showShow the resolved active profile (or a specific user profile by name) with per-field provenance. Credentials are redacted by default; pass show_secrets: true to reveal resolved values. Read-only.2 paramsShow the resolved active profile (or a specific user profile by name) with per-field provenance. Credentials are redacted by default; pass show_secrets: true to reveal resolved values. Read-only.
namestringshow_secretsbooleanpdf_stamp_textStamp a text string (e.g. a date) onto a PDF. Mirrors `sign pdf stamp-text`. Position via auto_place (true|first|last|all|page:N|index:N) on DATE anchors, or explicit image_page/image_x/image_y/image_width/image_height. By default, candidates whose date appears already filled...10 paramsStamp a text string (e.g. a date) onto a PDF. Mirrors `sign pdf stamp-text`. Position via auto_place (true|first|last|all|page:N|index:N) on DATE anchors, or explicit image_page/image_x/image_y/image_width/image_height. By default, candidates whose date appears already filled...
textstringimage_xnumberimage_ynumberout_pathstringpdf_pathstringauto_placestringimage_pagenumberimage_widthnumberimage_heightnumberoverwrite_filledbooleanpreviewStamp a signature image or rendered name onto a PDF as a draft preview — NO PAdES seal, no signing-request state mutation. Mirrors `sign preview`. Returns positions + drawnRects (actual on-page rectangles after preserve-aspect-ratio shrink-to-fit) + warnings.12 paramsStamp a signature image or rendered name onto a PDF as a draft preview — NO PAdES seal, no signing-request state mutation. Mirrors `sign preview`. Returns positions + drawnRects (actual on-page rectangles after preserve-aspect-ratio shrink-to-fit) + warnings.
image_xnumberimage_ynumberout_pathstringpdf_pathstringauto_cropbooleanauto_placestringimage_pagenumberimage_widthnumberimage_heightnumbername_signaturestringsignature_imagestringpreserve_aspect_ratiobooleandocumentOne-shot DOCX|PDF → signed PDF. Mirrors `sign document`. Orchestrates DOCX→PDF (via docx2pdf-cli) → auto-place detection → stamp + PAdES seal → verify. Uses an isolated temp database so the caller's main db is never touched. Defaults auto_place to 'first'.15 paramsOne-shot DOCX|PDF → signed PDF. Mirrors `sign document`. Orchestrates DOCX→PDF (via docx2pdf-cli) → auto-place detection → stamp + PAdES seal → verify. Uses an isolated temp database so the caller's main db is never touched. Defaults auto_place to 'first'.
titlestringimage_xnumberimage_ynumberout_pathstringauto_cropbooleanauto_placestringimage_pagenumberinput_pathstringimage_widthnumbersigner_namestringimage_heightnumbersigner_emailstringname_signaturestringsignature_imagestringpreserve_aspect_ratiobooleansigner_reissue_tokenMint a new per-signer token for an existing request; the previous token is invalidated. Use when a signer lost their original token or it's about to expire. Mutating.3 paramsMint a new per-signer token for an existing request; the previous token is invalidated. Use when a signer lost their original token or it's about to expire. Mutating.
request_idstringsigner_emailstringtoken_ttl_minutesnumberaudit_scanVerify the audit chain of every request in the local DB (or filtered by provider/status). Returns per-request validity and any chain break. Read-only.3 paramsVerify the audit chain of every request in the local DB (or filtered by provider/status). Returns per-request validity and any chain break. Read-only.
limitnumberstatusstringproviderstringdropbox · docusign · signwell · localrequest_receiptExport a cryptographically-signed receipt bundle for a request: audit.json, signed.pdf, manifest.json, manifest.sig (RSA-SHA256 over manifest.json), manifest.cert.pem. Verifiable end-to-end with `sign request verify-receipt`. Mutating (writes to out_dir).2 paramsExport a cryptographically-signed receipt bundle for a request: audit.json, signed.pdf, manifest.json, manifest.sig (RSA-SHA256 over manifest.json), manifest.cert.pem. Verifiable end-to-end with `sign request verify-receipt`. Mutating (writes to out_dir).
out_dirstringrequest_idstring
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.
npx @drbaher/sign-cli demo
That single command runs the entire lifecycle — create → send → 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.
| If you are… | Start here |
|---|---|
| A new user evaluating the tool | This README's Quick start, then Standard user journey |
| An operator wiring up a hosted provider | docs/setup/ — Dropbox / DocuSign / SignWell / embedded |
| An LLM agent driving the CLI | AGENTS.md → docs/agent-guide.md → docs/recipes/ |
| An auditor verifying a signed bundle | docs/reference/audit-chain.md, docs/reference/legal.md |
| A contributor | docs/reference/architecture.md, docs/regression-testing.md |
| Adding a new CLI to the suite | The build-a-CLI playbook — the conventions every suite CLI follows |
Concept deep-dives live in docs/reference/; task-oriented recipes in docs/recipes/.
# Install
npm i -g @drbaher/sign-cli
# Or run without installing
npx @drbaher/sign-cli demo
# After install, the binary is named `sign`
sign --version
sign demo
sign init # wizard: provider selection + .env
sign doctor preflight # structured per-check readiness report
Or download a standalone binary from Releases — ./sign-linux-x64 demo. See DISTRIBUTION.md for every install path.
request send — refuses to double-send unless --force true; pair with --idempotency-key for safe retries.request from-template.sign pdf detect-signature-field + sign sign --auto-place). Detects AcroForm /Sig widgets and anchor text in English + French/EU conventions.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.signer fetch-document and the MCP signer_fetch_document tool surface existingSignatures, so a signer can see what they're countersigning before they sign.sign document (chains the bundled docx2pdf-cli, auto-place, stamp, PAdES-seal, verify in one call against a scoped temp DB).--read-only true on both mcp serve and serve. Mutating tools/routes return FORBIDDEN_READ_ONLY.{{env:VAR}} references for shell-managed secrets). See docs/reference/profiles.md.request verify-signed-pdf recomputes the digest, extracts X.509 signer certs, supports --recipient <email> for a redacted single-signer view, and reports per-signer trust labels.sign request create \
--title "Mutual NDA" \
--document ./nda.pdf \
--signer name:Alice,email:alice@acme.com,order:1 \
--signer name:Bob,email:bob@beta.com,order:2 \
--provider signwell
sign approve --request-id <id> --token <token1>
sign approve --request-id <id> --token <token2>
sign request send --request-id <id> --provider signwell --test-mode true
sign request watch \
--request-id <id> --provider signwell \
--interval-seconds 5 --fetch-final true \
--out ./signed.pdf
sign audit show --request-id <id>
Or fully offline:
sign request create --title "Mutual NDA" --document ./nda.pdf \
--signer name:Alice,email:alice@example.com,order:1 \
--signer name:Bob,email:bob@example.com,order:2 \
--provider local --auto-approve true
sign request send --request-id <id> --provider local
# Each signer runs:
sign sign --request-id <id> --token <their-token> \
--require-hash <sha256> --require-title "^Mutual NDA$"
For full provider-specific setup, see docs/setup/.
sign document contract.docx \
--signer "Alice Founder" --signer-email "alice@acme.com" \
--name-signature "Alice Founder" --auto-place first \
--out contract.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.
sign mcp serve # stdio MCP server
sign mcp serve --read-only true # sandboxed: mutating tools return FORBIDDEN_READ_ONLY
sign mcp tools # print the catalog (live; don't hardcode the list)
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.
sign serve --port 4000 --auth-token <t> --read-only true --rate-limit 5
curl http://127.0.0.1:4000/v1/openapi.json # discover the route catalog
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.
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.
# As the requester (agent or human)
sign request create --title "Mutual NDA" --document ./nda.pdf \
--signer name:Alice,email:alice@example.com,order:1 \
--signer name:Bob,email:bob@example.com,order:2 \
--provider local --auto-approve true
# response includes per-signer tokens
sign request send --request-id <id> --provider local
# As the signer, with their token
sign signer list --signer-email alice@example.com
sign signer fetch-document --request-id <id> --token alice-tok-... --out ./nda.pdf
# fetch-document surfaces `existingSignatures` so the signer can see what they're countersigning
sign sign --request-id <id> --token alice-tok-... \
--require-hash <sha256> --require-title "^Mutual NDA$" --require-signer-email alice@example.com
# or
sign signer decline --request-id <id> --token alice-tok-... --reason "Terms changed"
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.
Reuse a template defined in the provider dashboard (no PDF upload):
sign request from-template \
--template-id tmpl_abc --provider dropbox \
--signer role:Buyer,name:Alice,email:alice@example.com,order:1 \
--signer role:Seller,name:Bob,email:bob@example.com,order:2 \
--prefill name:purchase_price,value:1000 \
--auto-approve true
sign request send --request-id <id> --provider dropbox --test-mode true
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.
By default the hosted providers auto-append a generic signature page. For real contracts, pass --field (repeatable) on request create:
sign request create \
--title "NDA" --document ./contract.pdf \
--signer name:Alice,email:alice@example.com,order:1 \
--field signer:1,page:1,x:100,y:200,type:signature \
--field signer:1,page:1,x:100,y:240,type:date
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.
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.
# Inspect candidates first
sign pdf detect-signature-field --pdf ./contract.pdf
# Auto-place (errors loudly on ambiguity)
sign sign --request-id <id> --token <t> --name-signature "Alice" \
--auto-place first # or true | last | all | page:N | index:N
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.
sign request bulk \
--csv ./signers.csv \
--document ./contract.pdf --provider dropbox \
--title "Q2 NDA for {{email}}" --test-mode true
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.
# Inspect any signed PDF (ours, Adobe's, DocuSign's, …) — no DB lookup required
sign pdf inspect --pdf ./signed.pdf
# Inspect the embedded PKCS#7 of a request we sent
sign request verify-signed-pdf --request-id <id>
sign request verify-signed-pdf --request-id <id> --recipient alice@example.com # single-signer view
# Anchor the audit head against a public RFC 3161 TSA
sign audit anchor --request-id <id>
# Bundle for archival
sign audit export --request-id <id> --out ./bundle/
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.
sign profile init --name prod --provider signwell --db "~/.sign-cli/prod.db" --strict-provider true
sign profile set --name prod --key credentials.SIGNWELL_API_KEY --value "{{env:SIGNWELL_API_KEY}}"
sign --profile prod request show --request-id <id>
# Or implicitly via a project-level sign-profile.json (git/npm-style upward discovery)
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.
sign doctor # legacy env-report; always exits 0
sign doctor preflight # structured per-check report; exit 0 ok, 1 failed
sign doctor providers # capability matrix across all providers
sign doctor account-check --provider signwell # provider /me check
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.
.env or API keys.MIT. See LICENSE.
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent