home / mcp / salesforce mcp server
A Model Context Protocol (MCP) server implementation for Salesforce integration in TypeScript
Configuration
View docs{
"mcpServers": {
"steffensbola-salesforce-mcp-ts": {
"command": "docker",
"args": [
"run",
"-p",
"3000:3000",
"-e",
"SALESFORCE_CLIENT_ID=your_consumer_key",
"-e",
"SALESFORCE_CLIENT_SECRET=your_consumer_secret",
"-e",
"[email protected]",
"-e",
"SALESFORCE_PASSWORD=your_password",
"-e",
"SALESFORCE_SECURITY_TOKEN=your_security_token",
"-e",
"SALESFORCE_SANDBOX=true",
"steffensbola/salesforce-mcp-ts:latest"
],
"env": {
"SALESFORCE_SANDBOX": "true",
"SALESFORCE_PASSWORD": "your_password",
"SALESFORCE_USERNAME": "[email protected]",
"SALESFORCE_CLIENT_ID": "your_consumer_key",
"SALESFORCE_CLIENT_SECRET": "your_consumer_secret",
"SALESFORCE_SECURITY_TOKEN": "your_security_token"
}
}
}
}You can connect to Salesforce from your MCP client using this TypeScript MCP server. It exposes tools to authenticate, query, search, retrieve metadata, perform CRUD operations, and run Salesforce APIs, all via a configurable Docker-based runtime that you can tailor to your environment.
Start the MCP server in your environment and point your MCP client at the local or remote server endpoint. Use the available tools to authenticate, run SOQL queries, perform SOSL searches, fetch object metadata, and manage Salesforce records. You can run the server in Docker, then connect your MCP client to the container’s exposed port. Ensure your environment variables are set to provide access to your Salesforce org. Once running, you can issue tool calls like authenticate_password, run_soql_query, run_sosl_search, get_object_fields, get_record, create_record, update_record, delete_record, tooling_execute, apex_execute, and restful to interact with Salesforce data and services.
Prerequisites: Node.js and Docker are helpful for local tooling, but you will primarily run the MCP server using Docker in this setup.
1) Install Docker on your machine if it is not already installed. 2) Ensure you have access to a Salesforce Connected App with OAuth credentials and a security token for password-based authentication, or prepare a valid access token and instance URL if you choose direct token authentication.
3) Pull and run the Salesforce MCP TypeScript Docker image using the commands below.Each command starts a new container with your environment variables applied.
# Pull the image (latest)
docker pull steffensbola/salesforce-mcp-ts:latest
# Run with credentials
docker run -p 3000:3000 \
-e SALESFORCE_CLIENT_ID=your_consumer_key \
-e SALESFORCE_CLIENT_SECRET=your_consumer_secret \
-e [email protected] \
-e SALESFORCE_PASSWORD=your_password \
-e SALESFORCE_SECURITY_TOKEN=your_security_token \
-e SALESFORCE_SANDBOX=true \
steffensbola/salesforce-mcp-ts:latestEnvironment variables control authentication mode, Salesforce target, and runtime behavior. Use the required variables to enable OAuth password flow, or provide a direct access token and instance URL for token-based authentication. The sandbox flag toggles between sandbox and production environments.
{
"servers": {
"salesforce": {
"command": "docker",
"args": [
"run",
"--rm",
"-p", "3000:3000",
"-e", "SALESFORCE_CLIENT_ID=your_consumer_key",
"-e", "SALESFORCE_CLIENT_SECRET=your_consumer_secret",
"-e", "[email protected]",
"-e", "SALESFORCE_PASSWORD=your_password",
"-e", "SALESFORCE_SECURITY_TOKEN=your_security_token",
"-e", "SALESFORCE_SANDBOX=true",
"steffensbola/salesforce-mcp-ts:latest"
]
}
}
}Authenticate and query: you can run a SOQL query to retrieve account data, or perform a SOSL search to locate records by name. Retrieve object metadata to understand fields and types, then create, read, update, or delete records as needed. Use tooling API requests, Apex REST calls, or direct REST API calls for advanced interactions.
If authentication fails, verify your Connected App’s OAuth scopes and ensure the security token is current. If the container fails to start, confirm that required environment variables are provided and Docker can pull the image. For network issues, check connectivity to Salesforce endpoints and firewall rules.
docker run -e DEBUG=true \
-e SALESFORCE_CLIENT_ID=... \
-e SALESFORCE_CLIENT_SECRET=... \
-e SALESFORCE_USERNAME=...
steffensbola/salesforce-mcp-ts:latestThe server supports multiple authentication methods and can be configured to run in sandbox or production environments. Use Docker Compose for easy local development and environment management if preferred.
The server exposes a set of tools to interact with Salesforce data and services. You can authenticate, run queries, search records, fetch metadata, manage records, and call REST or Tooling APIs as needed.
Required variables: SALESFORCE_CLIENT_ID, SALESFORCE_CLIENT_SECRET, SALESFORCE_USERNAME, SALESFORCE_PASSWORD, SALESFORCE_SECURITY_TOKEN. Optional: SALESFORCE_SANDBOX to select sandbox mode.
Authenticate using username and password with OAuth to obtain an access token.
Execute SOQL queries against Salesforce to retrieve data.
Execute SOSL searches to find records across multiple objects.
Retrieve metadata for Salesforce objects, including field names and types.
Retrieve a specific record by its Salesforce ID.
Create a new record in Salesforce with specified fields.
Update an existing Salesforce record with new field values.
Delete a Salesforce record by its ID.
Execute Tooling API requests for metadata and tooling operations.
Execute Apex REST requests against your Salesforce org.
Make direct REST API calls to Salesforce endpoints.