# Salesforce CLI for AI Agents

```json
{
  "title": "Salesforce CLI for AI Agents",
  "toolkit": "Salesforce",
  "toolkit_slug": "salesforce",
  "framework": "CLI",
  "framework_slug": "cli",
  "url": "https://composio.dev/toolkits/salesforce/framework/cli",
  "markdown_url": "https://composio.dev/toolkits/salesforce/framework/cli.md",
  "updated_at": "2026-05-06T08:26:36.357Z"
}
```

## Introduction

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP.
With Composio's Universal CLI, your coding agents can talk to over 1000+ SaaS applications. With Salesforce, agents can add new contact to spring campaign, clone opportunity with all associated products, complete follow-up task for lead smith, and more — all without worrying about authentication.
This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Salesforce automation.

## Also integrate Salesforce with

- [ChatGPT](https://composio.dev/toolkits/salesforce/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/salesforce/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/salesforce/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/salesforce/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/salesforce/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/salesforce/framework/codex)
- [Cursor](https://composio.dev/toolkits/salesforce/framework/cursor)
- [VS Code](https://composio.dev/toolkits/salesforce/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/salesforce/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/salesforce/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/salesforce/framework/hermes-agent)
- [Google ADK](https://composio.dev/toolkits/salesforce/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/salesforce/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/salesforce/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/salesforce/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/salesforce/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/salesforce/framework/crew-ai)

## TL;DR

The idea behind building the universal CLI is to give agents a single command interface to interact with all your external applications. Here's what you'll get with it:
- Agent-friendly: Coding agents like Claude Code, Codex, and OpenCode can use CLI tools natively — no MCP setup required.
- Authentication handled: Connect once via OAuth or API Key, and all CLI commands work with your credentials automatically.
- Tool discovery: Search, inspect, and execute 20,000+ tools across 1000+ apps from one interface.
- Trigger support: Use triggers to listen for events across your apps, powered by real-time webhooks or polling under the hood.
- Type generation: Generate typed schemas for autocomplete and type safety in your projects.

## Connect Salesforce to CLI

### Prerequisites
Install the Composio CLI, authenticate, and initialize your project:

```bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login
```

## What is the Salesforce MCP server, and what's possible with it?

The Salesforce MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Salesforce account. It provides structured and secure access to your CRM data, so your agent can perform actions like managing contacts, handling opportunities, automating campaigns, and tracking tasks on your behalf.
- Automated contact and lead management: Effortlessly create new accounts, add contacts or leads to campaigns, and associate contacts with accounts to keep your CRM data up-to-date.
- Streamlined opportunity management: Let your agent clone opportunities, add products to deals, and manage the full sales cycle for your pipeline.
- Intelligent campaign automation: Enable your agent to create campaigns, enroll contacts or leads, and track campaign engagement for more effective marketing.
- Task completion and workflow efficiency: Have your agent mark Salesforce tasks as completed and update records, keeping your team on track without manual intervention.
- Flexible record operations: Allow the agent to clone existing records or apply lead assignment rules, ensuring data consistency and smart routing across your Salesforce environment.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `SALESFORCE_ADD_CONTACT_TO_CAMPAIGN` | Add contact to campaign | Adds a contact to a campaign by creating a campaignmember record, allowing you to track campaign engagement. |
| `SALESFORCE_ADD_LEAD_TO_CAMPAIGN` | Add lead to campaign | Adds a lead to a campaign by creating a campaignmember record, allowing you to track campaign engagement. |
| `SALESFORCE_ADD_OPPORTUNITY_LINE_ITEM` | Add product to opportunity | Adds a product (line item) to an opportunity. the product must exist in a pricebook entry that's associated with the opportunity's pricebook. |
| `SALESFORCE_APPLY_LEAD_ASSIGNMENT_RULES` | Apply lead assignment rules | Applies configured lead assignment rules to a specific lead, automatically routing it to the appropriate owner based on your organization's rules. |
| `SALESFORCE_ASSOCIATE_CONTACT_TO_ACCOUNT` | Associate contact to account | Associates a contact with an account by updating the contact's accountid field. |
| `SALESFORCE_CLONE_OPPORTUNITY_WITH_PRODUCTS` | Clone opportunity with products | Clones an opportunity and optionally its products (line items). creates a new opportunity with the same field values and products as the original. |
| `SALESFORCE_CLONE_RECORD` | Clone record | Creates a copy of an existing salesforce record by reading its data, removing system fields, and creating a new record. optionally apply field updates to the clone. |
| `SALESFORCE_COMPLETE_TASK` | Complete task | Marks a task as completed with optional completion notes. this is a convenience action that updates the task status to 'completed'. |
| `SALESFORCE_CREATE_ACCOUNT` | Create account | Creates a new account in salesforce with the specified information. |
| `SALESFORCE_CREATE_CAMPAIGN` | Create campaign | Creates a new campaign in salesforce with the specified information. |
| `SALESFORCE_CREATE_CONTACT` | Create contact | Creates a new contact in salesforce with the specified information. |
| `SALESFORCE_CREATE_LEAD` | Create lead | Creates a new lead in salesforce with the specified information. |
| `SALESFORCE_CREATE_NOTE` | Create note | Creates a new note attached to a salesforce record with the specified title and content. |
| `SALESFORCE_CREATE_OPPORTUNITY` | Create opportunity | Creates a new opportunity in salesforce with the specified information. |
| `SALESFORCE_CREATE_TASK` | Create task | Creates a new task in salesforce to track activities, to-dos, and follow-ups related to contacts, leads, or other records. |
| `SALESFORCE_DELETE_ACCOUNT` | Delete account | Permanently deletes an account from salesforce. this action cannot be undone. |
| `SALESFORCE_DELETE_CAMPAIGN` | Delete campaign | Permanently deletes a campaign from salesforce. this action cannot be undone. |
| `SALESFORCE_DELETE_CONTACT` | Delete contact | Permanently deletes a contact from salesforce. this action cannot be undone. |
| `SALESFORCE_DELETE_LEAD` | Delete lead | Permanently deletes a lead from salesforce. this action cannot be undone. |
| `SALESFORCE_DELETE_NOTE` | Delete note | Permanently deletes a note from salesforce. this action cannot be undone. |
| `SALESFORCE_DELETE_OPPORTUNITY` | Delete opportunity | Permanently deletes an opportunity from salesforce. this action cannot be undone. |
| `SALESFORCE_GET_ACCOUNT` | Get account | Retrieves a specific account by id from salesforce, returning all available fields. |
| `SALESFORCE_GET_CAMPAIGN` | Get campaign | Retrieves a specific campaign by id from salesforce, returning all available fields. |
| `SALESFORCE_GET_CONTACT` | Get contact | Retrieves a specific contact by id from salesforce, returning all available fields. |
| `SALESFORCE_GET_DASHBOARD` | Get dashboard | Gets detailed metadata for a specific dashboard including its components, layout, and filters. |
| `SALESFORCE_GET_LEAD` | Get lead | Retrieves a specific lead by id from salesforce, returning all available fields. |
| `SALESFORCE_GET_NOTE` | Get note | Retrieves a specific note by id from salesforce, returning all available fields. |
| `SALESFORCE_GET_OPPORTUNITY` | Get opportunity | Retrieves a specific opportunity by id from salesforce, returning all available fields. |
| `SALESFORCE_GET_REPORT` | Get report metadata | Gets detailed metadata for a specific report including its structure, columns, filters, and groupings. |
| `SALESFORCE_GET_REPORT_INSTANCE` | Get report instance results | Gets the results of a report instance created by running a report. check status to see if report has completed. |
| `SALESFORCE_GET_USER_INFO` | Get user info | Retrieves information about the current user or a specific user in salesforce. |
| `SALESFORCE_LIST_ACCOUNTS` | List accounts | Lists accounts from salesforce using soql query, allowing flexible filtering, sorting, and field selection. |
| `SALESFORCE_LIST_CAMPAIGNS` | List campaigns | Lists campaigns from salesforce using soql query, allowing flexible filtering, sorting, and field selection. |
| `SALESFORCE_LIST_CONTACTS` | List contacts | Lists contacts from salesforce using soql query, allowing flexible filtering, sorting, and field selection. |
| `SALESFORCE_LIST_DASHBOARDS` | List dashboards | Lists all dashboards available in salesforce with basic metadata including name, id, and urls. |
| `SALESFORCE_LIST_EMAIL_TEMPLATES` | List email templates | Lists available email templates in salesforce with filtering and search capabilities. |
| `SALESFORCE_LIST_LEADS` | List leads | Lists leads from salesforce using soql query, allowing flexible filtering, sorting, and field selection. |
| `SALESFORCE_LIST_NOTES` | List notes | Lists notes from salesforce using soql query, allowing flexible filtering, sorting, and field selection. |
| `SALESFORCE_LIST_OPPORTUNITIES` | List opportunities | Lists opportunities from salesforce using soql query, allowing flexible filtering, sorting, and field selection. |
| `SALESFORCE_LIST_REPORTS` | List reports | Lists all reports available in salesforce with basic metadata including name, id, and urls. |
| `SALESFORCE_LOG_CALL` | Log call | Logs a completed phone call as a task in salesforce with call-specific details like duration, type, and disposition. |
| `SALESFORCE_LOG_EMAIL_ACTIVITY` | Log email activity | Creates an emailmessage record to log email activity in salesforce, associating it with related records. |
| `SALESFORCE_MASS_TRANSFER_OWNERSHIP` | Mass transfer ownership | Transfers ownership of multiple records to a new owner in a single operation using salesforce's composite api for better performance. |
| `SALESFORCE_REMOVE_FROM_CAMPAIGN` | Remove from campaign | Removes a lead or contact from a campaign by deleting the campaignmember record. provide either the member id (lead/contact id) or the specific campaign member id. |
| `SALESFORCE_RUN_REPORT` | Run report | Runs a report and returns the results. creates a report instance that can be checked for completion. |
| `SALESFORCE_RUN_SOQL_QUERY` | Run SOQL query | Executes a soql query against salesforce data. returns records matching the query with pagination support. |
| `SALESFORCE_SEARCH_ACCOUNTS` | Search accounts | Search for salesforce accounts using multiple criteria like name, industry, type, location, or contact information. |
| `SALESFORCE_SEARCH_CAMPAIGNS` | Search campaigns | Search for salesforce campaigns using multiple criteria like name, type, status, date range, or active status. |
| `SALESFORCE_SEARCH_CONTACTS` | Search contacts | Search for salesforce contacts using multiple criteria like name, email, phone, account, or title. |
| `SALESFORCE_SEARCH_LEADS` | Search leads | Search for salesforce leads using multiple criteria like name, email, phone, company, title, status, or lead source. |
| `SALESFORCE_SEARCH_NOTES` | Search notes | Search for salesforce notes using multiple criteria like title, body content, parent record, owner, or creation date. |
| `SALESFORCE_SEARCH_OPPORTUNITIES` | Search opportunities | Search for salesforce opportunities using multiple criteria like name, account, stage, amount, close date, or status. |
| `SALESFORCE_SEARCH_TASKS` | Search tasks | Search for salesforce tasks using multiple criteria like subject, status, priority, assigned user, related records, or dates. |
| `SALESFORCE_SEND_EMAIL` | Send email | Sends an email through salesforce with options for recipients, attachments, and activity logging. |
| `SALESFORCE_SEND_EMAIL_FROM_TEMPLATE` | Send email from template | Sends an email using a predefined salesforce email template with merge field support. |
| `SALESFORCE_SEND_MASS_EMAIL` | Send mass email | Sends bulk emails to multiple recipients, either using a template or custom content. processes in batches for better performance. |
| `SALESFORCE_UPDATE_ACCOUNT` | Update account | Updates an existing account in salesforce with the specified changes. only provided fields will be updated. |
| `SALESFORCE_UPDATE_CAMPAIGN` | Update campaign | Updates an existing campaign in salesforce with the specified changes. only provided fields will be updated. |
| `SALESFORCE_UPDATE_CONTACT` | Update contact | Updates an existing contact in salesforce with the specified changes. only provided fields will be updated. |
| `SALESFORCE_UPDATE_LEAD` | Update lead | Updates an existing lead in salesforce with the specified changes. only provided fields will be updated. |
| `SALESFORCE_UPDATE_NOTE` | Update note | Updates an existing note in salesforce with the specified changes. only provided fields will be updated. |
| `SALESFORCE_UPDATE_OPPORTUNITY` | Update opportunity | Updates an existing opportunity in salesforce with the specified changes. only provided fields will be updated. |
| `SALESFORCE_UPDATE_TASK` | Update task | Updates an existing task in salesforce with new information. only provided fields will be updated. |

## Supported Triggers

| Trigger slug | Name | Description |
|---|---|---|
| `SALESFORCE_ACCOUNT_CREATED_OR_UPDATED_TRIGGER` | Account Created or Updated | Triggers when an Account is created or updated in Salesforce. Uses LastModifiedDate high-watermark to capture both creations and updates. |
| `SALESFORCE_CONTACT_UPDATED_TRIGGER` | Contact Updated | Triggers when an existing Salesforce Contact record is modified. Emits changed fields alongside relevant timestamps. |
| `SALESFORCE_GENERIC_S_OBJECT_RECORD_UPDATED_TRIGGER` | Record Updated (Generic SObject) | Triggers when monitored fields change on any Salesforce SObject. You specify the SObject type and which field values should be returned in the payload. The trigger uses SystemModstamp to detect changes regardless of which specific field changed. |
| `SALESFORCE_NEW_CONTACT_TRIGGER` | New Contact Trigger | Triggers when a new Contact is Created in Salesforce. |
| `SALESFORCE_NEW_LEAD_TRIGGER` | New Lead Trigger | Triggers when a new Lead is created in Salesforce. |
| `SALESFORCE_NEW_OR_UPDATED_OPPORTUNITY_TRIGGER` | New or Updated Opportunity | Triggers when a Salesforce Opportunity is created or updated. |
| `SALESFORCE_TASK_CREATED_OR_COMPLETED_TRIGGER` | Task Created or Completed | Triggers when a Task is created or when its status changes to Completed in Salesforce. Supports optional filtering by task Status or Subject. |

## Complete Code

None listed.

## Conclusion

- Try asking your coding agent to perform various Salesforce operations
- Explore cross-app workflows by connecting more toolkits
- Set up triggers for real-time automation
- Use composio generate for typed schemas in your projects

## How to build Salesforce MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/salesforce/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/salesforce/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/salesforce/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/salesforce/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/salesforce/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/salesforce/framework/codex)
- [Cursor](https://composio.dev/toolkits/salesforce/framework/cursor)
- [VS Code](https://composio.dev/toolkits/salesforce/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/salesforce/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/salesforce/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/salesforce/framework/hermes-agent)
- [Google ADK](https://composio.dev/toolkits/salesforce/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/salesforce/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/salesforce/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/salesforce/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/salesforce/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/salesforce/framework/crew-ai)

## Related Toolkits

- [Hubspot](https://composio.dev/toolkits/hubspot) - HubSpot is an all-in-one marketing, sales, and customer service platform. It lets teams nurture leads, automate outreach, and track every customer interaction in one place.
- [Pipedrive](https://composio.dev/toolkits/pipedrive) - Pipedrive is a sales management platform offering pipeline visualization, lead tracking, and workflow automation. It helps sales teams keep deals moving forward efficiently and never miss a follow-up.
- [Apollo](https://composio.dev/toolkits/apollo) - Apollo is a CRM and lead generation platform that helps businesses discover contacts and manage sales pipelines. Use it to streamline customer outreach and track your deals from one place.
- [Attio](https://composio.dev/toolkits/attio) - Attio is a customizable CRM and workspace for managing your team's relationships and workflows. It helps teams organize contacts, automate tasks, and collaborate more efficiently.
- [Acculynx](https://composio.dev/toolkits/acculynx) - AccuLynx is a cloud-based roofing business management software for contractors. It streamlines project tracking, lead management, and document sharing.
- [Addressfinder](https://composio.dev/toolkits/addressfinder) - Addressfinder is a data quality platform for verifying addresses, emails, and phone numbers. It helps you ensure accurate customer and contact data every time.
- [Affinity](https://composio.dev/toolkits/affinity) - Affinity is a relationship intelligence CRM that helps private capital investors find, manage, and close more deals. It streamlines deal flow and surfaces key connections to help you win opportunities.
- [Agencyzoom](https://composio.dev/toolkits/agencyzoom) - AgencyZoom is a sales and performance platform built for P&C insurance agencies. It helps agents boost sales, retain clients, and analyze producer results in one place.
- [Bettercontact](https://composio.dev/toolkits/bettercontact) - Bettercontact is a smart contact enrichment tool for finding emails and phone numbers. It helps boost lead generation with automated, waterfall search across multiple sources.
- [Blackbaud](https://composio.dev/toolkits/blackbaud) - Blackbaud provides cloud-based software for nonprofits, schools, and healthcare institutions. It streamlines fundraising, donor management, and mission-driven operations.
- [Brilliant directories](https://composio.dev/toolkits/brilliant_directories) - Brilliant Directories is an all-in-one platform for building and managing online membership communities and business directories. It streamlines listings, member management, and engagement tools into a single, easy interface.
- [Capsule crm](https://composio.dev/toolkits/capsule_crm) - Capsule CRM is a user-friendly CRM platform for managing contacts and sales pipelines. It helps businesses organize relationships and streamline their sales process efficiently.
- [Centralstationcrm](https://composio.dev/toolkits/centralstationcrm) - CentralStationCRM is an easy-to-use CRM software focused on collaboration and long-term customer relationships. It helps teams manage contacts, deals, and communications all in one place.
- [Clientary](https://composio.dev/toolkits/clientary) - Clientary is a platform for managing clients, invoices, projects, proposals, and more. It streamlines client work and saves you serious admin time.
- [Close](https://composio.dev/toolkits/close) - Close is a CRM platform built for sales teams, combining calling, email automation, and predictive dialers. It streamlines sales workflows and boosts productivity with all-in-one communication tools.
- [Dropcontact](https://composio.dev/toolkits/dropcontact) - Dropcontact is a B2B email finder and data enrichment service for professionals. It delivers verified email addresses and enriches contact info with up-to-date data.
- [Dynamics365](https://composio.dev/toolkits/dynamics365) - Dynamics 365 is Microsoft's platform combining CRM, ERP, and productivity apps. It streamlines sales, marketing, service, and operations in one place.
- [Espocrm](https://composio.dev/toolkits/espocrm) - EspoCRM is an open-source web application for managing customer relationships. It helps businesses organize contacts, track leads, and streamline their sales process.
- [Fireberry](https://composio.dev/toolkits/fireberry) - Fireberry is a CRM platform that streamlines customer and sales management. It helps businesses organize contacts, automate sales, and integrate with other business tools.
- [Firmao](https://composio.dev/toolkits/firmao) - Firmao is a business information platform offering company, industry, and market data. Use it to quickly research firms and gain competitive market insights.

## Frequently Asked Questions

### What is the Composio Universal CLI?

The Composio Universal CLI is a single command-line interface that lets coding agents and developers interact with 1000+ SaaS applications. It handles authentication, tool discovery, action execution, and trigger setup — all from the terminal, without needing to configure MCP servers.

### Which coding agents work with the Composio CLI?

Any coding agent that can run shell commands works with the Composio CLI — including Claude Code, Codex, OpenCode, OpenClaw, and others. Once the CLI is installed, agents automatically discover and use the composio commands to interact with Salesforce and other connected apps.

### How is the CLI different from using an MCP server for Salesforce?

MCP servers require configuration and can be token-heavy for complex workflows. The CLI gives agents a direct, lightweight interface — no server setup needed. Agents simply call composio commands like any other shell tool. It's faster to set up, more reliable for multi-step tool chaining, and works natively with how coding agents already operate.

### How safe is my Salesforce data when using the Composio CLI?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Salesforce data and credentials are handled as safely as possible. You can also bring your own OAuth credentials for full control.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
