signing-mcp

v1.1.4
@vfunctt/signing-mcp Checked 17 hours ago Published 20 days ago

Lightweight PDF signing platform with Admin UI, Client signing interface, and MCP tools

@vfunctt/signing-mcp > Lightweight, self-hosted digital PDF signing platform with visual Admin Template Builder, mobile-ready Client Signing Portal, and Model Context Protocol (MCP) tools for AI agents. --- Overview @vfunctt/signing-mcp bridges the gap between automated AI workflows and real-world human contract signing.

Summary extracted from the README.

@vfunctt/signing-mcp

Lightweight, self-hosted digital PDF signing platform with visual Admin Template Builder, mobile-ready Client Signing Portal, and Model Context Protocol (MCP) tools for AI agents.


Overview

@vfunctt/signing-mcp bridges the gap between automated AI workflows and real-world human contract signing. It allows AI agents (Claude, Cursor, Windsurf, etc.) to list available document templates, generate personalized signing links for clients with custom field mapping, and poll for signature completion—all backed by a built-in visual web dashboard and mobile-optimized signing wizard.

       ┌────────────────────────┐
       │   AI Agent (MCP Host)  │
       └───────────┬────────────┘
                   │ MCP Tools (list_documents, generate_signing_link, check_signing_status)
                   ▼
┌────────────────────────────────────────────────────────┐
│                  @vfunctt/signing-mcp                   │
│                                                        │
│  ┌──────────────────────┐    ┌──────────────────────┐  │
│  │   Admin UI (/admin)  │    │ Client Portal (/sign)│  │
│  │  - PDF Upload        │    │  - Step-by-step flow │  │
│  │  - Visual Builder    │    │  - Canvas / Type sig │  │
│  │  - Field Mapping     │    │  - Instant download  │  │
│  │  - Manage Requests   │    │                      │  │
│  └──────────────────────┘    └──────────────────────┘  │
│                                                        │
│   SQLite (better-sqlite3 WAL) + pdf-lib Document Engine│
└────────────────────────────────────────────────────────┘

Features

  • 3 Native MCP Tools:
    • list_documents: Discover all active and uploaded PDF document templates.
    • generate_signing_link: Create unique signing links with token verification for any client, including optional prefill values and custom parameters.
    • check_signing_status: Check if the signer has signed, retrieve signing metadata, and get download URLs.
  • Visual Drag & Drop Field Builder (/admin):
    • Upload custom PDF contracts and agreements directly in the browser.
    • Place interactive fields (Signature, Text, Date) onto any PDF page with pixel-perfect percentage coordinates.
    • Map document fields to standard attributes (signer_name, signer_email, signer_phone, date) or arbitrary custom parameter keys.
    • Select active/default templates and delete unused documents.
  • Mobile-First Client Signing Portal (/sign/:token):
    • Guided step-by-step dock wizard navigating from field to field.
    • Auto-prefills mapped variables and signer data.
    • Dual signature input: Draw (smooth HTML5 touch/mouse canvas) or Type (cursive script).
  • Legally Sound PDF Stamping & Audit Trail:
    • Uses pdf-lib to embed PNG signature data and text values directly onto the document.
    • Automatically appends a tamper-evident audit strip to the bottom of the final page containing signer name, email, timestamp, and unique request ID.
    • Records signer IP address and user-agent string.
  • Zero External Database Requirements:
    • Powered by local SQLite (better-sqlite3) with WAL mode enabled.
    • Stores PDFs and audit records safely in ~/.vfunct-mcp/signing/ (configurable via SIGNING_DATA_DIR).

Quick Start

Run directly without installing:

npx -y @vfunctt/signing-mcp

2. Install Globally

npm install -g @vfunctt/signing-mcp
signing-mcp

3. Running from Local Source

If you have the source files locally:

npm install
npm run build
npm start

# Or directly in development mode with live reload
npm run dev

Once running:


MCP Configuration

1. Stdio Transport (Default for Claude Desktop / Cursor)

In this mode, the server serves the Web UI over HTTP in the background on PORT while exposing MCP tools to the agent over standard I/O:

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "signing": {
      "command": "npx",
      "args": ["-y", "@vfunctt/signing-mcp"],
      "env": {
        "PORT": "3333",
        "PUBLIC_URL": "http://localhost:3333",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

2. Streamable HTTP Transport (Remote Agents / Gateways)

To serve MCP requests over HTTP (endpoint /mcp):

PORT=3333 \
PUBLIC_URL=https://signing.yourdomain.com \
MCP_TRANSPORT=http \
MCP_AUTH_TOKEN=super-secret-token \
npx -y @vfunctt/signing-mcp

Environment Variables

Variable Default Description
PORT or SIGNING_PORT 3333 Port for the HTTP server (Web UI, API, preview/download).
HOST 0.0.0.0 Host to bind the HTTP server.
PUBLIC_URL http://localhost:${PORT} Publicly accessible URL sent to clients in generated signing links.
MCP_TRANSPORT stdio stdio (runs stdio MCP + Web server) or http (runs Streamable HTTP on /mcp).
MCP_AUTH_TOKEN None Optional secret token. If set, protects the Admin UI and API endpoints. Public signing links remain accessible.
SIGNING_DATA_DIR ~/.vfunct-mcp/signing Directory where SQLite database (signing.db), uploaded templates, and signed PDFs are stored.

MCP Tool Reference

list_documents

Lists all available document templates in the system.

  • Annotations: readOnlyHint: true, openWorldHint: false
  • Input Parameters: None
  • Example Response:
[
  {
    "id": "doc_e41b2a9c12df",
    "title": "Standard NDA Agreement",
    "isActive": true,
    "createdAt": "2026-03-30T10:00:00.000Z"
  }
]

Generates an active signing link for a client. Accepts optional signer info, date, custom parameters, and document ID. If documentId is omitted, the currently active default template is used.

  • Annotations: readOnlyHint: false, destructiveHint: false, openWorldHint: true

  • Input Schema:

    • name (string, optional): Full legal name of the signer.
    • email (string, optional): Email address of the signer.
    • phone (string, optional): Contact phone number of the signer.
    • date (string, optional): Signing date in YYYY-MM-DD format (defaults to current date).
    • documentId (string, optional): Specific document template ID.
    • customParams (object, optional): Arbitrary key-value string pairs used to prefill mapped template fields (e.g. {"role": "CTO", "company": "Acme Inc"}).
  • Example Call:

{
  "name": "Jane Doe",
  "email": "jane.doe@example.com",
  "phone": "+1 555-0199",
  "date": "2026-04-01",
  "customParams": {
    "role": "Lead Architect",
    "department": "Engineering"
  }
}
  • Example Response:
{
  "requestId": "req_a1b2c3d4e5f6",
  "signingUrl": "http://localhost:3333/sign/8f3a91b2c4e5d6f7a8b9c0d1e2f3a4b5",
  "documentId": "doc_e41b2a9c12df",
  "documentTitle": "Standard NDA Agreement",
  "status": "pending",
  "signer": {
    "name": "Jane Doe",
    "email": "jane.doe@example.com",
    "phone": "+1 555-0199",
    "date": "2026-04-01"
  },
  "customParams": {
    "role": "Lead Architect",
    "department": "Engineering"
  },
  "note": "Send this signing link to the client. They can sign directly from mobile or desktop."
}

check_signing_status

Checks whether a signer has completed their document and retrieves execution details.

  • Annotations: readOnlyHint: true, openWorldHint: false

  • Input Schema:

    • requestId (string, required): The req_... ID returned by generate_signing_link.
  • Example Call:

{
  "requestId": "req_a1b2c3d4e5f6"
}
  • Example Response (Signed):
{
  "requestId": "req_a1b2c3d4e5f6",
  "status": "signed",
  "isSigned": true,
  "documentTitle": "Standard NDA Agreement",
  "signer": {
    "name": "Jane Doe",
    "email": "jane.doe@example.com",
    "phone": "+1 555-0199",
    "date": "2026-04-01"
  },
  "customParams": {
    "role": "Lead Architect",
    "department": "Engineering"
  },
  "createdAt": "2026-03-30T10:15:00.000Z",
  "signedAt": "2026-03-30T10:18:22.000Z",
  "downloadUrl": "http://localhost:3333/download/8f3a91b2c4e5d6f7a8b9c0d1e2f3a4b5"
}

Web Interface Overview

Admin Dashboard (/admin)

  • Document Management:
    • Upload PDF agreements via drag-and-drop.
    • Set active default template.
    • Delete obsolete templates.
  • Visual Field Placement & Variable Mapping:
    • Drag Text, Signature, or Date tool items onto rendered PDF pages.
    • Position and resize fields to align with document lines.
    • Map fields to standard variables (signer_name, signer_email, signer_phone, date) or custom parameter keys.
    • Click Save Placed Fields to commit changes.
  • Signing Requests Monitor:
    • Track statuses (pending, signed).
    • Create manual signing links with custom parameters.
    • Copy signing links directly to clipboard.
    • Preview and download signed PDFs.

Client Signing Portal (/sign/:token)

  • Renders document pages directly in the browser via PDF.js.
  • Step-by-step floating navigation dock (Field X of Y).
  • Automatically scrolls to active fields.
  • Allows signing via touch/mouse canvas drawing or cursive text typing.
  • Stamping and instant download once submitted.

Security & Data Storage

  1. Storage Structure:
    ~/.vfunct-mcp/signing/
    ├── signing.db            # SQLite database (documents, fields, requests)
    ├── uploads/              # Uploaded PDF templates
    │   └── doc_xxx_contract.pdf
    └── signed/               # Final executed PDFs with stamps & audit trail
        └── req_xxx_signed.pdf
    
  2. Access Control (MCP_AUTH_TOKEN):
    • When set, accesses to /admin and document APIs (/api/documents/*, /api/requests/*) require authentication via Bearer token, cookie (auth_token), or query parameter (?token=...).
    • Signing endpoints (/sign/:token, /api/sign/:token/*, /download/:token) remain publicly accessible so clients can sign without administrative credentials.

License

MIT License.