salesforce-marketing-mcp
Provides AI assistants access to Salesforce CRM data, including leads, contacts, accounts, campaigns, campaign members, tasks, analytics reports, pipeline analysis, attribution, and activity tracking, allowing marketing ops teams to manage and analyze Salesforce data without writing SOQL.
salesforce-marketing-mcp
A production-ready Model Context Protocol (MCP) server that gives AI assistants (Claude, Cursor, etc.) direct access to Salesforce CRM data. Built for marketing ops, revenue ops, and B2B marketing teams who want AI-assisted access to leads, contacts, campaigns, campaign members, tasks, and 14 reporting tools — all without writing SOQL.
Features
Leads — Search, get, create, update, and convert leads
Contacts — Search, get, create, update, and look up by email
Accounts — Search, get, and list contacts per account
Campaigns — List, get, create, and update campaigns
Campaign Members — List members, add individuals, bulk-add up to 200, update statuses
Tasks — Create tasks; list by lead, contact, or campaign
Analytics Reports — List, run, and describe Salesforce Analytics reports
Campaign Analytics — ROI calc, member status breakdown, top campaigns, performance trends
Attribution — Lead source breakdown, pipeline by campaign, CampaignInfluence, won revenue by campaign, lead conversion metrics
Pipeline — Pipeline summary, pipeline by lead source, MQL trend, forecast summary
Activity — Activity summary by dimension, recent activities by lead or contact
Power tools — Raw SOQL, SObject describe, list all objects
Prerequisites
A Salesforce org (any edition with API access)
Your Salesforce username, password, and security token
To get/reset your security token: Settings > Personal Information > Reset My Security Token
Node.js 20 or later
No connected app or OAuth setup required.
Setup
1. Install
npm install -g salesforce-marketing-mcp
# or run directly with npx
npx salesforce-marketing-mcp2. Environment variables
Variable | Required | Default | Description |
| Yes | — | Salesforce login email |
| Yes | — | Salesforce password |
| Yes | — | Security token (appended to password on login) |
| No |
| Use |
| No |
| Salesforce API version |
Create a .env file or set them in your shell:
export SF_USERNAME="you@yourcompany.com"
export SF_PASSWORD="yourpassword"
export SF_SECURITY_TOKEN="yourtoken"
# For sandbox:
export SF_LOGIN_URL="https://test.salesforce.com"Usage
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["salesforce-marketing-mcp"],
"env": {
"SF_USERNAME": "you@yourcompany.com",
"SF_PASSWORD": "yourpassword",
"SF_SECURITY_TOKEN": "yourtoken",
"SF_LOGIN_URL": "https://login.salesforce.com"
}
}
}
}Claude Code
claude mcp add salesforce-marketing-mcp \
-e SF_USERNAME=you@yourcompany.com \
-e SF_PASSWORD=yourpassword \
-e SF_SECURITY_TOKEN=yourtoken \
-- npx salesforce-marketing-mcpCursor
In .cursor/mcp.json:
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["salesforce-marketing-mcp"],
"env": {
"SF_USERNAME": "you@yourcompany.com",
"SF_PASSWORD": "yourpassword",
"SF_SECURITY_TOKEN": "yourtoken"
}
}
}
}Tools reference
Tool | Description |
| SOSL search across lead name, email, and company |
| Full lead record by ID |
| Create a new lead |
| Update any lead fields |
| Convert lead to Account / Contact / Opportunity |
| SOSL search across contact name and email |
| Full contact record with Account name |
| Create a new contact |
| Update any contact fields |
| Find contacts by email address (up to 10 matches) |
| SOSL search on account name |
| Account record with open opp count and lead count |
| Contacts associated with an account |
| List campaigns with optional status/type/active filters |
| Full campaign record with all performance metrics |
| Create a new campaign |
| Update any campaign fields |
| List campaign members with lead/contact details |
| Add a single lead or contact to a campaign |
| Add up to 200 leads/contacts in one call |
| Update member status and HasResponded flag |
| Create a task linked to a lead, contact, or campaign |
| Tasks associated with a lead |
| Tasks associated with a contact |
| Tasks associated with a campaign |
| List available Salesforce Analytics reports |
| Execute a report and return structured rows |
| Column definitions and groupings for a report |
| ROI, CPL, CPO, and response rate per campaign |
| Member status counts for a campaign |
| Rank campaigns by responses, opps, or won revenue |
| Member additions over time (week/month) |
| Lead volume, conversions, and revenue by lead source |
| Open pipeline grouped by campaign and stage |
| CampaignInfluence records linking campaigns to opps |
| Closed-won revenue grouped by primary campaign |
| Conversion rates by lead source or campaign |
| Pipeline by stage: count, amount, probability, weighted |
| Pipeline grouped by lead source |
| MQL (or any status) volume over time |
| Expected revenue for opps closing in a date range |
| Task/event counts by lead source, campaign, or owner |
| Tasks and events for a specific lead |
| Tasks and events for a specific contact |
| Execute raw SOQL (escape hatch for custom queries) |
| Full field metadata for any SObject |
| List all queryable SObjects with optional filter |
Example prompts
Once connected, ask Claude questions like:
"What are my top 5 campaigns by won revenue this quarter?"
"Show me the lead source breakdown for the last 90 days — include conversion rates."
"Create a follow-up task for lead 00Q... due next Friday."
"Which campaigns have the highest ROI? Include cost per lead."
"Show me the MQL trend by month for this year."
"Add all leads from this list to the Q2 Webinar campaign with status 'Invited'."
"What's our current pipeline summary by stage with weighted values?"
How it works
Auth: Connects via Salesforce username + password + security token using jsforce. The connection is cached for 25 minutes and automatically refreshed on
INVALID_SESSION_IDerrors.Production and sandbox: Set
SF_LOGIN_URL=https://test.salesforce.comto target a sandbox.Rate limits: All queries respect Salesforce API limits. Use
limitparameters to control result sizes.
License
MIT
Available Tools
47 toolssf_activity_summaryB
Summarize task and event activity counts grouped by lead source, campaign, or owner
Inputs: groupBy (required), dateFrom, dateTo.
sf_add_campaign_memberC
Add a single lead or contact to a Salesforce campaign
Inputs: campaignId (required), leadId, contactId, status.
sf_bulk_add_campaign_membersC
Add up to 200 leads and/or contacts to a Salesforce campaign in one call
Inputs: campaignId (required), leadIds, contactIds, status.
sf_campaign_influenceC
Query the CampaignInfluence object to see which campaigns influenced opportunities
Inputs: campaignId, dateFrom, dateTo, limit.
sf_campaign_member_status_breakdownB
Show a count breakdown of campaign member statuses for a specific campaign
Inputs: campaignId (required).
sf_campaign_performance_trendB
Show campaign member additions over time grouped by week or month
Inputs: campaignId (required), groupBy (required).
sf_campaign_roiC
Calculate ROI, cost-per-lead, cost-per-opportunity, and response rate for campaigns
Inputs: campaignId, dateFrom, dateTo, limit.
sf_contact_by_emailA
Find Salesforce contacts by email address (up to 10 matches)
Inputs: email (required).
sf_convert_leadC
Convert a Salesforce lead to Account, Contact, and optionally Opportunity
Inputs: id (required), accountId, contactId, opportunityName, +1 more.
sf_create_campaignC
Create a new Salesforce campaign
Inputs: name (required), type, status, startDate, +4 more.
sf_create_contactC
Create a new Salesforce contact
Inputs: lastName (required), email (required), firstName, accountId, +3 more.
sf_create_leadC
Create a new Salesforce lead
Inputs: lastName (required), email (required), company (required), firstName, +4 more.
sf_create_taskB
Create a new Salesforce task linked to a lead, contact, campaign, or opportunity
Inputs: subject (required), whoId, whatId, status, +3 more.
sf_describe_objectA
Describe a Salesforce SObject — returns all fields, types, and metadata
Inputs: object (required), fieldsOnly.
sf_forecast_summaryB
Show forecasted pipeline for open opportunities closing within a date range
Inputs: closeByDateFrom, closeByDateTo.
sf_get_accountA
Retrieve a Salesforce account with open opportunity count and lead count
Inputs: id (required).
sf_get_campaignB
Retrieve a full Salesforce campaign record with all performance metrics
Inputs: id (required).
sf_get_campaign_membersB
List members of a Salesforce campaign with lead/contact details
Inputs: campaignId (required), limit, status.
sf_get_contactB
Retrieve a full Salesforce contact record including Account name
Inputs: id (required).
sf_get_leadB
Retrieve a full Salesforce lead record by ID
Inputs: id (required).
sf_get_report_metadataA
Retrieve column definitions and groupings for a Salesforce Analytics report
Inputs: reportId (required).
sf_lead_conversion_metricsA
Show lead conversion rates grouped by lead source or campaign
Inputs: groupBy (required), dateFrom, dateTo.
sf_lead_source_breakdownB
Aggregate lead volume, conversion rate, and opportunity revenue by lead source
Inputs: dateFrom, dateTo.
sf_list_account_contactsC
List contacts associated with a Salesforce account
Inputs: accountId (required), limit.
sf_list_campaignsB
List Salesforce campaigns with optional filters for status, type, and active-only
Inputs: limit, activeOnly, type, status.
sf_list_objectsA
List all queryable Salesforce SObjects with optional name filter
Inputs: filter, customOnly.
sf_list_reportsC
List available Salesforce Analytics reports
Inputs: folder, limit.
sf_list_tasks_by_campaignC
List Salesforce tasks associated with a specific campaign
Inputs: campaignId (required), limit.
sf_list_tasks_by_contactC
List Salesforce tasks associated with a specific contact
Inputs: contactId (required), limit.
sf_list_tasks_by_leadC
List Salesforce tasks associated with a specific lead
Inputs: leadId (required), limit.
sf_mql_trendB
Show MQL (or any lead status) volume trend over time grouped by week or month
Inputs: groupBy (required), statusValue, dateFrom, dateTo.
sf_pipeline_by_campaignC
Show open pipeline grouped by campaign and stage
Inputs: dateFrom, dateTo, openOnly.
sf_pipeline_by_lead_sourceC
Summarize pipeline grouped by lead source with weighted values
Inputs: openOnly, dateFrom, dateTo.
sf_pipeline_summaryC
Summarize open pipeline by stage with count, total amount, average probability, and weighted pipeline
Inputs: openOnly.
sf_recent_activities_by_contactC
Retrieve recent tasks and events associated with a specific contact
Inputs: contactId (required), limit.
sf_recent_activities_by_leadB
Retrieve recent tasks and events associated with a specific lead
Inputs: leadId (required), limit.
sf_run_reportB
Execute a Salesforce Analytics report and return results as structured rows
Inputs: reportId (required), filters.
sf_run_soqlA
Execute a raw SOQL query against Salesforce (escape hatch for advanced queries)
Inputs: soql (required), limit.
sf_search_accountsA
Search Salesforce accounts by name using SOSL
Inputs: q (required), limit.
sf_search_contactsB
Search Salesforce contacts by name or email using SOSL
Inputs: q (required), limit.
sf_search_leadsB
Search Salesforce leads by name, email, or company using SOSL
Inputs: q (required), limit.
sf_top_campaignsC
Rank campaigns by responses, opportunities created, or won revenue
Inputs: metric (required), limit, dateFrom, dateTo.
sf_update_campaignB
Update any fields on an existing Salesforce campaign
Inputs: id (required), fields (required).
sf_update_campaign_member_statusB
Update the status and/or HasResponded flag of a campaign member
Inputs: campaignMemberId (required), status (required), hasResponded.
sf_update_contactB
Update any fields on an existing Salesforce contact
Inputs: id (required), fields (required).
sf_update_leadB
Update any fields on an existing Salesforce lead
Inputs: id (required), fields (required).
sf_won_revenue_by_campaignC
Show closed-won revenue grouped by primary campaign
Inputs: dateFrom, dateTo, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 47 tools
Core CRUD tools for leads, contacts, accounts, and campaigns are mostly distinct, but the large analytics cluster contains overlapping aggregate tools (pipeline summaries, campaign ROI/trend/top campaigns, lead source metrics) that an agent could easily confuse. Descriptions help differentiate them, but the sheer number of similar reporting tools leaves room for misselection.
All tool names consistently use the sf_ prefix and snake_case, and many follow a verb_noun pattern like create_lead, get_contact, update_campaign. However, several tools use noun-first or domain-specific names without clear verbs, such as sf_campaign_roi, sf_pipeline_summary, sf_lead_source_breakdown, and sf_mql_trend, creating a mixed convention.
47 tools is well beyond the usual well-scoped range, even for a broad Salesforce marketing server. Many reporting and campaign metrics tools could be consolidated or parameterized, making the tool selection surface unnecessarily heavy.
The server covers core lead, contact, account, campaign, task, pipeline, and report workflows, but there are notable gaps such as no delete/remove tools (e.g., delete lead, delete contact, remove campaign member) and no direct opportunity CRUD despite opportunity-focused aggregate tools. The SOQL escape hatch is query-only, so some lifecycle workflows will dead-end.
Related MCP Connectors
Marketo MCP server for AI. 130 tools to operate Marketo from Claude, Cursor, or ChatGPT.
335 MCP tools, 75 playbooks. AI-native CRM, email/SMS, events, OAuth.
Hosted MCP server for marketing agencies: connect Google Ads, GA4, Search Console, Meta, LinkedIn and more to Claude or ChatGPT. Pull reports and make changes via OAuth login, no setup.
Connects Amazon Seller Central and Amazon Advertising to any MCP client. Settlement-accurate P&L - every fee, refund and reimbursement as Amazon posted it - plus contribution margin and breakeven per product, per marketplace, per day. Full Sponsored Products, Brands and Display management: search terms, placements, keyword and competitor research, dayparting, automation rules. 110 tools: 78 read-only (P&L, PPC at every grain, SQP/Brand Analytics, inventory, forecasting), 28 staged writes (every change is a proposal you review and confirm before it reaches Amazon - there is no autonomous-write mode), and 4 confirmation & support tools. 4 additional AI Workforce tools appear once a client is connected.