salesforce-marketing-mcp
MCP server for Salesforce marketing and revenue ops teams. 47 tools covering leads, contacts, accounts, campaigns, campaign members, tasks, and 17 reporting tools including campaign ROI, lead-source attribution, pipeline-by-campaign, multi-touch campaign influence, MQL trend, forecast summary, and the native SFDC Reports API.
README
salesforce-marketing-mcp
MCP server for Salesforce — query leads, campaigns, pipeline, and attribution from Claude without writing a line of SOQL.
47 tools spanning Leads, Contacts, Accounts, Campaigns, Campaign Members, Tasks, and Analytics Reports — plus 14 marketing reporting tools (campaign ROI, lead source attribution, pipeline by campaign, MQL trend, CampaignInfluence). Built for marketing ops, revenue ops, and B2B teams who want AI-assisted answers without pestering RevOps for another report.
Why this exists
Marketing ops teams need answers like "which campaigns drove the most pipeline last quarter" or "what's our MQL trend by month" and usually end up pestering RevOps or copy-pasting Lightning report URLs. This server ships those queries as first-class tools — campaign ROI, CampaignInfluence rollups, lead source breakdowns, MQL trends — so anyone with API access can ask in plain English and get a structured answer.
Most Salesforce MCP servers stop at CRUD on standard objects. The 14 marketing reporting tools are the differentiator — they run the queries marketing ops actually needs.
Example prompts
Once installed, ask Claude things like:
- "What are my top 5 campaigns by won revenue this quarter?"
- "Show the lead source breakdown for the last 90 days, with conversion rates."
- "Which campaigns have the highest ROI? Include cost per lead."
- "Show 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?"
- "Pull CampaignInfluence for our Q1 ABM program and rank by sourced revenue."
Demo
🎥 Walkthrough video coming soon — pulling pipeline by campaign from Claude in under 60 seconds.
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-mcp
2. Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
SF_USERNAME |
Yes | — | Salesforce login email |
SF_PASSWORD |
Yes | — | Salesforce password |
SF_SECURITY_TOKEN |
Yes | — | Security token (appended to password on login) |
SF_LOGIN_URL |
No | https://login.salesforce.com |
Use https://test.salesforce.com for sandboxes |
SF_API_VERSION |
No | 60.0 |
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-mcp
Cursor
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 |
|---|---|
sf_search_leads |
SOSL search across lead name, email, and company |
sf_get_lead |
Full lead record by ID |
sf_create_lead |
Create a new lead |
sf_update_lead |
Update any lead fields |
sf_convert_lead |
Convert lead to Account / Contact / Opportunity |
sf_search_contacts |
SOSL search across contact name and email |
sf_get_contact |
Full contact record with Account name |
sf_create_contact |
Create a new contact |
sf_update_contact |
Update any contact fields |
sf_contact_by_email |
Find contacts by email address (up to 10 matches) |
sf_search_accounts |
SOSL search on account name |
sf_get_account |
Account record with open opp count and lead count |
sf_list_account_contacts |
Contacts associated with an account |
sf_list_campaigns |
List campaigns with optional status/type/active filters |
sf_get_campaign |
Full campaign record with all performance metrics |
sf_create_campaign |
Create a new campaign |
sf_update_campaign |
Update any campaign fields |
sf_get_campaign_members |
List campaign members with lead/contact details |
sf_add_campaign_member |
Add a single lead or contact to a campaign |
sf_bulk_add_campaign_members |
Add up to 200 leads/contacts in one call |
sf_update_campaign_member_status |
Update member status and HasResponded flag |
sf_create_task |
Create a task linked to a lead, contact, or campaign |
sf_list_tasks_by_lead |
Tasks associated with a lead |
sf_list_tasks_by_contact |
Tasks associated with a contact |
sf_list_tasks_by_campaign |
Tasks associated with a campaign |
sf_list_reports |
List available Salesforce Analytics reports |
sf_run_report |
Execute a report and return structured rows |
sf_get_report_metadata |
Column definitions and groupings for a report |
sf_campaign_roi |
ROI, CPL, CPO, and response rate per campaign |
sf_campaign_member_status_breakdown |
Member status counts for a campaign |
sf_top_campaigns |
Rank campaigns by responses, opps, or won revenue |
sf_campaign_performance_trend |
Member additions over time (week/month) |
sf_lead_source_breakdown |
Lead volume, conversions, and revenue by lead source |
sf_pipeline_by_campaign |
Open pipeline grouped by campaign and stage |
sf_campaign_influence |
CampaignInfluence records linking campaigns to opps |
sf_won_revenue_by_campaign |
Closed-won revenue grouped by primary campaign |
sf_lead_conversion_metrics |
Conversion rates by lead source or campaign |
sf_pipeline_summary |
Pipeline by stage: count, amount, probability, weighted |
sf_pipeline_by_lead_source |
Pipeline grouped by lead source |
sf_mql_trend |
MQL (or any status) volume over time |
sf_forecast_summary |
Expected revenue for opps closing in a date range |
sf_activity_summary |
Task/event counts by lead source, campaign, or owner |
sf_recent_activities_by_lead |
Tasks and events for a specific lead |
sf_recent_activities_by_contact |
Tasks and events for a specific contact |
sf_run_soql |
Execute raw SOQL (escape hatch for custom queries) |
sf_describe_object |
Full field metadata for any SObject |
sf_list_objects |
List all queryable SObjects with optional filter |
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。