How to integrate Salesforce MCP with Vercel AI SDK v6

This guide walks you through connecting Salesforce to Vercel AI SDK v6 using the Composio tool router. By the end, you'll have a working Salesforce agent that can add new contact to spring campaign, clone opportunity with all associated products, complete follow-up task for lead smith through natural language commands. This guide will help you understand how to give your Vercel AI SDK agent real control over a Salesforce account through Composio's Salesforce MCP server. Before we dive in, let's take a quick look at the key ideas and tools involved.

Salesforce logoSalesforce
Oauth2S2s Oauth2

Salesforce is a leading CRM platform that helps businesses manage sales, service, and marketing. It centralizes customer data, enabling teams to drive growth and build strong relationships.

179 Tools7 Triggers

Introduction

This guide walks you through connecting Salesforce to Vercel AI SDK v6 using the Composio tool router. By the end, you'll have a working Salesforce agent that can add new contact to spring campaign, clone opportunity with all associated products, complete follow-up task for lead smith through natural language commands.

This guide will help you understand how to give your Vercel AI SDK agent real control over a Salesforce account through Composio's Salesforce MCP server.

Before we dive in, let's take a quick look at the key ideas and tools involved.

Also integrate Salesforce with

TL;DR

Here's what you'll learn:
  • How to set up and configure a Vercel AI SDK agent with Salesforce integration
  • Using Composio's Tool Router to dynamically load and access Salesforce tools
  • Creating an MCP client connection using HTTP transport
  • Building an interactive CLI chat interface with conversation history management
  • Handling tool calls and results within the Vercel AI SDK framework

What is Vercel AI SDK?

The Vercel AI SDK is a TypeScript library for building AI-powered applications. It provides tools for creating agents that can use external services and maintain conversation state.

Key features include:

  • streamText: Core function for streaming responses with real-time tool support
  • MCP Client: Built-in support for Model Context Protocol via @ai-sdk/mcp
  • Step Counting: Control multi-step tool execution with stopWhen: stepCountIs()
  • OpenAI Provider: Native integration with OpenAI models

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.

What is the Composio tool router, and how does it fit here?

What is Composio SDK?

Composio's Composio SDK helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Composio SDK

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Composio SDK works

The Composio SDK follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before you begin, make sure you have:
  • Node.js and npm installed
  • A Composio account with API key
  • An OpenAI API key
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key. You'll need credits to use the models, or you can connect to another model provider.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.
3

Install required dependencies

bash
npm install @ai-sdk/openai @ai-sdk/mcp @composio/core ai dotenv

First, install the necessary packages for your project.

What you're installing:

  • @ai-sdk/openai: Vercel AI SDK's OpenAI provider
  • @ai-sdk/mcp: MCP client for Vercel AI SDK
  • @composio/core: Composio SDK for tool integration
  • ai: Core Vercel AI SDK
  • dotenv: Environment variable management
4

Set up environment variables

bash
OPENAI_API_KEY=your_openai_api_key_here
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_user_id_here

Create a .env file in your project root.

What's needed:

  • OPENAI_API_KEY: Your OpenAI API key for GPT model access
  • COMPOSIO_API_KEY: Your Composio API key for tool access
  • COMPOSIO_USER_ID: A unique identifier for the user session
5

Import required modules and validate environment

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Composio } from "@composio/core";
import * as readline from "readline";
import { streamText, type ModelMessage, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";

const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!process.env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey,
});
What's happening:
  • We're importing all necessary libraries including Vercel AI SDK's OpenAI provider and Composio
  • The dotenv/config import automatically loads environment variables
  • The MCP client import enables connection to Composio's tool server
6

Create Tool Router session and initialize MCP client

typescript
async function main() {
  // Create a tool router session for the user
  const session = await composio.create(composioUserID!, {
    toolkits: ["salesforce"],
  });

  const mcpUrl = session.mcp.url;
What's happening:
  • We're creating a Tool Router session that gives your agent access to Salesforce tools
  • The create method takes the user ID and specifies which toolkits should be available
  • The returned mcp object contains the URL and authentication headers needed to connect to the MCP server
  • This session provides access to all Salesforce-related tools through the MCP protocol
7

Connect to MCP server and retrieve tools

typescript
const mcpClient = await createMCPClient({
  transport: {
    type: "http",
    url: mcpUrl,
    headers: session.mcp.headers, // Authentication headers for the Composio MCP server
  },
});

const tools = await mcpClient.tools();
What's happening:
  • We're creating an MCP client that connects to our Composio Tool Router session via HTTP
  • The mcp.url provides the endpoint, and mcp.headers contains authentication credentials
  • The type: "http" is important - Composio requires HTTP transport
  • tools() retrieves all available Salesforce tools that the agent can use
8

Initialize conversation and CLI interface

typescript
let messages: ModelMessage[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
console.log(
  "Ask any questions related to salesforce, like summarize my last 5 emails, send an email, etc... :)))\n",
);

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: "> ",
});

rl.prompt();
What's happening:
  • We initialize an empty messages array to maintain conversation history
  • A readline interface is created to accept user input from the command line
  • Instructions are displayed to guide the user on how to interact with the agent
9

Handle user input and stream responses with real-time tool feedback

typescript
rl.on("line", async (userInput: string) => {
  const trimmedInput = userInput.trim();

  if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
    console.log("\nGoodbye!");
    rl.close();
    process.exit(0);
  }

  if (!trimmedInput) {
    rl.prompt();
    return;
  }

  messages.push({ role: "user", content: trimmedInput });
  console.log("\nAgent is thinking...\n");

  try {
    const stream = streamText({
      model: openai("gpt-5"),
      messages,
      tools,
      toolChoice: "auto",
      stopWhen: stepCountIs(10),
      onStepFinish: (step) => {
        for (const toolCall of step.toolCalls) {
          console.log(`[Using tool: ${toolCall.toolName}]`);
          }
          if (step.toolCalls.length > 0) {
            console.log(""); // Add space after tool calls
          }
        },
      });

      for await (const chunk of stream.textStream) {
        process.stdout.write(chunk);
      }

      console.log("\n\n---\n");

      // Get final result for message history
      const response = await stream.response;
      if (response?.messages?.length) {
        messages.push(...response.messages);
      }
    } catch (error) {
      console.error("\nAn error occurred while talking to the agent:");
      console.error(error);
      console.log(
        "\nYou can try again or restart the app if it keeps happening.\n",
      );
    } finally {
      rl.prompt();
    }
  });

  rl.on("close", async () => {
    await mcpClient.close();
    console.log("\n👋 Session ended.");
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});
What's happening:
  • We use streamText instead of generateText to stream responses in real-time
  • toolChoice: "auto" allows the model to decide when to use Salesforce tools
  • stopWhen: stepCountIs(10) allows up to 10 steps for complex multi-tool operations
  • onStepFinish callback displays which tools are being used in real-time
  • We iterate through the text stream to create a typewriter effect as the agent responds
  • The complete response is added to conversation history to maintain context
  • Errors are caught and displayed with helpful retry suggestions

Complete Code

Here's the complete code to get you started with Salesforce and Vercel AI SDK:

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Composio } from "@composio/core";
import * as readline from "readline";
import { streamText, type ModelMessage, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";

const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!process.env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey,
});

async function main() {
  // Create a tool router session for the user
  const session = await composio.create(composioUserID!, {
    toolkits: ["salesforce"],
  });

  const mcpUrl = session.mcp.url;

  const mcpClient = await createMCPClient({
    transport: {
      type: "http",
      url: mcpUrl,
      headers: session.mcp.headers, // Authentication headers for the Composio MCP server
    },
  });

  const tools = await mcpClient.tools();

  let messages: ModelMessage[] = [];

  console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
  console.log(
    "Ask any questions related to salesforce, like summarize my last 5 emails, send an email, etc... :)))\n",
  );

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: "> ",
  });

  rl.prompt();

  rl.on("line", async (userInput: string) => {
    const trimmedInput = userInput.trim();

    if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
      console.log("\nGoodbye!");
      rl.close();
      process.exit(0);
    }

    if (!trimmedInput) {
      rl.prompt();
      return;
    }

    messages.push({ role: "user", content: trimmedInput });
    console.log("\nAgent is thinking...\n");

    try {
      const stream = streamText({
        model: openai("gpt-5"),
        messages,
        tools,
        toolChoice: "auto",
        stopWhen: stepCountIs(10),
        onStepFinish: (step) => {
          for (const toolCall of step.toolCalls) {
            console.log(`[Using tool: ${toolCall.toolName}]`);
          }
          if (step.toolCalls.length > 0) {
            console.log(""); // Add space after tool calls
          }
        },
      });

      for await (const chunk of stream.textStream) {
        process.stdout.write(chunk);
      }

      console.log("\n\n---\n");

      // Get final result for message history
      const response = await stream.response;
      if (response?.messages?.length) {
        messages.push(...response.messages);
      }
    } catch (error) {
      console.error("\nAn error occurred while talking to the agent:");
      console.error(error);
      console.log(
        "\nYou can try again or restart the app if it keeps happening.\n",
      );
    } finally {
      rl.prompt();
    }
  });

  rl.on("close", async () => {
    await mcpClient.close();
    console.log("\n👋 Session ended.");
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});

Conclusion

You've successfully built a Salesforce agent using the Vercel AI SDK with streaming capabilities! This implementation provides a powerful foundation for building AI applications with natural language interfaces and real-time feedback.

Key features of this implementation:

  • Real-time streaming responses for a better user experience with typewriter effect
  • Live tool execution feedback showing which tools are being used as the agent works
  • Dynamic tool loading through Composio's Tool Router with secure authentication
  • Multi-step tool execution with configurable step limits (up to 10 steps)
  • Comprehensive error handling for robust agent execution
  • Conversation history maintenance for context-aware responses

You can extend this further by adding custom error handling, implementing specific business logic, or integrating additional Composio toolkits to create multi-app workflows.
TOOLS & TRIGGERS

Supported Tools and Triggers

Every Salesforce action and event your agent gets out of the box.

Add contact to campaign

Adds a contact to a campaign by creating a CampaignMember record to track campaign engagement.

Add lead to campaign

Adds a lead to a campaign by creating a CampaignMember record, allowing you to track campaign engagement.

Add product to opportunity

Adds a product (line item) to an opportunity.

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.

Associate contact to account

Associates a contact with an account by updating the contact's AccountId field.

Clone opportunity with products

Clones an opportunity and optionally its products (line items).

Clone record

Creates a copy of an existing Salesforce record by reading its data, removing system fields, and creating a new record.

Close or abort a job

Tool to close or abort a Salesforce Bulk API v2 ingest job.

Complete task

Marks a task as completed with optional completion notes.

Create account

Creates a new account in Salesforce with the specified information.

Create a record

Tool to create a Salesforce record using the UI API.

Create campaign

Creates a new campaign in Salesforce.

Create contact

Creates a new contact in Salesforce with the specified information.

Create custom field

Tool to create a custom field on a Salesforce object using the Tooling API.

Create custom object

Tool to create a custom object in Salesforce using the Metadata API.

Create lead

Creates a new lead in Salesforce.

Create note

Creates a new note attached to a Salesforce record with the specified title and content.

Create opportunity

Creates a new opportunity in Salesforce with the specified information.

Create SObject record

Tool to create a new Salesforce SObject record.

Create sObject tree

Tool to create one or more sObject trees with root records of the specified type.

Create task

Creates a new task in Salesforce to track activities, to-dos, and follow-ups related to contacts, leads, or other records.

Delete account

Permanently deletes an account from Salesforce.

Delete campaign

Permanently deletes a campaign from Salesforce.

Delete contact

Permanently deletes a contact from Salesforce.

Delete file

Tool to permanently delete a file from Salesforce.

Delete job query

Tool to delete a Salesforce Bulk API v2 query job.

Delete lead

Permanently deletes a lead from Salesforce.

Delete note

Permanently deletes a note from Salesforce.

Delete opportunity

Permanently deletes an opportunity from Salesforce.

Delete sObject record

Tool to delete a single Salesforce record by its ID.

Delete multiple records (SObject Collections)

Tool to delete up to 200 records in one request with optional rollback.

Execute sObject Quick Action

Tool to execute a specific quick action on an sObject to create records with pre-configured defaults.

Execute SOSL search

Execute a SOSL search to search across multiple Salesforce objects.

Get batch of UI API records

Tool to retrieve multiple Salesforce records in a single request with customizable field selection.

Get account

Retrieves a specific account by ID from Salesforce, returning all available fields.

Get all objects

Retrieves all Salesforce objects (standard and custom) with detailed metadata.

Get all fields for an object

Retrieves all fields (standard and custom) for a Salesforce object with complete metadata including field types, constraints, picklist values, and relationships.

Get all navigation items

Gets all navigation items (tabs) that the user has access to.

Get API resources by version

Tool to discover available REST API resources for a specified Salesforce API version.

Get an app

Tool to get metadata about a specific Salesforce app by ID.

Get apps

Tool to get metadata for all apps a user has access to.

Get campaign

Retrieves a specific campaign by ID from Salesforce, returning all available fields.

Get Chatter resources

Tool to access Chatter resources directory.

Get child records

Tool to get child records for a specified parent record and child relationship name.

Get Compact Layouts

Tool to retrieve compact layout information for multiple Salesforce objects.

Get composite resources

Tool to retrieve a list of available composite resources in Salesforce.

Get multiple records by IDs

Retrieves multiple records of the same object type by IDs with a request body.

Get consent preferences

Tool to retrieve aggregated consent preferences across multiple records for a specific action.

Get contact

Retrieves a specific contact by ID from Salesforce, returning all available fields.

Retrieve specific contact by id

Retrieves a Salesforce Contact by its unique ID; the ID must correspond to an existing Contact record in Salesforce.

Get dashboard

Gets detailed metadata for a specific dashboard including its components, layout, and filters.

Get file content

Returns the binary content of a Salesforce file, including references to external files.

Get file information

Tool to retrieve comprehensive metadata and information about a specified file in Salesforce.

Get file shares

Returns information about the objects with which the specified file has been shared.

Get global actions

Tool to retrieve actions displayed in the Salesforce Global Actions menu with metadata.

Get job failed record results

Tool to retrieve failed records from a Salesforce Bulk API 2.

Get job successful record results

Tool to retrieve successfully processed records from a Salesforce Bulk API 2.

Get job unprocessed record results

Tool to retrieve unprocessed records from a Salesforce Bulk API 2.

Get last selected app

Retrieves the app the current user last selected or the app the user sees by default.

Get lead

Retrieves a specific lead by ID from Salesforce, returning all available fields.

Get List View Header Actions

Tool to retrieve header actions on list views.

Get batch of list view metadata

Tool to retrieve metadata for multiple list views in a single batch request.

Get list view metadata

Returns list view metadata by object and list view API name.

Get list view records by ID

Returns record data for a list view by its ID.

Get list view records by API name

Retrieves paginated record data for a specified list view using the object and list view API names.

Get list view results

Retrieves the results of a list view for a specified sObject.

Get lookup field suggestions

Tool to retrieve lookup field suggestions for editing lookup fields with search filtering.

Get lookup field suggestions with POST

Tool to get lookup field suggestions with POST request.

Get MRU list view metadata

Tool to retrieve MRU list view metadata for a Salesforce object.

Get most recently used list view records

Tool to retrieve record data for an object's most recently used (MRU) list view.

Get note

Retrieves a specific note by ID from Salesforce, returning all available fields.

Get list views for an object

Returns a collection of list views associated with a Salesforce object.

Get opportunity

Retrieves a specific opportunity by ID from Salesforce, returning all available fields.

Get organization limits

Tool to retrieve organization limits with max and remaining allocations.

Get photo actions

Tool to retrieve available photo actions for Salesforce pages.

Get Values for All Picklist Fields

Tool to get values for all picklist fields of a record type, including dependent picklists.

Get job info query

Tool to retrieve information about a Salesforce Bulk API v2 query job.

Get job query result

Retrieves results for a completed Bulk API v2 query job in CSV format.

Get quick actions

Tool to retrieve global and object-specific quick actions from Salesforce.

Get record count for objects

Tool to retrieve total record counts for specified Salesforce objects.

Get record edit page actions

Tool to get available actions on record edit pages.

Get related list actions

Tool to get actions on related lists for record detail pages.

Get batch of related list user preferences

Tool to get a batch of related list user preferences from Salesforce.

Get related list records with request body

Tool to retrieve related list records with request body parameters for filtering and pagination.

Get search result layouts

Retrieves search result layout information for specified sObjects.

Search suggested queries

Returns a list of suggested searches based on the user's query string.

Get sObject by external ID

Tool to retrieve a Salesforce record by matching an external ID field value.

Get multiple sObject records

Tool to retrieve multiple records of the same sObject type in a single API call.

Get sObject list view information

Tool to retrieve basic information about a specific list view for an sObject.

Get list views for sObject

Tool to retrieve list views for a specified sObject.

Get PlatformAction SObject metadata

Retrieves metadata description of PlatformAction SObject.

Get sObject Quick Action Default Values by ID

Retrieves default field values for a quick action in a specific record context.

Get sObject Quick Action Default Values

Retrieves default field values for a specific quick action on an sObject.

Get sObject record by ID

Tool to retrieve a single Salesforce record by ID from any sObject type.

Get records using sObject relationships

Retrieves records by traversing sObject relationships using friendly URLs.

Get layouts for object with record type

Tool to retrieve layout metadata for a specific record type on an object.

Get approval layouts for object

Retrieves approval layouts for a specified Salesforce object.

Get updated sObject records

Tool to retrieve a list of sObject records that have been updated within a given timeframe.

Get support knowledge

Retrieves the root of the Support Knowledge REST API.

Get directory of supported objects

Tool to get a Salesforce org's active theme and directory of supported objects.

Get support knowledge articles

Retrieves user's visible knowledge articles and data categories from Salesforce Knowledge.

Get theme

Tool to get icons and colors for Salesforce UI themes.

Get lookup field actions

Tool to get lookup field actions for a Salesforce object.

Get MRU List View Actions

Tool to retrieve header actions available on the MRU (Most Recently Used) list view for a specified Salesforce object.

Get related list actions

Tool to get available actions on related lists for a record detail page.

Get Personalized Navigation Items

Tool to get personalized navigation items for a specific Salesforce app.

Get Account AllAccounts list view metadata

Retrieves list view metadata for the Account AllAccounts view using Salesforce UI API.

Get List View Metadata

Tool to get list view metadata from Salesforce UI API.

Get Account SearchResult list view metadata

Retrieves list view metadata for the Account __SearchResult view using Salesforce UI API.

Get List Views for Object

Tool to get list views for a Salesforce object.

Get record UI data and metadata

Tool to retrieve layout, field metadata, and record data in a single response.

Get related list user preferences

Tool to retrieve user preferences for a specific related list on an object.

Get user info

Retrieves information about the current user or a specific user in Salesforce.

Get custom actions headers

Tool to return HTTP headers for custom invocable actions without response body.

Get standard actions headers

Tool to return HTTP headers for standard invocable actions metadata without response body.

Get AppMenu Salesforce1 headers

Tool to return HTTP headers for AppMenu Salesforce1 mobile navigation items without response body.

Get process rules headers

Tool to return HTTP headers for process rules of an sObject without retrieving the response body.

Get Quick Actions headers

Tool to return HTTP headers for Quick Actions resource without response body.

Get quick action default values headers by ID

Tool to return HTTP headers for sObject quick action default values by context ID without response body.

Get global publisher layouts headers

Tool to return HTTP headers for all global publisher layouts without response body.

Get sObject quick action headers

Tool to return HTTP headers for a specific sObject quick action without response body.

Get User password headers

Tool to return HTTP headers for User password resource without response body.

List accounts

Lists accounts from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List Analytics templates

Tool to list CRM Analytics templates available in the org.

List campaigns

Lists campaigns from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List contacts

Lists contacts from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

Get custom invocable actions

Retrieves the list of custom actions including Flow actions, Apex actions, and invocable processes.

List dashboards

Lists all dashboards available in Salesforce with basic metadata including name, ID, and URLs.

List email templates

Lists available email templates in Salesforce with filtering and search capabilities.

List leads

Lists leads from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List notes

Lists notes from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List opportunities

Lists opportunities from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List pricebook entries

Lists pricebook entries from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List pricebooks

Lists pricebooks from Salesforce using SOQL query, allowing flexible filtering, sorting, and field selection.

List reports

Lists all reports available in Salesforce with basic metadata including name, ID, and URLs.

Get standard invocable actions

Retrieves the list of standard actions that can be statically invoked.

Log call

Logs a completed phone call as a task in Salesforce with call-specific details like duration, type, and disposition.

Log email activity

Creates an EmailMessage record to log email activity in Salesforce, associating it with related records.

Mass transfer ownership

Transfers ownership of multiple records to a new owner in a single operation using Salesforce's composite API for better performance.

Parameterized Search

Tool to execute RESTful search using parameters instead of SOSL clause.

Upsert records using external ID

Tool to upsert up to 200 records using external ID field matching.

Execute Composite Graph

Tool to execute multiple related REST API requests in a single transactional call with up to 500 subrequests per graph.

Create records using sObject Collections

Tool to create up to 200 records in one request using sObject Collections.

Parameterized Search

Tool to execute parameterized search across Salesforce objects with advanced filtering.

Query All (including deleted)

Tool to execute SOQL queries including soft-deleted and archived records.

Remove from campaign

Removes a lead or contact from a campaign by deleting the CampaignMember record.

Retrieve lead by id

Retrieves details for a Salesforce Lead by its ID; the specified Lead ID must exist in Salesforce.

Retrieve opportunities data

Retrieves all available Opportunity records, representing potential revenue-generating deals, from Salesforce.

Run report

Runs a report and returns the results.

Run SOQL query

Executes a SOQL query against Salesforce data.

Search accounts

Search for Salesforce accounts using criteria like name, industry, type, location, or contact information.

Search campaigns

Search for Salesforce campaigns using multiple criteria like name, type, status, date range, or active status.

Search contacts

Search Salesforce Contact records (not Leads — use SALESFORCE_SEARCH_LEADS for those) using name, email, phone, account, or title.

Search suggested article title matches

Search for Salesforce Knowledge articles with titles matching the search query.

Search leads

Search for Salesforce leads using criteria like name, email, phone, company, title, status, or lead source.

Search notes

Search for Salesforce notes using multiple criteria like title, body content, parent record, owner, or creation date.

Search opportunities

Search for Salesforce opportunities using multiple criteria like name, account, stage, amount, close date, or status.

Search tasks

Search for Salesforce tasks using multiple criteria like subject, status, priority, assigned user, related records, or dates.

Send email

Sends an email through Salesforce with options for recipients, attachments, and activity logging.

Send email from template

Sends an email using a predefined Salesforce email template with merge field support.

Send mass email

Sends bulk emails to multiple recipients immediately and irreversibly using a template or custom content.

Set user password

Tool to set or reset a user's password in Salesforce.

Update sObject record

Tool to update specific fields in an existing Salesforce sObject record.

Get user password expiration status

Tool to check whether a Salesforce user's password has expired.

Execute Tooling API query

Tool to execute SOQL queries against Salesforce Tooling API metadata objects.

Update account

Updates an existing account in Salesforce with the specified changes.

Update campaign

Updates an existing campaign in Salesforce with the specified changes.

Update contact

Updates an existing contact in Salesforce with the specified changes.

Update a favorite

Tool to update a favorite's properties in Salesforce UI API.

Update lead

Updates an existing lead in Salesforce with the specified changes.

Update list view preferences

Tool to update user preferences for a Salesforce list view including column widths, text wrapping, and display order.

Update note

Updates an existing note in Salesforce with the specified changes.

Update opportunity

Updates an existing opportunity in Salesforce with the specified changes.

Update a record

Tool to update a record's data in Salesforce via UI API.

Update Related List Preferences

Tool to update user preferences for a specific related list on an object in Salesforce.

Update task

Updates an existing task in Salesforce with new information.

Upload file to Salesforce Files

Upload a file to Salesforce Files home via the Connect REST API.

Upload job data

Tool to upload CSV data to a Salesforce Bulk API v2 ingest job.

Upsert sObject by External ID

Tool to upsert records using sObject Rows by External ID.

FAQ

Frequently asked questions

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.

Yes, you can. Vercel AI SDK v6 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.

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.

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.

Start with Salesforce.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Salesforce tool your agent needs.Free to start.

Start building