DocuSign MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DocuSign MCP Server send the NDA template to jane@example.com for signature"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DocuSign MCP Server
Experimental Model Context Protocol (MCP) server for DocuSign eSignature API, built with Python + FastMCP. Uses JWT OAuth for true server-to-server authentication (no refresh tokens).
ā ļø Status & Disclaimers
Experimental: Not production-ready; no SLA; APIs and behavior may change.
No affiliation with DocuSign: This is a community integration. DocuSign is a trademark of DocuSign, Inc.
Security: Do not commit secrets. Treat private keys and tokens as sensitive; use a secrets manager. Use at your own risk.
Related MCP server: DocuSign MCP Server (patched)
Features
š JWT server-to-server authentication - No refresh tokens, fully headless operation
š Envelope management - Create, send, track, and manage envelopes
š Template operations - List and use DocuSign templates
š„ Document handling - Upload, download, and manage documents
š MCP protocol - Standard stdio transport for AI assistant integration
ā Unit tested - Comprehensive pytest coverage with mocks
Requirements
Python 3.11+
uvpackage manager (recommended) orpipDocuSign developer account (demo or production)
Integration key with JWT configured
RSA keypair for JWT authentication (you generate this)
Admin consent for
signature+impersonationscopes
Installation
Using uv (recommended)
# Install from GitHub
uvx --from git+https://github.com/luthersystems/mcp-server-docusign mcp-server-docusign
# Or install in project
uv pip install git+https://github.com/luthersystems/mcp-server-docusignUsing pip
pip install git+https://github.com/luthersystems/mcp-server-docusignDevelopment install
git clone https://github.com/luthersystems/mcp-server-docusign.git
cd mcp-server-docusign
uv pip install -e ".[dev]"Configuration
Environment Variables
Configure the server using environment variables (see Configuration Reference):
# Authentication base URL
DS_AUTH_BASE=https://account-d.docusign.com # Demo environment
# DS_AUTH_BASE=https://account.docusign.com # Production environment
# Integration credentials
DS_INTEGRATION_KEY=<your-integration-key-guid>
DS_USER_ID=<impersonated-user-guid>
# OAuth configuration
DS_OAUTH_SCOPE="signature impersonation"
# Private key path
DS_PRIVATE_KEY_PATH=./private.key
# Token expiration (seconds)
DS_TOKEN_EXP_SECS=3600DocuSign Setup
1. Create or Select Integration Key
Log into DocuSign Admin Console (demo) or Admin Console (production)
Navigate to Settings ā Apps & Keys
Either:
Use an existing integration key from the list (e.g.,
1fa2e333-fdc2-411c-ab65-18ed437eae53)Or create a new one: Click "+ ADD APP AND INTEGRATION KEY"
Note/copy the Integration Key (this is your
DS_INTEGRATION_KEY)
2. Generate RSA Keypair
# Generate private key
openssl genrsa -out private.key 2048
# Extract public key
openssl rsa -in private.key -pubout -out public.key3. Configure Integration
In DocuSign Admin Console, select your integration
Under Authentication, choose JWT (JSON Web Token)
Upload your
public.keyfile (generated in step 2)Under Redirect URIs, click "Add URI" and add:
https://www.docusign.comImportant: The redirect URI must exactly match what you'll use in the consent URL (no trailing slash)
Click Save at the bottom
4. Grant Admin Consent (One-Time Required)
Critical: Before the server can operate, an account administrator must grant consent for signature and impersonation scopes.
Steps:
Ensure the redirect URI is configured in Step 3 above (e.g.,
https://www.docusign.com)Construct the consent URL (replace
<INTEGRATION_KEY>with your actual integration key):https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation&client_id=<INTEGRATION_KEY>&redirect_uri=https://www.docusign.comFor demo/sandbox: use
https://account-d.docusign.comFor production: use
https://account.docusign.comThe
redirect_uriparameter must exactly match what you added in Step 3
Visit the URL in your browser while logged in as a DocuSign admin
Click "Allow Access" to grant consent
You'll be redirected to the redirect URI (which may show an error page, but that's OK - the consent was granted)
This is a one-time operation - you won't need to do it again unless you revoke consent or change scopes
Troubleshooting Template Permissions:
If you get 401 errors when accessing templates, ensure:
User has template permissions in DocuSign:
Go to Settings ā Users ā select the user
Under Permissions, ensure "Allow user to create and manage templates" is enabled
Save changes
Account has templates feature enabled (may require certain DocuSign plan levels)
The OAuth scopes are correct:
The
signaturescope (included in our consent URL) covers template accessIf you've modified scopes, you may need to re-grant consent
5. Get User ID
The User ID (GUID) can be found:
In DocuSign Admin Console ā Users ā select user ā user GUID in URL
Or via API call to
/oauth/userinfoafter initial authentication
Running the Server
Stdio Mode (default)
# Set environment variables
export DS_AUTH_BASE=https://account-d.docusign.com
export DS_INTEGRATION_KEY=your-integration-key
export DS_USER_ID=your-user-guid
export DS_PRIVATE_KEY_PATH=./private.key
# Run server
mcp-server-docusignThe server runs in stdio mode by default, suitable for MCP clients like Claude Desktop or Cursor.
Testing with MCP Inspector
npx -y @modelcontextprotocol/inspector uvx --from git+https://github.com/luthersystems/mcp-server-docusign mcp-server-docusignAvailable Tools
Envelope Operations
create_envelope_from_template
Creates an envelope from a DocuSign template.
Parameters:
template_id(string): Template ID to useemail_subject(string): Email subject linerole_assignments(array): List of role assignmentsroleName(string): Role name from templatename(string): Recipient's full nameemail(string): Recipient's emailclientUserId(string, optional): For embedded signing
email_blurb(string, optional): Email body textstatus(string, default: "sent"): "sent" or "created"
Returns: {envelopeId, status, statusDateTime}
create_envelope_from_documents
Creates an envelope from documents (not using a template).
Parameters:
documents(array): List of documentsname(string): Document namedocumentId(string): Document ID (e.g., "1", "2")fileExtension(string): File extension (e.g., "pdf")documentBase64(string): Base64-encoded content
recipients(object): Recipient listssigners(array): List of signers
email_subject(string): Email subjectemail_blurb(string, optional): Email bodystatus(string, default: "sent"): "sent" or "created"
Returns: {envelopeId, status, statusDateTime}
get_envelope_status
Gets status and metadata of an envelope.
Parameters:
envelope_id(string): Envelope ID
Returns: {envelopeId, status, emailSubject, createdDateTime, sentDateTime, completedDateTime, ...}
list_envelopes
Lists envelopes with optional filters.
Parameters:
from_date(string, optional): Start date (ISO 8601)to_date(string, optional): End date (ISO 8601)status(string, optional): Status filter
Returns: {envelopes[], resultSetSize, totalSetSize}
Template Operations
list_templates
Lists available DocuSign templates.
Parameters:
search_text(string, optional): Filter by name
Returns: {templates[], resultSetSize, totalSetSize}
get_template_definition
Gets complete template definition.
Parameters:
template_id(string): Template ID
Returns: {templateId, name, description, roles[], documents[], ...}
Document Operations
list_envelope_documents
Lists all documents in an envelope.
Parameters:
envelope_id(string): Envelope ID
Returns: {envelopeId, documents[]}
download_envelope_document
Downloads a document from an envelope.
Parameters:
envelope_id(string): Envelope IDdocument_id(string): Document ID
Returns: {envelopeId, documentId, contentBase64, sizeBytes}
Example Usage
Using with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"docusign": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/luthersystems/mcp-server-docusign",
"mcp-server-docusign"
],
"env": {
"DS_AUTH_BASE": "https://account-d.docusign.com",
"DS_INTEGRATION_KEY": "your-integration-key",
"DS_USER_ID": "your-user-guid",
"DS_PRIVATE_KEY_PATH": "/path/to/private.key"
}
}
}
}Example Prompts
"List my DocuSign templates"
"Create an envelope from template [template-id] with John Doe (john@example.com) as Signer1"
"Check the status of envelope [envelope-id]"
"Download document 1 from envelope [envelope-id]"
Development
Running Tests
# Install dev dependencies
uv pip install -e ".[dev]"
# Run unit tests (no credentials needed)
pytest
# Run with coverage
pytest --cov=mcp_server_docusign --cov-report=html
# Run linter
ruff check .
# Format code
ruff format .Integration Tests (Optional)
Integration tests validate real DocuSign API authentication. They are skipped by default and only run when you provide real credentials.
To enable integration tests:
Copy
.env.exampleto.env:cp .env.example .envFill in your DocuSign credentials in
.env:# Required fields (choose ONE of the two private key options): # Option 1: File path (recommended for local development) DS_AUTH_BASE=https://account-d.docusign.com DS_INTEGRATION_KEY=your-integration-key-guid DS_USER_ID=your-user-guid DS_PRIVATE_KEY_PATH=./private.key DS_OAUTH_SCOPE=signature impersonation # Option 2: Base64-encoded key (recommended for CI/CD) # DS_PRIVATE_KEY=LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0t...Create your RSA keypair:
openssl genrsa -out private.key 2048 openssl rsa -in private.key -pubout -out public.keyUpload
public.keyto DocuSign and grant admin consent (see.env.examplefor detailed instructions)Run integration tests:
pytest tests/test_integration.py -v
CI/CD Setup (GitHub Actions)
To run integration tests in GitHub Actions:
Encode your private key to base64:
# macOS/Linux base64 -i private.key | tr -d '\n' | pbcopy # This copies the base64-encoded key to your clipboardAdd GitHub repository secrets:
Go to your repo ā Settings ā Secrets and variables ā Actions
Add the following secrets:
DS_AUTH_BASE:https://account-d.docusign.comDS_INTEGRATION_KEY: Your integration key GUIDDS_USER_ID: Your user GUIDDS_PRIVATE_KEY: The base64-encoded private key (from step 1)
The CI workflow will automatically run integration tests when these secrets are present
Note: The integration tests will be skipped in PRs from forks (for security), but will run on pushes to main/develop branches.
What the integration tests verify:
ā JWT authentication works with your credentials
ā Access token can be obtained successfully
ā Account ID can be retrieved
ā Base URI is discovered correctly
ā API calls work (tests
list_templates)ā Token refresh mechanism works
Note: Integration tests require a DocuSign developer account (demo environment recommended).
Troubleshooting Template Access (401 Errors):
If the test_list_templates test is skipped with a 401 error, this indicates template access permissions are not configured. To fix:
Check User Permissions in DocuSign Admin Console:
Go to https://admindemo.docusign.com/ ā Users
Click on your user ā Permissions
Ensure these are enabled:
ā "Allow user to create and manage templates"
ā "Allow user to use templates"
ā "Allow user to share templates"
Save changes
Verify OAuth Scopes: The
signature impersonationscopes already cover template access. If you changed scopes, you may need to re-grant admin consent.Account Plan Limitations: Some DocuSign demo accounts may have limited API access. Templates should work with most developer accounts, but if issues persist, it may be an account-level restriction.
Note: The template test being skipped doesn't prevent the MCP server from functioning. Once deployed with proper production credentials and permissions, template operations will work normally.
Project Structure
mcp-server-docusign/
āāā src/mcp_server_docusign/
ā āāā __init__.py
ā āāā server.py # Main FastMCP server
ā āāā config.py # Configuration management
ā āāā docusign_client.py # JWT auth & API client
ā āāā tools/
ā āāā envelopes.py # Envelope tools
ā āāā templates.py # Template tools
ā āāā documents.py # Document tools
āāā tests/
ā āāā test_envelopes.py
ā āāā test_templates.py
ā āāā test_documents.py
āāā pyproject.toml
āāā README.mdTroubleshooting
"Failed to obtain JWT token"
Verify admin consent has been granted
Check integration key is correct
Ensure public key is uploaded to DocuSign
Verify user GUID is correct
"No accounts found for user"
User ID must be valid and active
Check user has proper permissions
Ensure impersonation scope is granted
"Authentication failed"
Verify private key matches uploaded public key
Check private key file path is correct
Ensure key file is readable
"Connection timeout"
Check internet connectivity
Verify firewall settings
Try demo environment (
account-d.docusign.com) first
Security Best Practices
Never commit private keys - Use
.gitignoreand environment variablesUse secrets management - Store credentials in secure vaults (AWS Secrets Manager, etc.)
Rotate keys regularly - Generate new keypairs periodically
Limit token lifetime - Use shorter expiration for sensitive operations
Monitor API usage - Check DocuSign dashboard for unusual activity
Use demo environment - Test with demo accounts before production
Architecture
Language: Python 3.11+
Framework: FastMCP
API Client: Official DocuSign Python SDK (
docusign-esign)Auth: JWT server-to-server OAuth
Transport: stdio (MCP protocol)
Testing: pytest with mocks
References
License
MIT
Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass
Submit a pull request
Support
This is an experimental community project. For DocuSign API issues, consult DocuSign Developer Center.
Available Tools
8 toolscreate_envelope_from_documentsCreate Envelope From DocumentsB
Create an envelope from documents (not using a template).
Inputs: documents (required), recipients (required), email_subject (required), status, +1 more. Returns: object
create_envelope_from_templateCreate Envelope From TemplateC
Create an envelope from a DocuSign template.
Inputs: template_id (required), email_subject (required), role_assignments (required), status, +1 more. Returns: object
download_envelope_documentDownload Envelope DocumentC
Download a specific document from an envelope.
Inputs: document_id (required), envelope_id (required). Returns: object
get_envelope_statusGet Envelope StatusC
Get the status and metadata of an envelope.
Inputs: envelope_id (required). Returns: object
get_template_definitionGet Template DefinitionC
Get the definition and details of a specific template.
Inputs: template_id (required). Returns: object
list_envelope_documentsList Envelope DocumentsC
List all documents in an envelope.
Inputs: envelope_id (required). Returns: object
list_envelopesList EnvelopesC
List envelopes with optional filters.
Inputs: status, to_date, from_date. Returns: object
list_templatesList TemplatesC
List available DocuSign templates.
Inputs: search_text. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 8 tools
Most tools target clearly distinct resources (templates vs envelopes vs documents) and actions (list vs download vs create). The main soft overlap is between list_envelopes with filters and get_envelope_status, since a status filter on the list may cover the same ground as the dedicated status call. Otherwise an agent can pick correctly without guessing.
Every tool follows a consistent snake_case verb_noun pattern (create_envelope_from_*, list_*, get_*_definition/status, download_envelope_document). The two creation variants share a deliberate parallel naming scheme that makes their relationship obvious. No mixed conventions or stray vague verbs.
Eight tools cover the core create/list/get/download flows for envelopes and templates without filler. Each tool maps to a concrete operation an agent would need in a DocuSign integration, which is well within the ideal 3-15 range.
The surface is read-heavy plus envelope creation: there is no way to update, void, delete, or resend an envelope, and no recipient management (add/update recipients), which is central to DocuSign workflows. Download of signed/completed documents and template creation are also absent, leaving several notable dead ends for a lifecycle that otherwise looks covered.
Maintenance
Related MCP Connectors
Create documents and reusable templates, request signatures, and track approvals ā for AI agents.
Send documents for e-signature from AI assistants, track signers, and download sealed, signed PDFs.
Secure Docusign Navigator integration for AI assistants to access and analyze agreement data.
Send AI-created PDFs for signature, track signers, and return verifiable document evidence.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to manage document signing workflows via natural language, including creating envelopes, uploading documents, analyzing contracts, and verifying blockchain anchors.1275 npm1MIT
- AlicenseAqualityDmaintenanceProvides DocuSign eSignature operations via JWT Grant for headless AI agents, enabling envelope management, document signing, and template access through MCP tools.9MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage eSignature workflows, including creating signing tasks, tracking document status, and managing templates via natural language.142-
- AlicenseAqualityCmaintenanceEnables AI assistants to send documents for e-signature from templates or local files, track signers and history, send reminders, create signing links, and download or verify sealed PDFs.1339 npmMIT