foxit-esign-mcp
v1.11.1
Published
MCP server for Foxit eSign API — send, track, and manage signature envelopes from Claude
Downloads
923
Readme
Foxit eSign MCP Server
An MCP (Model Context Protocol) server that connects Claude to the Foxit eSign API — send, track, and manage e-signature envelopes without leaving your conversation.
Ask Claude things like:
- "Send this NDA to [email protected] for signature"
- "What contracts are still waiting to be signed?"
- "Cancel the vendor agreement I sent yesterday"
- "Download all signed leases from last month"
- "Use our standard offer letter template and send it to the new hire"
- "Generate this contract and send it — embed the signature fields directly in the document"
- "Save as draft and give me the editor link so I can place fields myself"
Quick install (Claude Desktop)
Requires Node.js 18+ and Claude Desktop.
claude mcp add foxit-esign-mcp \
-e FOXIT_CLIENT_ID=your_client_id \
-e FOXIT_CLIENT_SECRET=your_client_secret \
-e FOXIT_BASE_URL=https://na1.foxitesign.foxit.com/api \
-- npx -y foxit-esign-mcp@latestRestart Claude Desktop. That's it — all 17 tools are available immediately.
Get your Client ID and Client Secret from the Foxit eSign dashboard → Settings → API Keys.
Or run the setup wizard
Prefer not to wrangle command-line flags? Run the interactive wizard — it collects your credentials, verifies them against the Foxit API, and patches your Claude Desktop / ChatGPT Desktop config automatically (merging in without disturbing any other MCP servers you already have):
npx foxit-esign-mcp setupNon-interactive (CI / scripted):
npx foxit-esign-mcp setup \
--client-id=your_client_id \
--client-secret=your_client_secret \
--region=na1 \
--apps=claude,chatgptAdd --no-verify to skip the credential check. Restart your desktop app afterward.
What's included
17 tools across two categories:
| Category | Tools | |----------|-------| | Envelopes | send document (URL / base64 / local file), list by status, get details, batch details, search by name, send reminder, view activity, send draft, download files, cancel, delete, stale envelopes, expiring soon | | Templates | list templates, get template details, send from template, create template from PDF |
See docs/TOOLS.md for the full reference with parameters and example prompts.
Key features
AI-assisted field placement
Claude reads your PDF, finds signature lines, date blanks, and initials boxes, then places all fields automatically in a single API call — no drag-and-drop required.
"Send contracts/nda.pdf to [email protected] for signature"
→ Claude reads the PDF, scores field confidence, places all fields, sends immediatelyText tag support (AI-generated documents)
When Claude generates a document, it can embed Foxit text tags directly in the content. Foxit converts them to form fields automatically — no coordinate math needed.
"Draft a consulting agreement with ABC Corp and send it to [email protected]"
→ Claude generates the PDF with ${signfield:1:y:____} tags embedded,
sends with processTextTags:true — fields appear exactly where the tags areFast draft path
Not sure where the fields go? Tell Claude to save as draft. It returns a visual editor link in ~2 seconds so you can drag-and-drop fields yourself.
"Save this as a draft — I'll place the fields myself"
→ Returns draftEditUrl in ~2s, no field analysis runDual transport
| Mode | Transport | Use case | |------|-----------|----------| | Local | stdio → Claude Desktop | Your machine, your credentials | | Cloud | HTTP → Vercel + claude.ai | Shared deployment, per-user OAuth |
Supported regions
| Region | Code | API base URL |
|--------|------|--------------|
| United States | na1 | https://na1.foxitesign.foxit.com/api |
| Canada | na2 | https://na2.foxitesign.foxit.com/api |
| Europe | eu1 | https://eu1.foxitesign.foxit.com/api |
| Australia | au1 | https://au1.foxitesign.foxit.com/api |
In cloud mode the user selects their region on the OAuth consent page — no server configuration needed.
In local mode set FOXIT_BASE_URL to the correct regional endpoint.
Installation options
Option A — npx (recommended, always latest)
claude mcp add foxit-esign-mcp \
-e FOXIT_CLIENT_ID=your_client_id \
-e FOXIT_CLIENT_SECRET=your_client_secret \
-e FOXIT_BASE_URL=https://na1.foxitesign.foxit.com/api \
-- npx -y foxit-esign-mcp@latestThis pulls the latest version from npm on every startup. No git clone, no build step.
Option B — Manual Claude Desktop config
If you prefer to pin a version or manage the config yourself, edit your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"foxit-esign-mcp": {
"command": "npx",
"args": ["-y", "foxit-esign-mcp@latest"],
"env": {
"FOXIT_BASE_URL": "https://na1.foxitesign.foxit.com/api",
"FOXIT_CLIENT_ID": "your_client_id_here",
"FOXIT_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}Restart Claude Desktop after saving.
Option C — Build from source
git clone https://github.com/niketchoudhary/FoxiteSignMCP
cd FoxiteSignMCP/foxit-esign-mcp
npm install
npm run buildThen add to Claude Desktop config pointing to the absolute path of dist/index.js:
{
"mcpServers": {
"foxit-esign-mcp": {
"command": "node",
"args": ["/absolute/path/to/foxit-esign-mcp/dist/index.js"],
"env": {
"FOXIT_BASE_URL": "https://na1.foxitesign.foxit.com/api",
"FOXIT_CLIENT_ID": "your_client_id_here",
"FOXIT_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}Option D — Vercel (cloud deployment for claude.ai)
Deploy as a serverless function so any claude.ai user can connect with their own Foxit credentials via OAuth.
1. Deploy
npm install
npx vercel --prodThe MCP endpoint will be live at:
https://your-project.vercel.app/mcpSet the JWT secret for session signing:
vercel env add OAUTH_JWT_SECRET
# Value: openssl rand -base64 322. Connect in claude.ai
Go to Settings → Connectors → Add custom connector:
| Field | Value |
|-------|-------|
| Name | Foxit eSign |
| Remote MCP server URL | https://your-project.vercel.app/mcp |
| OAuth Client ID | Your Foxit Client ID |
| OAuth Client Secret | Your Foxit Client Secret |
How the OAuth flow works
1. Claude hits /mcp → server returns 401 + WWW-Authenticate
2. Claude fetches /.well-known/oauth-protected-resource
3. Claude fetches /.well-known/oauth-authorization-server
4. Claude opens /authorize in the user's browser
5. User selects region + clicks "Authorize Access"
6. /authorize issues a short-lived auth code JWT containing region
7. Claude POSTs auth code + credentials to /token
8. /token verifies JWT, fetches Foxit token, wraps {foxit_token, region}
into a signed session JWT returned as the access_token
9. Claude retries /mcp with Authorization: Bearer <session_jwt>
10. /mcp decodes session JWT → routes to correct regional Foxit APIEach user authenticates with their own Foxit account. Nothing is stored server-side.
Environment variables
Local / Claude Desktop
| Variable | Required | Description |
|----------|----------|-------------|
| FOXIT_BASE_URL | No | Regional API base URL. Defaults to NA1. |
| FOXIT_CLIENT_ID | Yes* | OAuth2 client ID from Foxit developer portal |
| FOXIT_CLIENT_SECRET | Yes* | OAuth2 client secret from Foxit developer portal |
| FOXIT_BEARER_TOKEN | Yes* | Pre-fetched bearer token. Auto-fetched if absent. |
*Either FOXIT_BEARER_TOKEN or both FOXIT_CLIENT_ID + FOXIT_CLIENT_SECRET are required.
Vercel (cloud)
| Variable | Required | Description |
|----------|----------|-------------|
| OAUTH_JWT_SECRET | Yes | base64-encoded 32+ byte secret for signing session JWTs. Generate: openssl rand -base64 32. |
Development
# Live reload (stdio — Claude Desktop mode)
npm run dev:stdio
# Live reload (HTTP — local Vercel handler testing)
npm run dev:http
# Build TypeScript → dist/
npm run build
# Type-check all targets without emitting
npm run typecheck
# Run live API tests (requires .env.local with credentials)
npm run test
# Read-only integration test (safe to run any time)
npm run test:integration
# Interactive browser-based tool inspector
npx @modelcontextprotocol/inspector node dist/index.jsProject structure
src/
app.ts — MCP server factory; registers all 17 tools + field_placement_guide prompt resource
index.ts — stdio entry point (Claude Desktop / npx)
server.ts — Express HTTP entry point (local testing)
client.ts — FoxitClient — auth, token refresh, typed HTTP helpers
types.ts — TypeScript interfaces for all API response shapes
constants.ts — REGIONS map, CHARACTER_LIMIT, REQUEST_TIMEOUT_MS
tools/
folders.ts — 13 envelope tools
templates.ts — 4 template tools
fieldPlacementGuide.ts — Full field placement reference (text tags + coordinate rules)
utils.ts — Shared helpers: truncate, formatDate, flattenPdf, rasterizePdf, etc.
api/
mcp.ts — Vercel MCP handler (JWT auth, per-request FoxitClient)
authorize.ts — OAuth consent page (/authorize)
token.ts — OAuth token exchange (/token)
oauth-metadata.ts — /.well-known/oauth-authorization-server
oauth-protected-resource.ts — /.well-known/oauth-protected-resource
docs/
TOOLS.md — Full tool reference with parameters and example prompts
FIELD_PLACEMENT_SKILL.md — Field placement rules, coordinate tables, confidence scoring
FOXIT_API_REFERENCE.md — Complete Foxit eSign REST API reference
ARCHITECTURE.md — Sequence diagrams, JWT formats, PDF pipeline, security controlsNotes
- All tools verified against the live Foxit NA1 API
- Responses over 25,000 characters are truncated with a continuation hint
foxit_send_documentwithsource: "local_file"works in local (stdio) mode only — the server must have filesystem access to the PDF path- Token refresh is handled automatically on 401 responses in stdio mode
- PDFs with non-embedded fonts are auto-rasterized for rendering compatibility (requires Python 3 + PyMuPDF)
- PDFs with AcroForm / XFA interactive fields are auto-flattened before sending
