MCP Hub
Back to servers

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.

glama
Stars
1
Updated
Apr 26, 2026
Validated
Apr 27, 2026

salesforce-marketing-mcp

MIT License Node.js 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-mcp

2. Environment variables

VariableRequiredDefaultDescription
SF_USERNAMEYesSalesforce login email
SF_PASSWORDYesSalesforce password
SF_SECURITY_TOKENYesSecurity token (appended to password on login)
SF_LOGIN_URLNohttps://login.salesforce.comUse https://test.salesforce.com for sandboxes
SF_API_VERSIONNo60.0Salesforce 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

ToolDescription
sf_search_leadsSOSL search across lead name, email, and company
sf_get_leadFull lead record by ID
sf_create_leadCreate a new lead
sf_update_leadUpdate any lead fields
sf_convert_leadConvert lead to Account / Contact / Opportunity
sf_search_contactsSOSL search across contact name and email
sf_get_contactFull contact record with Account name
sf_create_contactCreate a new contact
sf_update_contactUpdate any contact fields
sf_contact_by_emailFind contacts by email address (up to 10 matches)
sf_search_accountsSOSL search on account name
sf_get_accountAccount record with open opp count and lead count
sf_list_account_contactsContacts associated with an account
sf_list_campaignsList campaigns with optional status/type/active filters
sf_get_campaignFull campaign record with all performance metrics
sf_create_campaignCreate a new campaign
sf_update_campaignUpdate any campaign fields
sf_get_campaign_membersList campaign members with lead/contact details
sf_add_campaign_memberAdd a single lead or contact to a campaign
sf_bulk_add_campaign_membersAdd up to 200 leads/contacts in one call
sf_update_campaign_member_statusUpdate member status and HasResponded flag
sf_create_taskCreate a task linked to a lead, contact, or campaign
sf_list_tasks_by_leadTasks associated with a lead
sf_list_tasks_by_contactTasks associated with a contact
sf_list_tasks_by_campaignTasks associated with a campaign
sf_list_reportsList available Salesforce Analytics reports
sf_run_reportExecute a report and return structured rows
sf_get_report_metadataColumn definitions and groupings for a report
sf_campaign_roiROI, CPL, CPO, and response rate per campaign
sf_campaign_member_status_breakdownMember status counts for a campaign
sf_top_campaignsRank campaigns by responses, opps, or won revenue
sf_campaign_performance_trendMember additions over time (week/month)
sf_lead_source_breakdownLead volume, conversions, and revenue by lead source
sf_pipeline_by_campaignOpen pipeline grouped by campaign and stage
sf_campaign_influenceCampaignInfluence records linking campaigns to opps
sf_won_revenue_by_campaignClosed-won revenue grouped by primary campaign
sf_lead_conversion_metricsConversion rates by lead source or campaign
sf_pipeline_summaryPipeline by stage: count, amount, probability, weighted
sf_pipeline_by_lead_sourcePipeline grouped by lead source
sf_mql_trendMQL (or any status) volume over time
sf_forecast_summaryExpected revenue for opps closing in a date range
sf_activity_summaryTask/event counts by lead source, campaign, or owner
sf_recent_activities_by_leadTasks and events for a specific lead
sf_recent_activities_by_contactTasks and events for a specific contact
sf_run_soqlExecute raw SOQL (escape hatch for custom queries)
sf_describe_objectFull field metadata for any SObject
sf_list_objectsList 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_ID errors.
  • Production and sandbox: Set SF_LOGIN_URL=https://test.salesforce.com to target a sandbox.
  • Rate limits: All queries respect Salesforce API limits. Use limit parameters to control result sizes.

License

MIT

Reviews

No reviews yet

Sign in to write a review