# Salesforce MCP

> Salesforce MCP Server lets your AI agent manage everything in Salesforce. Run complex SOQL queries, list accounts and contacts, or create new records instantly. You can perform full CRUD operations on Accounts, Opportunities, Leads, and more by just talking to it. It connects your entire sales pipeline directly to your AI client.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** soql-queries, account-management, lead-management, opportunity-tracking, crud-operations, crm-data

## Description

Look, you've got a CRM full of data—accounts, leads, opportunities—and talking to it is usually a headache. This MCP Server changes that. It lets your AI client talk directly to Salesforce, giving it the ability to manage everything in your sales pipeline using plain conversation. You get full control over reading and writing every single piece of data.

When you need to know what's going on across the board, you don't want to run ten different reports. That's why we got **`global_search`**; it hits Accounts, Contacts, Leads, and all those other major objects at once, pulling back matches from every place simultaneously. If that ain't enough searching power, you can use **`soql_query`**. This tool lets you write any custom SOQL query you want, giving you surgical precision over which fields and exactly which records come back. You dictate the filter, period.

Need to build out a new client record from scratch? You gotta use **`create_record`**. Just feed it the JSON structure for what you need—say, an Account or a Contact—and your agent builds that brand-new Salesforce entry instantly. But if you just got bad data and realize you don't need it anymore, **`delete_record`** handles the cleanup. Be careful with this one; it permanently deletes stuff, so make sure what you tell it to delete is actually garbage.

When you only care about one specific record—like that big opportunity for Acme Corp—you use **`get_record`**. You know the SObject type and you have the unique ID? This tool pulls *all* the data associated with that single record. Wanna see what kinds of records exist in your environment? Run **`describe_object`**; it spits out the metadata, showing you all the available fields and the object's structure so you know exactly what to expect.

If you just want a quick overview instead of digging into IDs, there are list tools. You can use **`list_accounts`** to pull a complete roster of every account in your system, or run **`list_contacts`** to grab all the contacts from that dataset. For sales tracking, **`list_opportunities`** shows you a rundown of all active opportunities, letting you see their current stage and dollar value right off the bat. And if you wanna know what kind of reports are even possible in your system, run **`list_reports`** to get that master list of available report types.

Now for modifying data—this is where it gets powerful. If a record exists but some fields are wrong or outdated, don't sweat it. You use **`update_record`**. You specify the object type, give it the ID, and then you feed in the new JSON values you want to stick. It modifies that existing data point for you. For deep dives, if a specific report is needed, running **`run_report`** executes that named report, and your agent gets those results right back. Remember, when all this feels too complex for direct queries, you always have the **`soql_query`** fallback to keep things granular.

You've got everything: from getting a list of available reports with **`list_reports`**, to executing that report data using **`run_report`**. You can manage full CRUD operations—Create, Read, Update, Delete—on every SObject type. Whether you need to check the structure first with **`describe_object`** or pull specific details via **`get_record`**, your AI client handles it all natively within the Salesforce environment.

## Tools

### create_record
Creates a brand new Salesforce record when you provide JSON fields as a string.

### delete_record
Permanently deletes a specified Salesforce record; this action cannot be undone.

### describe_object
Retrieves metadata about a Salesforce object so you can understand its available fields and structure.

### get_record
Pulls all data for one specific record by knowing its SObject type (e.g., Account) and its unique ID.

### global_search
Searches across every major Salesforce object—Accounts, Contacts, Leads, etc.—to find matches simultaneously.

### list_accounts
Retrieves a list of all existing accounts within your connected Salesforce instance.

### list_contacts
Fetches a list of contacts from the specified Salesforce dataset.

### list_opportunities
Lists all active sales opportunities, showing their current stage and value.

### list_reports
Gets a list of report types available in your Salesforce environment so you know what reports exist.

### run_report
Executes a specific, named Salesforce report and returns the data results directly.

### soql_query
Allows you to execute any custom SOQL query, giving you precise control over which fields and records are returned.

### update_record
Modifies an existing Salesforce record by providing the object type, ID, and a set of new JSON field values.

## Prompt Examples

**Prompt:** 
```
Show me all open opportunities worth over $50,000.
```

**Response:** 
```
Found 7 open opportunities over $50,000:

1. **Acme Corp - Enterprise License** — $120,000 (Stage: Negotiation)
2. **TechStart - Platform Migration** — $85,000 (Stage: Proposal)
3. **GlobalRetail - API Integration** — $67,500 (Stage: Discovery)
...

Total pipeline value: $487,500
```

**Prompt:** 
```
Create a new lead for John Smith from TechCo, email john@techco.com.
```

**Response:** 
```
✅ Lead created successfully!

- **Name**: John Smith
- **Company**: TechCo
- **Email**: john@techco.com
- **ID**: 00Q8Z00001kL2mN
- **Status**: Open - Not Contacted
```

**Prompt:** 
```
Run the Monthly Sales Report.
```

**Response:** 
```
📊 Monthly Sales Report (March 2026):

| Metric | Value |
|--------|-------|
| Total Revenue | $2.4M |
| Deals Closed | 34 |
| Avg Deal Size | $70,588 |
| Win Rate | 28% |
| Pipeline Growth | +15% |

Top performer: Sarah Chen ($485K closed)
```

## Capabilities

### Search all records across objects
The `global_search` tool runs a search that pulls matches from Accounts, Contacts, Leads, and other relevant objects simultaneously.

### Query data using SOQL syntax
Use the `soql_query` tool to execute any custom query against Salesforce records for granular filtering.

### Create new sales pipeline entries
The `create_record` tool lets your agent build a brand-new record (like an Account or Contact) using specified JSON data.

### Update existing records in bulk
You can modify any existing Salesforce record by calling `update_record`, specifying the object, ID, and new field values.

### Retrieve specific account details
The `get_record` tool pulls all data for a single, known Salesforce record type (like an Account or Opportunity) by its unique ID.

## Use Cases

### Quickly auditing a target account's history
A manager needs to know everything about Acme Corp. Instead of clicking into the Account record, they ask their agent. The agent runs `get_record` on the Account ID and then uses `soql_query` to pull all related Contacts and Opportunities simultaneously, giving a complete snapshot.

### Batch updating deal stages after a meeting
The sales team just finished 10 meetings. They tell their agent: 'Update these ten opportunity IDs.' The agent runs `update_record` for each ID, changing the stage and adding notes in one go, saving hours of manual CRM entry.

### Identifying missing leads from a campaign
The marketing team ran a campaign and needs to find all new contacts that haven't been assigned an account. They ask the agent to run `list_contacts` and filter for unassigned records, which immediately surfaces the list for follow-up.

### Generating a full report on Q3 performance
Instead of navigating the Reports tab, a user asks their agent: 'Run the Quarterly Performance Report.' The agent selects and executes `run_report` using the correct ID found via `list_reports`, delivering the data table immediately.

## Benefits

- Stop manually checking dashboards. Use `list_accounts` or `list_opportunities` to pull lists of records instantly, allowing your agent to process hundreds of records in seconds.
- No more guesswork on fields. Running `describe_object` first lets you confirm the exact data structure before attempting any write operation with `create_record` or `update_record`.
- Need a specific cross-section? Instead of building complex report filters, just use `soql_query`. This tool gives you direct SQL control over your Salesforce data.
- It handles all the tedious linking. The `global_search` tool doesn't force you to pick one object; it searches Accounts, Contacts, and Leads simultaneously for a single search term.
- Data integrity is key. Use dedicated listing tools (`list_contacts`, `list_accounts`) first, then use `get_record` for specific deep dives on crucial records.

## How It Works

The bottom line is that your agent handles the API calls, so you just ask it what data you need in plain English.

1. You tell your AI agent what you need—for example, 'Show me high-value opportunities in the Technology sector.'
2. The agent recognizes this as a data request and selects the appropriate tool, like `soql_query`, passing it the required parameters.
3. The MCP Server executes the query against Salesforce and sends the structured result (e.g., a list of records) back to your AI client for you to review.

## Frequently Asked Questions

**How do I query custom fields using the soql_query tool?**
You include the field API name in your SELECT statement, just like any other field. For instance: `SELECT Id, Name, Custom_Field__c FROM Account WHERE...`. Always check object metadata first using `describe_object`.

**Can I list all accounts and then update them with one command?**
Not in a single call. You must use `list_accounts` to get the IDs, and then pass those IDs individually or in batches to the `update_record` tool for modification.

**What is the difference between global_search and soql_query?**
`global_search` finds a match across many different objects (Accounts, Contacts, Leads). `soql_query` lets you target specific object types and build complex filters using SOQL syntax.

**Do I need to know the exact ID to use get_record?**
Yes. The `get_record` tool requires two pieces of information: the SObject Type (e.g., 'Account') and the unique record ID, which you must supply.

**How do I use the `describe_object` tool to figure out available fields?**
It gives you the full metadata schema for an object. This is useful when you need to know what fields and data types exist on a Salesforce object before running queries or updates.

**What format do I need to use when calling the `create_record` tool?**
You must provide JSON fields as a string. The payload needs to match the object's expected data types and include any mandatory fields required for the record to save.

**Does the `delete_record` tool offer any confirmation steps?**
No, this action is irreversible. You must be certain of the exact SObject type and record ID before executing this tool, as Salesforce deletions are final.

**Do I have to use `list_reports` before running a report with `run_report`?**
Yes, you do. You first run `list_reports` to get the specific Report ID required by the `run_report` function. This ensures you are pulling data from the correct source.

**Can I run custom SOQL queries?**
Yes! The `soql_query` tool accepts any valid SOQL string. Example: SELECT Id, Name, Amount FROM Opportunity WHERE StageName = 'Closed Won' LIMIT 20.

**Can I create records in any object?**
Yes! Use `create_record` with the SObject type (Account, Contact, Lead, etc.) and a JSON string of fields.

**How do I search across all Salesforce data?**
Use `global_search` with your search text. It uses SOSL to find matches across Accounts, Contacts, Leads, and all other objects simultaneously.