MCP Server

APISign provides a Model Context Protocol (MCP) server that enables AI agents to manage templates and send contracts programmatically.


Overview

The MCP server uses the Streamable HTTP transport, which works with any MCP-compatible client including Claude Desktop, Cursor, and custom implementations.


Connection Details

PropertyValue
EndpointPOST /mcp
TransportStreamable HTTP
AuthenticationAPI Key (x-api-key header)

Getting an API Key

  1. Log into the APISign dashboard
  2. Navigate to Account > API Keys
  3. Click Create API Key
  4. Copy the key (it won't be shown again)

Client Configuration

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "apisign": {
      "url": "https://apisign.io/mcp",
      "headers": {
        "x-api-key": "your-api-key-here"
      }
    }
  }
}

Cursor

Add to your Cursor MCP configuration:

{
  "mcpServers": {
    "apisign": {
      "url": "https://apisign.io/mcp",
      "headers": {
        "x-api-key": "your-api-key-here"
      }
    }
  }
}

Local Development

When running locally, use:

{
  "mcpServers": {
    "apisign": {
      "url": "http://localhost:3553/mcp",
      "headers": {
        "x-api-key": "your-api-key-here"
      }
    }
  }
}

Available Tools

Template Tools

template_list

List all templates in your organization.

Parameters: None

Returns:

{
  "templates": [
    {
      "id": "clx...",
      "name": "NDA Template",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ]
}

template_get

Get a specific template with its content and field definitions.

Parameters:

NameTypeRequiredDescription
idstringYesTemplate ID (CUID format)

Returns:

{
  "template": {
    "id": "clx...",
    "name": "NDA Template",
    "content": "# Non-Disclosure Agreement\n\nThis agreement...",
    "fields": {
      "fields": [
        { "name": "company_name", "type": "text", "completedBy": "creator" },
        { "name": "signature", "type": "signature", "completedBy": "signer" }
      ]
    }
  }
}

template_create

Create a new blank template.

Parameters:

NameTypeRequiredDescription
namestringYesTemplate name (min 3 characters)
contentstringNoMarkdown content

Example:

{
  "name": "Service Agreement",
  "content": "# Service Agreement\n\nBetween {{company_name}} and {{client_name}}..."
}

template_update

Update an existing template.

Parameters:

NameTypeRequiredDescription
idstringYesTemplate ID
namestringNoNew name
contentstringNoNew markdown content
fieldsarrayNoField definitions

Fields array format:

{
  "fields": [
    {
      "name": "company_name",
      "type": "text",
      "completedBy": "creator"
    },
    {
      "name": "signature",
      "type": "signature",
      "completedBy": "signer"
    }
  ]
}

template_upload

Upload a DOCX or DOC file and convert it to a template.

Parameters:

NameTypeRequiredDescription
filenamestringYesOriginal filename (must end in .doc or .docx)
fileDatastringYesBase64-encoded file content

template_archive

Archive (soft delete) a template.

Parameters:

NameTypeRequiredDescription
idstringYesTemplate ID

Contract Tools

contract_list

List contracts in your organization.

Parameters:

NameTypeRequiredDescription
statusstringNoFilter by status: draft, queued, sent, signed, cancelled, expired

Returns:

{
  "contracts": [
    {
      "id": "clx...",
      "name": "NDA - Acme Corp",
      "status": "sent",
      "created_at": "2024-01-15T10:30:00Z",
      "sent_at": "2024-01-15T11:00:00Z",
      "expires_at": "2024-02-14T11:00:00Z"
    }
  ]
}

contract_get

Get a contract with its signers.

Parameters:

NameTypeRequiredDescription
idstringYesContract ID

Returns:

{
  "contract": {
    "id": "clx...",
    "name": "NDA - Acme Corp",
    "status": "sent",
    "content": { "markdown": "..." }
  },
  "signers": [
    {
      "id": "clx...",
      "name": "John Doe",
      "email": "john@example.com",
      "status": "pending",
      "signing_order": 1
    }
  ]
}

contract_create

Create a new contract from a template or custom content.

Parameters:

NameTypeRequiredDescription
namestringYesContract name
template_idstringNoTemplate ID (if using a template)
contentstringNoMarkdown content (required if no template_id)
variablesobjectNoVariables to substitute (for template-based contracts)
expires_in_daysnumberNoDays until expiration (default: 30, max: 365)
signersarrayYesList of signers (at least one)

Signers array format:

{
  "signers": [
    {
      "email": "john@example.com",
      "name": "John Doe",
      "company": "Acme Corp",
      "signing_order": 1
    },
    {
      "email": "jane@example.com",
      "name": "Jane Smith",
      "signing_order": 2
    }
  ]
}

Example - From template:

{
  "name": "NDA - Acme Corp",
  "template_id": "clx...",
  "variables": {
    "company_name": "Acme Corporation",
    "effective_date": "January 15, 2024"
  },
  "signers": [
    {
      "email": "john@acme.com",
      "name": "John Doe",
      "signing_order": 1
    }
  ]
}

Example - Custom content:

{
  "name": "Simple Agreement",
  "content": "# Agreement\n\nI, {{signer_name}}, agree to the terms.\n\n{{signature}}",
  "signers": [
    {
      "email": "john@example.com",
      "name": "John Doe",
      "signing_order": 1
    }
  ]
}

contract_update

Update a draft contract. Only contracts with draft status can be updated.

Parameters:

NameTypeRequiredDescription
contract_idstringYesContract ID
namestringNoNew name
contentobjectNoNew content object
signersarrayNoReplace signers list

contract_send

Send a contract to signers for signing. This:

  • Changes status to sent
  • Charges your organization balance
  • Sends email notifications to all signers

Parameters:

NameTypeRequiredDescription
contract_idstringYesContract ID

Returns:

{
  "success": true,
  "contract_id": "clx...",
  "signers_notified": 2,
  "cost_charged": 0.25,
  "message": "Contract sent successfully"
}

contract_cancel

Cancel a contract. Only draft and sent contracts can be cancelled.

Parameters:

NameTypeRequiredDescription
contract_idstringYesContract ID

Template Variables

Templates use handlebar-style variables: {{variable_name}}

Variable Types

completedByDescription
creatorFilled when creating the contract
signerFilled by the signer when signing

Common Variables

  • {{company_name}} - Company name (creator)
  • {{client_name}} - Client name (creator)
  • {{effective_date}} - Contract effective date (creator)
  • {{signer_name}} - Signer's name (signer)
  • {{signature}} - Signature field (signer)
  • {{date}} - Signing date (signer)

Error Handling

All tools return errors in a consistent format:

{
  "error": "Error message here",
  "details": [
    { "field": "name", "message": "Name is required" }
  ]
}

Common Errors

ErrorDescription
Missing x-api-key headerNo API key provided
Invalid or disabled API keyAPI key not found or disabled
API key has expiredAPI key past expiration date
Template not foundTemplate ID doesn't exist or is archived
Contract not foundContract ID doesn't exist
Insufficient balanceOrganization needs to add funds
Only draft contracts can be updatedCannot update sent/signed contracts

Usage Examples

Create and Send a Contract

1. Use template_list to find available templates
2. Use template_get to view template content and fields
3. Use contract_create with template_id and variables
4. Use contract_send to send to signers

Upload a Document Template

1. Read document file and base64 encode it
2. Use template_upload with filename and fileData
3. Use template_update to set field definitions

Check Contract Status

1. Use contract_list with status filter
2. Use contract_get for detailed signer status

Rate Limits

API keys have configurable rate limits. Default limits:

  • 1000 requests per minute
  • Refills automatically

Need Higher Limits?

Contact support to increase limits for high-volume use cases.