Skip to main content

DocuSign eSignature MCP Server

Create a powerful Model Context Protocol (MCP) server for DocuSign eSignature in minutes with our AI Gateway. This guide walks you through setting up seamless document signing integration with workflow automation and instant OAuth authentication.

About DocuSign eSignature API

DocuSign eSignature is the world's leading electronic signature solution, enabling organizations to digitally prepare, sign, act on, and manage agreements. The API provides comprehensive access to envelope creation, signing workflows, template management, and document tracking.

Key Capabilities

  • Envelope Management: Create, send, and track documents
  • Template System: Reusable document templates
  • Recipient Management: Multiple signers and routing
  • Workflow Automation: Conditional routing and rules
  • Bulk Operations: Send to multiple recipients
  • Embedded Signing: In-app signing experience
  • Document Generation: Dynamic document creation
  • Audit Trail: Comprehensive tracking and compliance

API Features

  • RESTful API: Modern HTTP/JSON interface
  • OAuth 2.0: Secure authentication
  • Webhooks: Real-time event notifications
  • SDK Support: Multiple programming languages
  • Sandbox Environment: Safe testing
  • API Limits: Generous rate limits
  • Bulk Send: Mass document distribution
  • PowerForms: Public-facing forms

What You Can Do with DocuSign eSignature MCP Server

The MCP server transforms DocuSign eSignature API into a natural language interface, enabling AI agents to:

Envelope Operations

  • Document Sending

    • "Send contract to John for signature"
    • "Create NDA with two signers"
    • "Send bulk agreements to 50 recipients"
    • "Use sales template for new customer"
  • Envelope Management

    • "Check status of contract #12345"
    • "Resend reminder to pending signers"
    • "Void unsigned envelope"
    • "Correct recipient information"
  • Document Handling

    • "Add attachment to envelope"
    • "Download signed documents"
    • "Merge multiple PDFs"
    • "Apply document fields"

Signing Experience

  • Recipient Configuration

    • "Set signing order for three signers"
    • "Add carbon copy recipients"
    • "Configure in-person signer"
    • "Set up witness requirement"
  • Signature Fields

    • "Place signature field on page 3"
    • "Add initial fields"
    • "Insert date signed field"
    • "Create checkbox for agreement"
  • Embedded Signing

    • "Generate signing URL"
    • "Create sender view"
    • "Customize signing experience"
    • "Handle post-signing redirect"

Template Management

  • Template Creation

    • "Create employment agreement template"
    • "Set up reusable NDA"
    • "Define template roles"
    • "Configure default fields"
  • Template Usage

    • "Send using HR template"
    • "Pre-fill template data"
    • "Override template settings"
    • "Bulk send from template"
  • Template Sharing

    • "Share template with team"
    • "Copy template to folder"
    • "Export template definition"
    • "Import external template"

Workflow Automation

  • Conditional Routing

    • "Route based on amount field"
    • "Skip signer if checkbox unchecked"
    • "Conditional carbon copies"
    • "Dynamic recipient assignment"
  • Reminders & Expiration

    • "Set reminder schedule"
    • "Configure expiration date"
    • "Auto-void after 30 days"
    • "Escalation rules"
  • Post-Signature Actions

    • "Trigger webhook on completion"
    • "Store in document system"
    • "Update CRM record"
    • "Send to archive"

Tracking & Reporting

  • Envelope Status

    • "List pending signatures"
    • "Show completed today"
    • "Track by recipient"
    • "Monitor template usage"
  • Audit Trail

    • "Get certificate of completion"
    • "View detailed history"
    • "Export audit logs"
    • "Compliance reporting"
  • Analytics

    • "Average time to sign"
    • "Completion rates"
    • "Template performance"
    • "User activity"

Account Management

  • User Administration

    • "Create new user"
    • "Assign permissions"
    • "Manage groups"
    • "Set up delegations"
  • Brand Management

    • "Upload company logo"
    • "Customize email text"
    • "Set brand colors"
    • "Configure signing page"
  • Settings & Preferences

    • "Update account settings"
    • "Configure security"
    • "Set up authentication"
    • "Manage integrations"

Prerequisites

  • Access to Cequence AI Gateway
  • DocuSign account (Developer or Production)
  • OAuth 2.0 integration key
  • RSA key pair for JWT authentication

Step 1: Configure DocuSign API Access

1.1 Create Integration Key

  1. Log in to DocuSign Admin
  2. Navigate to Integrations Apps and Keys
  3. Click Add App and Integration Key
  4. Configure:
    • App Name: "AI Gateway Integration"
    • Authentication: JWT Grant
    • Redirect URIs: Add your callback URL

1.2 Generate RSA Key Pair

# Generate private key
openssl genrsa -out private.key 2048

# Generate public key
openssl rsa -in private.key -pubout -out public.key

Upload public key to DocuSign integration.

  1. Build consent URL:
https://account-d.docusign.com/oauth/auth?
response_type=code&
scope=signature%20impersonation&
client_id=YOUR_INTEGRATION_KEY&
redirect_uri=YOUR_REDIRECT_URI
  1. Grant admin consent for organization

1.4 Note Credentials

  • Integration Key (Client ID)
  • User ID (for impersonation)
  • Account ID
  • Private key

Step 2-4: Standard Setup

Follow standard steps to access AI Gateway, find DocuSign eSignature API, and create MCP server.

Step 5: Configure API Endpoints

  1. Base URL:
    • Demo: https://demo.docusign.net/restapi
    • Production: https://na4.docusign.net/restapi
  2. API Version: v2.1
  3. Account ID: Your DocuSign account ID
  4. Click Next

Step 6: MCP Server Configuration

  1. Name: "DocuSign eSignature"
  2. Description: "Electronic signature and document workflow"
  3. Request Timeout: 60 seconds
  4. Click Next

Step 7: Configure Authentication

  1. Authentication Type: OAuth 2.0 JWT
  2. Token URL: https://account-d.docusign.com/oauth/token
  3. Grant Type: urn:ietf:params:oauth:grant-type:jwt-bearer
  4. Configure JWT assertion with private key

Available DocuSign eSignature API Operations

Envelope APIs

  • Create & Send

    • Create envelope
    • Send envelope
    • Create from template
    • Send bulk envelopes
  • Manage

    • Get envelope
    • Update envelope
    • Void envelope
    • Delete envelope
  • Recipients

    • Add recipients
    • Update recipient
    • Delete recipient
    • Resend envelope

Document APIs

  • Document Operations

    • Add documents
    • Get documents
    • Update document
    • Delete document
  • Fields & Tabs

    • Add signature fields
    • Text fields
    • Checkboxes
    • Radio buttons

Template APIs

  • Template Management

    • Create template
    • Get templates
    • Update template
    • Share template
  • Template Usage

    • Create envelope from template
    • Get template definition
    • Lock/Unlock template

Signing APIs

  • Embedded Signing
    • Create recipient view
    • Create sender view
    • Create correct view
    • Get signing groups

Account APIs

  • User Management
    • List users
    • Create user
    • Update user profile
    • User settings

Step 8-10: Complete Setup

Configure security settings, choose deployment options, and deploy your server.

Using Your DocuSign eSignature MCP Server

With Claude Desktop

{
"servers": {
"docusign": {
"url": "your-mcp-server-url",
"auth": {
"type": "oauth2-jwt",
"client_id": "your-integration-key",
"user_id": "your-user-id",
"private_key": "your-private-key",
"account_id": "your-account-id"
}
}
}
}

Natural Language Commands

  • "Send the sales contract to john@example.com for signature"
  • "Check if the NDA I sent yesterday was signed"
  • "Create a new hire packet using the HR onboarding template"
  • "Download all completed documents from this week"
  • "Set up a signing order: CEO first, then CFO, then legal"

API Integration Example

// Initialize MCP client
const mcpClient = new MCPClient({
serverUrl: 'your-mcp-server-url',
auth: {
type: 'oauth2-jwt',
clientId: 'your-integration-key',
userId: 'your-user-id',
privateKey: 'your-private-key',
accountId: 'your-account-id'
}
});

// Create and send envelope
const envelope = await mcpClient.docusign.createEnvelope({
emailSubject: 'Please sign this NDA',
emailBlurb: 'Hello, please review and sign the attached NDA.',
status: 'sent',
documents: [{
documentBase64: Buffer.from(pdfContent).toString('base64'),
name: 'Non-Disclosure Agreement',
fileExtension: 'pdf',
documentId: '1'
}],
recipients: {
signers: [{
email: 'john.doe@example.com',
name: 'John Doe',
recipientId: '1',
routingOrder: '1',
tabs: {
signHereTabs: [{
documentId: '1',
pageNumber: '3',
xPosition: '100',
yPosition: '500'
}],
dateSignedTabs: [{
documentId: '1',
pageNumber: '3',
xPosition: '300',
yPosition: '500'
}]
}
}],
carbonCopies: [{
email: 'legal@company.com',
name: 'Legal Department',
recipientId: '2',
routingOrder: '2'
}]
}
});

console.log(`Envelope sent! ID: ${envelope.envelopeId}`);

// Create envelope from template
const fromTemplate = await mcpClient.docusign.createEnvelopeFromTemplate({
templateId: 'a5b3cf1e-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
templateRoles: [{
email: 'newemployee@example.com',
name: 'Sarah Johnson',
roleName: 'Employee',
tabs: {
textTabs: [{
tabLabel: 'StartDate',
value: '2025-02-15'
}]
}
}, {
email: 'hr@company.com',
name: 'HR Manager',
roleName: 'HR Representative'
}],
status: 'sent',
emailSubject: 'Welcome to the Company - Please Complete Onboarding'
});

// Bulk send
const bulkSend = await mcpClient.docusign.createBulkSendList({
name: 'Q1 Contract Renewals',
bulkCopies: [
{
recipients: [{
email: 'client1@example.com',
name: 'Client One',
roleName: 'Customer'
}],
customFields: {
contractValue: '50000',
renewalDate: '2025-04-01'
}
},
{
recipients: [{
email: 'client2@example.com',
name: 'Client Two',
roleName: 'Customer'
}],
customFields: {
contractValue: '75000',
renewalDate: '2025-04-15'
}
}
]
});

const bulkEnvelope = await mcpClient.docusign.createBulkSendEnvelope({
bulkSendListId: bulkSend.listId,
templateId: 'renewal-template-id'
});

// Embedded signing
const signingUrl = await mcpClient.docusign.createRecipientView({
envelopeId: envelope.envelopeId,
recipientId: '1',
returnUrl: 'https://app.company.com/signing-complete',
authenticationMethod: 'email',
email: 'john.doe@example.com',
userName: 'John Doe',
clientUserId: 'user-123' // Must be set when creating envelope
});

console.log(`Signing URL: ${signingUrl.url}`);

// Check envelope status
const status = await mcpClient.docusign.getEnvelope({
envelopeId: envelope.envelopeId
});

console.log(`Status: ${status.status}`);
console.log(`Signed by: ${status.recipients.signers.filter(s => s.status === 'completed').length}`);

// Download documents
const documents = await mcpClient.docusign.getEnvelopeDocuments({
envelopeId: envelope.envelopeId,
documentId: 'combined', // Get all docs combined
certificate: true // Include certificate of completion
});

// Save to file
fs.writeFileSync('signed-documents.pdf', documents);

// Set up webhook for real-time updates
const connect = await mcpClient.docusign.createConnectConfiguration({
name: 'AI Gateway Webhook',
urlToPublishTo: 'https://your-app.com/webhooks/docusign',
eventData: {
version: 'restv2.1',
includeData: ['recipients', 'tabs', 'custom_fields'],
requireAcknowledgment: true
},
events: [
'envelope-sent',
'envelope-delivered',
'envelope-completed',
'envelope-declined',
'envelope-voided',
'recipient-sent',
'recipient-delivered',
'recipient-completed'
],
requiresAcknowledgment: true,
signMessageWithX509Certificate: true,
includeDocuments: false,
includeEnvelopeVoidReason: true,
includeTimeZone: true
});

// Handle webhook events
app.post('/webhooks/docusign', (req, res) => {
const event = req.body;

// Verify webhook signature
if (!verifyWebhookSignature(req)) {
return res.status(401).send('Invalid signature');
}

console.log(`Event: ${event.event}`);
console.log(`Envelope: ${event.envelopeId}`);

if (event.event === 'envelope-completed') {
// All recipients have signed
processCompletedEnvelope(event);
}

res.status(200).send('OK');
});

// Template management
const template = await mcpClient.docusign.createTemplate({
name: 'Employee Onboarding',
description: 'Standard employee onboarding documents',
emailSubject: 'Welcome - Please Complete Onboarding',
documents: [{
documentBase64: employeeHandbookPdf,
name: 'Employee Handbook',
fileExtension: 'pdf',
documentId: '1'
}],
recipients: {
signers: [{
roleName: 'Employee',
recipientId: '1',
routingOrder: '1',
tabs: {
signHereTabs: [{
documentId: '1',
pageNumber: '15',
anchorString: 'Employee Signature:',
anchorXOffset: '150',
anchorYOffset: '0'
}],
textTabs: [{
documentId: '1',
pageNumber: '1',
tabLabel: 'EmployeeName',
anchorString: 'Name:',
anchorXOffset: '50'
}]
}
}]
}
});

// Advanced envelope with conditional routing
const conditionalEnvelope = await mcpClient.docusign.createEnvelope({
emailSubject: 'Purchase Order Approval',
status: 'sent',
documents: [/* ... */],
recipients: {
signers: [{
email: 'manager@company.com',
name: 'Department Manager',
recipientId: '1',
routingOrder: '1',
tabs: {
numberTabs: [{
tabLabel: 'PurchaseAmount',
documentId: '1',
pageNumber: '1',
xPosition: '200',
yPosition: '300',
required: true
}]
}
}],
conditionalRecipients: [{
recipientId: '2',
routingOrder: '2',
conditions: [{
field: 'PurchaseAmount',
operator: 'greaterThan',
value: '10000'
}],
recipients: [{
email: 'cfo@company.com',
name: 'Chief Financial Officer'
}]
}]
}
});

// List and filter envelopes
const recentEnvelopes = await mcpClient.docusign.listEnvelopes({
fromDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
status: 'completed',
searchText: 'contract',
count: 100
});

console.log(`Found ${recentEnvelopes.totalSetSize} completed contracts this week`);

Common Use Cases

Contract Management

  • Sales agreements
  • Service contracts
  • Renewal processing
  • Amendment tracking

HR Documents

  • Offer letters
  • Onboarding packets
  • Policy acknowledgments
  • Performance reviews
  • NDAs
  • Terms of service
  • Privacy policies
  • Compliance forms

Financial Documents

  • Loan applications
  • Investment forms
  • Tax documents
  • Insurance policies

Best Practices

  1. Template Usage:

    • Create templates for repeated documents
    • Use merge fields for personalization
    • Version control templates
    • Test thoroughly before production
  2. Security:

    • Use JWT authentication for server apps
    • Implement webhook signature verification
    • Encrypt sensitive data
    • Audit API access
  3. User Experience:

    • Provide clear signing instructions
    • Use anchor tags for field placement
    • Test on mobile devices
    • Handle edge cases gracefully

Troubleshooting

Common Issues

  1. Authentication Errors

    • Verify JWT token generation
    • Check key pair configuration
    • Ensure proper consent granted
    • Validate account ID
  2. Envelope Errors

    • Check recipient email validity
    • Verify document format
    • Ensure unique recipient IDs
    • Validate tab placement
  3. API Limits

    • Monitor rate limits
    • Implement exponential backoff
    • Use bulk operations
    • Cache when appropriate

Getting Help