# How to integrate Salesforce MCP with OpenCode

```json
{
  "title": "How to integrate Salesforce MCP with OpenCode",
  "toolkit": "Salesforce",
  "toolkit_slug": "salesforce",
  "framework": "OpenCode",
  "framework_slug": "opencode",
  "url": "https://composio.dev/toolkits/salesforce/framework/opencode",
  "markdown_url": "https://composio.dev/toolkits/salesforce/framework/opencode.md",
  "updated_at": "2026-05-06T08:26:36.357Z"
}
```

## Introduction

### How to integrate Salesforce MCP with OpenCode
This guide explains how to connect Salesforce MCP to OpenCode using Composio Connect, which simplifies OAuth, API changes, and reliability concerns.
There are two ways to set this up:
- Via [Composio Connect MCP](https://dashboard.composio.dev/)
- Via the [Composio CLI](https://dashboard.composio.dev/)

## 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)
- [OpenClaw](https://composio.dev/toolkits/salesforce/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/salesforce/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/salesforce/framework/cli)
- [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

### Why use Composio?
Composio provides a single MCP server or CLI tool that exposes a set of meta-tools, allowing you to:
- Connect to 1,000+ apps with on-demand tool loading, so you do not fill your LLM context window with unnecessary tool definitions.
- Use programmatic tool calling through a remote Bash tool, letting LLMs write their own code to handle complex tool chaining. This reduces back-and-forth for frequent tool calls.
- Handle large tool responses outside the LLM context to keep conversations lean.

## Connect Salesforce to OpenCode

### Connect Salesforce with OpenCode
### Option 1: Using Composio CLI
### 1. Install Composio CLI
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. |

## Creating MCP Server - Stand-alone vs Composio SDK

Once connected, OpenCode can access the Salesforce MCP server via Composio to run the app actions you authorize, directly from your coding workflow.

## Complete Code

None listed.

## Conclusion

### Way Forward
Now that Salesforce is connected, extend your setup by connecting the other apps you already use every day, so your agent can run true cross-app workflows end to end.
- Connect Calendar to turn threads into scheduled meetings automatically.
- Connect Slack or Teams to post summaries, approvals, and alerts where your team works.
- Connect Notion, Linear, Jira, or Asana to convert requests into tickets, tasks, and docs.
- Connect Drive, Dropbox, or OneDrive to fetch, file, and share attachments without manual steps.
Start with one workflow you do repeatedly, then keep adding apps as you find new handoffs. With everything behind a single MCP endpoint, your agent can coordinate multiple tools safely and reliably in one conversation.

## 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)
- [OpenClaw](https://composio.dev/toolkits/salesforce/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/salesforce/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/salesforce/framework/cli)
- [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 are the differences in Tool Router MCP and Salesforce MCP?

With a standalone Salesforce MCP server, the agents and LLMs can only access a fixed set of Salesforce tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Salesforce and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with OpenCode?

Yes, you can. OpenCode fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Salesforce tools.

### Can I manage the permissions and scopes for Salesforce while using Tool Router?

Yes, absolutely. You can configure which Salesforce scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

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.

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