home / mcp / instant mcp server
Provides an MCP server in Python for the Instantly V2 API with 38 tools across accounts, campaigns, leads, emails, analytics, and background jobs.
Configuration
View docs{
"mcpServers": {
"bcharleson-instantly-mcp-python": {
"url": "https://your-server.com/mcp/YOUR_API_KEY",
"headers": {
"INSTANTLY_API_KEY": "your-api-key-here"
}
}
}
}You run an MCP (Model Context Protocol) server built in Python to expose 38 tools across accounts, campaigns, leads, emails, analytics, and background jobs. It supports remote HTTP deployments and local stdio workflows, loads only the tool categories you need to optimize context usage, and can handle per-request API keys for multi-tenant setups. This guide walks you through practical usage, installation, and configuration to get you running quickly.
You interact with the MCP server through your MCP client. Start a server in HTTP mode for remote deployments so clients connect over the network. For local development, run in stdio mode and connect directly from your tooling.
Prerequisites: Python 3.11+ and a working internet connection.
1) Clone or navigate to your project directory.
2) Install the package in editable mode.
3) Install required Python dependencies.
Set your Instantly API key to enable authentication for the MCP server. You can provide it via environment variable INSTANTLY_API_KEY, pass a key through a URL path, or send it in HTTP headers as x-instantly-api-key or Authorization. The server supports per-request API keys for multi-tenant deployments, ensuring isolated usage per client.
If you encounter authentication errors, verify that your API key is provided in the expected method (environment variable, URL, or header) and that the key matches the active tenant. If you hit rate limits, the server reports remaining quota and reset times based on the upstream API response headers. For performance, consider lazy loading by loading only the necessary tool categories to minimize the context window.
For multi-tenant HTTP deployments, you can start the server without a default API key and require clients to supply their own per-request API keys via headers. Use HTTPS in production and protect API keys in environment variables or secret management systems. Keep dependencies up to date to benefit from the latest error handling and timeout improvements.
The following configurations illustrate both HTTP-based and stdio-based MCP server invocations. Use these as exact starting points in your environment.
The MCP server exposes 38 tools organized into six categories: accounts, campaigns, leads, emails, analytics, and background_jobs. Each tool performs a specific action such as listing accounts, creating campaigns, updating leads, or fetching analytics. Use the appropriate tool in your MCP client to perform operations against your data through the server.
- URL-based authentication: access via a key embedded in the URL path, for example: https://your-server.com/mcp/YOUR_API_KEY.
- Header-based authentication: provide the API key in the Authorization header as a bearer or plain value, e.g., Authorization: YOUR_API_KEY.
- Custom header method: use a dedicated header like x-instantly-api-key: YOUR_API_KEY.
- Environment variable: export INSTANTLY_API_KEY=your-api-key-here locally.
Load only the tool categories you need to minimize the context window. For example, load accounts and campaigns together for a lean set of 14 tools, or leads and analytics for a different workflow.
For deployments serving multiple users, you can start the server without a default API key and require per-request keys. Clients supply their key via a header in each request.
The server returns detailed, actionable error messages. It also tracks rate limits automatically by inspecting API response headers and exposes remaining quota, total limit, and reset times in its status information.
Run the HTTP mode server with a specific port to expose it remotely.
List email accounts with filtering
Get account details and warmup status
Create account with IMAP/SMTP credentials
Update account settings
Pause, resume, warmup control, test vitals
Permanently delete account
Create email campaign (two-step process)
List campaigns with pagination
Get campaign details and sequences
Update campaign settings
Start campaign sending
Stop campaign sending
Permanently delete campaign
Find campaigns a contact is enrolled in
List leads with filtering
Get lead details
Create single lead
Update lead (replaces custom_variables)
List lead lists
Create lead list
Update lead list
Get email verification stats
Bulk add up to 1,000 leads
Permanently delete lead
Permanently delete lead list
Move/copy leads between campaigns/lists
List emails with filtering
Get email details
Send real email reply
Count unread inbox emails
Verify email deliverability
Mark email thread as read
Campaign metrics (opens, clicks, replies)
Day-by-day performance
Account warmup metrics
List async background jobs with pagination
Get details of a specific background job