Table of contents

Add secure integrations to your products and AI agents with ease via Merge.
Get a demo
Just for you
No items found.

How to connect a Salesforce MCP to Cursor (4 steps)

Jon Gitlin
Senior Content Marketing Manager
at Merge

Developers building against Salesforce need to know the API names of fields, understand how relationships between objects work, and validate their SOQL queries against real data.

All of that lookup work currently means switching to Salesforce's Setup UI, the object manager, or their API reference, none of which are in the editor.

To help your developers query Salesforce data without leaving Cursor, we'll show you how to connect Salesforce with Merge Agent Handler's Salesforce MCP server.

How it works

Merge Agent Handler connects Cursor to Salesforce's API through the Merge CLI.

You install the CLI, authenticate once, and run a single setup command from your project root.

That command writes a ## Merge CLI section to your project's .cursorrules file, which tells Cursor's agent when to call merge search-tools and merge execute-tool to reach Salesforce.

Once connected, Merge handles your Salesforce OAuth credentials and session management so you don't store token state in your local environment.

Here's the command that registers the connection:

merge setup cursor

Prerequisites

Before getting started, you'll need the following:

  • A Merge Agent Handler account
  • Cursor installed
  • pipx installed (run pipx --version to confirm, or install via pip install pipx)
  • A Salesforce account with API access enabled

If you want to connect Merge Agent Handler's Salesforce MCP with internal or customer-facing agentic products, you can follow the steps in our docs.

1. Install the Merge CLI

Install with pipx: pipx install merge-api

Then confirm the installation: merge --version

Related: How to use a Salesforce MCP in Claude Code

2. Log in to Merge

Authenticate the CLI with your Merge Agent Handler account: merge login

This links your session to Merge so the CLI can make authorized requests against Salesforce on your behalf.

3. Connect the CLI to Cursor

Run the following from the root of the project where you want to use Merge tools:

merge setup cursor

This writes a ## Merge CLI section to .cursorrules so Cursor knows to use the CLI for third-party services. The command is idempotent and safe to re-run if you need to reset.

4. Authenticate Salesforce

Open a Cursor chat in your project and try: "List all fields on the Opportunity object in Salesforce, including their API names and field types, so I can map them to our internal data model."

The first time you invoke a Salesforce tool, a Magic Link will appear to complete connector authentication.

UI for authenticating Salesforce

{{this-blog-only-cta}}

Salesforce MCP FAQ

In case you have more questions on setting up and using the Salesforce MCP in Cursor, we've addressed several more commonly-asked questions below.

What can you do once the Salesforce MCP is connected to Cursor?

With Salesforce connected, Cursor can:

  • Look up object schemas while coding: retrieve the full field list and API names for any standard or custom Salesforce object so your SOQL queries and data mappings reference the right fields from the start
  • Fetch a real record to validate parsing: pull an actual Opportunity, Account, or Contact to see what field values look like in a live API response before writing deserialization or transformation logic
  • Find custom object and field API names: query your org's custom object definitions to get the exact API names your integration needs, without navigating Salesforce's object manager manually
  • Retrieve picklist values for type safety: get the valid options for Stage, Status, LeadSource, and other enumerated fields so you can write accurate validation logic and populate type definitions correctly
  • Inspect relationship field structures: understand how Accounts relate to Contacts, or how Opportunities link to their Tasks and Activities, so you can write correct relationship queries and avoid unintentional N+1 patterns

Why use Merge Agent Handler vs. building directly on Salesforce's API?

You can build against Salesforce's REST API directly. Salesforce's documentation is thorough, and for a developer working against a single org the initial setup is manageable: create a Connected App, obtain OAuth credentials, and start making requests.

The friction compounds at the team level.

Setting up a Connected App requires Salesforce administrator access, and each developer who needs agent access through Cursor ends up either managing their own credentials or sharing tokens in ways that are difficult to audit.

Salesforce's API surface is also broad. Covering Opportunities, Accounts, Contacts, Leads, Cases, and custom objects with correct field mappings, relationship traversal, and pagination is non-trivial to maintain as Salesforce releases API updates.

Merge Agent Handler handles that maintenance. It centralizes authentication and scopes access so each agent only touches what you explicitly allow, and logs every tool call with a full audit trail.

Why connect Salesforce to Cursor?

Developers writing Salesforce integrations have to understand the object model before they can write correct code against it.

What's the API name for the Opportunity owner field? What does a real Account response look like, including relationship fields? Which Stage values are valid in this org?

Those questions have specific answers that live in Salesforce, and getting them currently requires leaving the editor to check the Setup UI or API docs.

With the Salesforce MCP connected, Cursor can answer those questions inline.

You can pull a real Opportunity record to see the exact shape your parsing code will receive, look up a custom field's API name before referencing it in a SOQL query, or retrieve picklist values before writing validation logic.

The Salesforce data and the code that depends on it are in the same session, which removes the back-and-forth between the editor and Salesforce's admin tools.

Jon Gitlin
Senior Content Marketing Manager
@Merge

Jon Gitlin is the Managing Editor of Merge's blog. He has several years of experience in the integration and automation space; before Merge, he worked at Workato, an integration platform as a service (iPaaS) solution, where he also managed the company's blog. In his free time he loves to watch soccer matches, go on long runs in parks, and explore local restaurants.

Read more

How to connect a Google Drive MCP to Cursor (4 steps)

AI

MCP gateway: how it works, benefits, and solutions

AI

How to connect a BambooHR MCP with Claude Code (4 steps)

Subscribe to the Merge Blog

Get stories from Merge straight to your inbox

Subscribe

Connect Cursor to thousands of tools with Merge Agent Handler

Use Merge Agent Handler’s 150+ connectors (including Salesforce) to power reliable, secure, and powerful agents.

Get started for free
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text