@paubox/mcp
v2.1.0
Published
This is the official Model Context Protocol (MCP) server for Paubox Email API, designed to be hosted by Paubox and used by customers with their own API credentials.
Readme
Official Paubox MCP Server
This is the official Model Context Protocol (MCP) server for Paubox Email API, designed to be hosted by Paubox and used by customers with their own API credentials.
Overview
This MCP server enables AI assistants to send secure, HIPAA-compliant emails through the Paubox Email API and to retrieve and submit Paubox Forms. Users provide their own API key per session, ensuring security and multi-tenant support.
Features
- Send secure emails with optional encryption
- Check email delivery status
- Retrieve Paubox Form metadata and field schemas
- Submit Paubox Form responses (with optional file attachments)
- Manage Paubox Forms — create, update, archive, copy, list submissions, and export data (requires a scoped API key)
- HIPAA-compliant communication
- Easy integration with AI assistants that support MCP
- Paubox-branded UI with official components and styling
- Proxy support for custom endpoints (development/testing)
For Paubox Customers
You don't host or clone anything to use Paubox MCP — Paubox runs the server at https://mcp.paubox.com/mcp. Add it as a connector in your AI client and enter your Paubox API key in the connector configuration form when prompted. See Connecting to AI Assistants below for client-specific setup.
The rest of this README covers self-hosting and local development.
Proxy Configuration (Development/Testing)
For development or testing purposes, you can configure the MCP server to proxy requests to a custom endpoint instead of the official Paubox API.
Manual Setup
To enable the proxy, you need to manually import the proxy module in your application. Add this import to your main application file or where you initialize your server:
// Import this in your main app file to enable proxy functionality
import './lib/paubox-proxy'Environment Variables
Set these environment variables to enable proxy functionality:
# Enable proxy mode
PAUBOX_PROXY_ENABLED=true
# Custom base URL for proxying requests
PAUBOX_CUSTOM_BASE_URL=https://your-custom-endpoint.comHow It Works
The proxy system uses axios interceptors to automatically redirect all Paubox API requests from:
https://api.paubox.com/v1/email/
To your custom endpoint:
https://your-custom-endpoint.com/v1/email/
The proxy replaces the original API domain (https://api.paubox.com) with your custom base URL while preserving the API path structure.
Use Cases
- Testing: Point to a mock API server for testing
- Development: Use a local development server
- Custom Deployment: Route through your own proxy server
- Staging: Use a staging environment
Example Configuration
# For local development
PAUBOX_PROXY_ENABLED=true
PAUBOX_CUSTOM_BASE_URL=http://localhost:8080
# For staging environment
PAUBOX_PROXY_ENABLED=true
PAUBOX_CUSTOM_BASE_URL=https://staging-api.paubox.comImplementation Details
The proxy is implemented in lib/paubox-proxy.ts and only initializes when the PAUBOX_PROXY_ENABLED environment variable is set to true. It intercepts all HTTP requests made by the email API client (lib/paubox-email.ts) and modifies the base URL accordingly.
Note: The proxy is not automatically loaded by the MCP server to avoid test interference. You must manually import it if you want to use proxy functionality.
Styling & Components
This project uses Paubox's official design system:
- Brand Colors: Implements Paubox's official color palette
- Logo: Features the official Paubox logo
- Typography: Uses Paubox's design tokens and spacing
Color System
The application uses Paubox's official color palette:
- Primary (Blue):
#2E70FF- Main brand color - Success (Green):
#0EA472- Success states - Warning (Yellow):
#FFCA2F- Warning states - Danger (Red):
#E02D3C- Error states - Neutral (Gray): Various shades for text and backgrounds
Components
Available Paubox components include:
- Buttons with various styles and states
- Cards with branded headers and content areas
- Alerts for notifications and warnings
- Typography components
- Form inputs and controls
Connecting to AI Assistants
There are three ways to provide your Paubox API key, in resolution priority order:
- Per-call tool parameters (highest priority): Pass
apiKeydirectly in each tool call. Useful for one-off use or scripted clients. - Custom connector headers: Set
x-paubox-api-keyas a custom request header on the connector. Some MCP clients expose this in Advanced Settings when adding a custom connector. - OAuth (recommended for Claude.ai and Claude Desktop): Add the connector URL and a "Configure Paubox" form appears automatically. Enter your API key once — the client stores a short-lived encrypted Bearer token and sends it on every future request. The key is validated against the Paubox API at the moment you submit the form, so typos or expired keys are caught immediately.
Claude.ai — Claude Connectors (recommended)
- Go to claude.ai and open Settings → Integrations
- Click Add connector and enter URL
https://mcp.paubox.com/mcp - A "Configure Paubox" form opens — enter your API key
- Click Save
Claude stores your API key as a secure token in the system keychain and sends it automatically on every request. You never need to include credentials in your prompts.
Claude Code
Install once with your API key — no credential prompts afterward:
claude mcp add paubox \
-e PAUBOX_API_KEY=your_api_key \
-- npx @paubox/mcp@latestClaude Code spawns the package locally and injects the API key as an environment variable. All tools — email, forms, and forms management — work without passing credentials in each call.
Claude Desktop
- Open Claude Desktop and navigate to Settings
- Under the Developer tab, tap Edit Config
- Add this configuration:
{
"mcpServers": {
"paubox": {
"url": "https://mcp.paubox.com/mcp"
}
}
}- Save the file — Claude Desktop will open a browser window to the "Configure Paubox" form to collect your API key.
Cursor (for local testing)
Add to .cursor/mcp.json:
{
"mcpServers": {
"paubox": {
"url": "https://mcp.paubox.com/mcp"
}
}
}Available Tools
Note: When connecting via the
@paubox/mcpnpm package (Claude Code / stdio), the API key comes from thePAUBOX_API_KEYenvironment variable set at install time —apiKeyis not required in any tool call. When connecting via the hosted HTTP server (https://mcp.paubox.com/mcp), the API key is resolved from the OAuth token, thex-paubox-api-keyheader, or tool parameters.
validate_credentials
Confirms that a Paubox API key is present and correctly formatted.
Parameters (HTTP / hosted server only):
apiKey: Your Paubox API key (string, optional if provided via connector headers or OAuth)
Example Usage: ``` Validate my Paubox credentials with API key "pk_live_..." ```
send_secure_email
Sends a secure email using your Paubox API key.
Parameters:
apiKey: Your Paubox API key (string, optional — HTTP/hosted server only)from: Sender email address (string, required)to: Recipient email addresses (array, required)subject: Email subject (string, required)message: Email content (string, required). Plain text; blank lines become paragraphs and single newlines become line breaks in the HTML version. Bare URLs are made clickable.html: HTML body (string, optional). Used verbatim as thetext/htmlpart when provided;messageis still sent as thetext/plainfallback. Omit it to havemessagerendered to HTML automatically.cc: CC recipients (array, optional)bcc: BCC recipients (array, optional)forceSecureNotification: Force secure notification (boolean, optional)attachments: File attachments (array, optional). Each item is{ fileName, contentType, content }wherecontentis the base64-encoded file. 25 MB total limit across all attachments.
schedule_email accepts the same parameters (including attachments) plus an ISO 8601 scheduledAt.
Example Usage (credentials via connector): ``` Send a secure email from "[email protected]" to "[email protected]" with subject "Test Results" and message "Your results are ready." ```
Example Usage (credentials as parameters): ``` Send a secure email using my API key "pk_live_..." from "[email protected]" to "[email protected]" with subject "Test Results" and message "Your results are ready." ```
check_email_status
Checks the delivery status of a sent email.
Parameters:
apiKey: Your Paubox API key (string, optional — HTTP/hosted server only)sourceTrackingId: Tracking ID from sent email (string, required)
Example Usage: ``` Check the status of email with tracking ID "abc123" ```
get_form
Retrieves metadata and the field schema for a Paubox Form. No API credentials required.
Parameters:
formId: UUID of the Paubox Form (string, required)
Returns: id, title, description, field definitions (form_json), active status, signable flag, submission count, and timestamps.
Example Usage: ``` Get the form schema for Paubox form "550e8400-e29b-41d4-a716-446655440000" ```
submit_form
Submits a response to a Paubox Form. No API credentials required.
Parameters:
formId: UUID of the Paubox Form (string, required)formData: Key-value pairs matching the form's field schema (object, required)attachments: Optional file attachments (array of{ name, content }wherecontentis base64-encoded)
Example Usage: ``` Submit form "550e8400-e29b-41d4-a716-446655440000" with first_name "Jane", last_name "Smith", and email "[email protected]" ```
Paubox Forms management
The following tools manage forms and their submissions. Unlike get_form and submit_form (which remain credential-free), they require a scoped Paubox API key carrying the forms scope, sent as a Bearer token. This reuses the existing apiKey credential — via OAuth, x-paubox-api-key header, tool parameter, or the PAUBOX_API_KEY env var on stdio. Scoped API keys are managed in the Paubox admin dashboard.
list_forms: List a customer's forms with search, sorting, archived/active filters, and pagination (customerIdrequired)create_form: Create a new form from a title, field schema (formJson), andcustomerId, with optional description, HTML/CSS, notification recipients, and signable settingsupdate_form: Partially update a form — title, description,formJson, vanity URL, recipients, active status, or subscription listarchive_form/unarchive_form: Archive a form (deactivates it) or restore itcopy_form: Duplicate an existing form under a new titleget_form_stats: Active form count, total submissions, and submissions in the last 7 dayslist_form_submissions: List a form's submissions with parsed field data, submitter email, and attachment infoexport_submissions_csv: Export a form's submissions (or a single submission) as CSVexport_submission_pdf: Export a single submission as a base64-encoded PDF
With an apiKey available, get_form also uses the authenticated API, so inactive and archived forms become retrievable.
Example Usage: ``` List the active forms for customer 1234, then show me the submissions for the intake form ```
Paubox Email Marketing
These tools read and write Paubox Email Marketing data using the same apiKey
credential as the email tools — no extra scope is needed, but the account must
have Email Marketing provisioned. Run validate_marketing_access first if
another marketing tool reports that no marketing customer was found.
This tranche is read-only plus safe subscriber and list writes. Campaign sending and bulk deletion are deliberately not exposed; they need their own confirmation model first.
Access and subscribers
validate_marketing_access: Confirm Email Marketing is provisioned and return the marketing customer profile (name, from_name, from_email, physical address, global unsubscribe setting)list_subscribers: List subscribers with full-text search, scoping to a subscription or dynamic list, ordering, and pagination; omitsubscriptionListIdto search the default "All contacts" listget_subscriber: Retrieve one subscriber by UUID, with custom field values and list membershipscreate_subscriber: Add a subscriber (email or phone required); always joins "All contacts", updates rather than duplicates an existing match, and auto-creates unknown custom field namesupdate_subscriber: Partially update a subscriber by UUID; omitted fields stay unchangedget_subscribed_count: Count currently subscribed (not unsubscribed, not deleted) contacts on a listlist_subscriber_custom_fields: Discover which custom field namescreate_subscriberandupdate_subscribercan set
Audiences
list_marketing_lists: All audiences — static subscription lists and filter-based dynamic lists — in one view with subscriber countslist_subscription_lists: Static lists with their integer IDs, subscriber counts, and which is the default "All contacts" list. These IDs are whatsubscriptionListIdexpects elsewherecreate_subscription_list: Create a new empty subscription list and return its integer IDlist_dynamic_lists: Filter-based segments with their UUIDs, filter definitions, and subscriber counts
Campaigns and reporting
list_campaign_sends: Each time a marketing email went out to a list, with per-send delivered / viewed / clicked / bounced / unsubscribed countslist_campaign_deliveries: One row per recipient per campaign; scope withcampaignMailingIdorcampaignMailingSendIdget_campaign_analytics: Run one of five reports —campaign_mailing_sends_table,campaign_mailing_send_totals,campaign_mailing_deliveries_table,subscribers_by_tracking_link,tracking_links_by_unique_linkget_marketing_bulk_job: Check progress of an async bulk job; bulk imports and CSV exports return a job ID (jid/bid) instead of a result
Example Usage: ``` Which campaign send last month had the worst click rate, and who clicked the pricing link? ```
Keeping the tool list honest
tools.json is the manifest of every tool this server exposes. A test in
__tests__/mcp-server.test.ts calls tools/list and asserts the live set
matches it exactly, so adding or removing a tool fails CI until the manifest is
updated in the same change.
When you update tools.json, update these too:
README.md— the Available Tools section abovemcp-server/tools.mdxinPaubox/pb_mintlify, which publishes to docs.paubox.com/mcp-server/tools
Security & Compliance
- HIPAA Compliant: All emails are sent through Paubox's HIPAA-compliant infrastructure
- Credential Security: API credentials are never stored or logged
- Encrypted Transit: All communications use HTTPS/TLS encryption
- Audit Trail: Email sending and status checking activities are logged (without credentials)
Support
For technical support or API access questions, contact Paubox support at [email protected].
Development
Environment variables
Copy .env.example to .env.local and fill in the required value:
cp .env.example .env.local| Variable | Required | Description |
|----------|----------|-------------|
| JWT_SECRET | Yes | Signing secret for OAuth tokens. Generate with: openssl rand -base64 32 |
| PAUBOX_API_KEY | No | Local-dev fallback. Honored only when NODE_ENV !== 'production' and no OAuth token / x-paubox-* headers / tool parameters are present. Deliberately ignored in production to prevent cross-user credential bleed. |
Testing
Run the test suite:
pnpm testBuilding
Build for production:
pnpm buildDeployment
This project uses GitHub Actions for automated deployment to AWS ECR with three distinct deployment workflows:
Deployment Workflows
Staging Deployment (
.github/workflows/deploy-staging.yml)- Trigger: Pushes to
developbranch and pull requests todevelop - Purpose: Builds and pushes Docker images to staging ECR for testing
- Repository:
paubox-mcp-server-staging - Tags: Git SHA, branch name, PR number, and
latestfor develop branch
- Trigger: Pushes to
Production Deployment (
.github/workflows/deploy-prod.yml)- Trigger: Pull request merges to
mainbranch - Purpose: Automatically deploys approved changes to production
- Repository:
paubox-mcp-server-production - Tags: Git SHA and
latest - Process: Builds Docker image directly from source code
- Trigger: Pull request merges to
Hotfix Deployment (
.github/workflows/deploy-hotfix.yml)- Trigger: Manual workflow dispatch
- Purpose: Emergency deployments and urgent fixes
- Repository:
paubox-mcp-server-production - Use Cases: Critical bug fixes, security patches, rollbacks
GitHub Secrets
The deployment workflows use the following secrets configured at the organization level:
- AWS_GITHUB_ACTIONS_ACCESS_KEY_ID: AWS access key ID
- AWS_GITHUB_ACTIONS_SECRET_ACCESS_KEY: AWS secret access key
These credentials have permissions to:
- Push to staging ECR repository:
285263271540.dkr.ecr.us-west-2.amazonaws.com/paubox-mcp-server-staging - Push to production ECR repository:
285263271540.dkr.ecr.us-west-2.amazonaws.com/paubox-mcp-server-production - Authenticate with ECR
Deployment Process
Staging Flow:
- Code pushed to
developbranch or PR created - GitHub Actions builds Docker image
- Image pushed to staging ECR with appropriate tags
- Available for testing and validation
Production Flow:
- PR merged to
mainbranch - GitHub Actions automatically builds production Docker image
- Image pushed to production ECR with git SHA and latest tags
- Ready for production deployment
Hotfix Flow:
- Manual workflow trigger
- Builds and deploys specific code version
- Bypasses normal PR process for urgent situations
Manual Deployment
To deploy a feature branch manually to staging:
- Go to the Actions tab in GitHub
- Select Deploy to Staging workflow
- Click Run workflow
- Enter the branch name you want to deploy
- Click Run workflow
For production hotfixes:
- Go to the Actions tab in GitHub
- Select Deploy Hotfix workflow
- Click Run workflow
- Follow the workflow prompts
Styling
The project uses a hybrid approach:
- Tailwind CSS: For layout and responsive design
- Paubox Colors: Official brand colors via
lib/paubox-colors.ts - Component Styling: Inline styles for Paubox-specific theming
License
Licensed under the Apache License, Version 2.0.
Copyright © 2026 Paubox, Inc.
💬 Community & support
Questions, ideas, or want to share what you built? Join the Paubox Community — the single home for discussions across every Paubox SDK and API.
🔐 Found a security issue? Email [email protected] — please don't post it publicly.
