home / mcp / salesforce mcp server
An MCP (Model Context Protocol) server implementation that integrates Claude with Salesforce, enabling natural language interactions with your Salesforce data and metadata. This server allows Claude to query, modify, and manage your Salesforce objects and records using everyday language.
Configuration
View docs{
"mcpServers": {
"surajadsul-mcp-server-salesforce": {
"command": "env",
"args": [
"[email protected]",
"SALESFORCE_PASSWORD=YourActualPassword123",
"SALESFORCE_TOKEN=YourActualSecurityToken123",
"SALESFORCE_INSTANCE_URL=https://login.salesforce.com",
"npx",
"-y",
"@surajadsul02/mcp-server-salesforce"
],
"env": {
"SALESFORCE_TOKEN": "YourActualSecurityToken123",
"SALESFORCE_PASSWORD": "YourActualPassword123",
"SALESFORCE_USERNAME": "[email protected]",
"SALESFORCE_CONSUMER_KEY": "YourConsumerKey",
"SALESFORCE_INSTANCE_URL": "https://login.salesforce.com",
"SALESFORCE_CONSUMER_SECRET": "YourConsumerSecret"
}
}
}
}This Salesforce MCP Server lets you talk to Salesforce using natural language through an MCP client. It translates your questions and commands into Salesforce data queries and updates, enabling you to search objects, view schemas, run queries, and manipulate records with everyday language.
You interact with Salesforce data and metadata by connecting an MCP client to the Salesforce MCP Server. You can ask for object information, query records, create or update fields, and perform cross-object searches. Start by authenticating, then issue natural language requests such as finding objects by partial names, describing object schemas, querying accounts or cases, and applying changes to records. The server handles Salesforce-specific details and returns clear results and error information when something goes wrong.
Prerequisites you need before installing are Node.js and npm. Ensure you have a supported environment where you can install global npm packages and run commands from your shell.
# Install the MCP server package globally
npm install -g @surajadsul02/mcp-server-salesforceTo connect the MCP server, you must provide Salesforce credentials and instance details. You can authenticate with either Username/Password or OAuth2. The following examples show how to run the MCP server as a local stdio process with environment variables set for authentication.
# Example 1: Username/Password authentication via stdio (Cursor-like setup)
# Run the server with environment variables set, then start the MCP server
[email protected] \
SALESFORCE_PASSWORD=YourActualPassword123 \
SALESFORCE_TOKEN=YourActualSecurityToken123 \
SALESFORCE_INSTANCE_URL=https://login.salesforce.com \
SALESFORCE_CONSUMER_KEY=YourConsumerKey \
SALESFORCE_CONSUMER_SECRET=YourConsumerSecret \
npx -y @surajadsul02/mcp-server-salesforce# Example 2: OAuth2 authentication via stdio (Cursor/Desktop setup)
[email protected] \
SALESFORCE_PASSWORD=YourActualPassword123 \
SALESFORCE_CONSUMER_KEY=YourConsumerKey \
SALESFORCE_CONSUMER_SECRET=YourConsumerSecret \
SALESFORCE_INSTANCE_URL=https://login.salesforce.com \
npx -y @surajadsul02/mcp-server-salesforceCursor IDE and Claude Desktop integrations provide straightforward ways to connect your Salesforce MCP Server. In Cursor, you configure the MCP server to run with an env command that sets the Salesforce credentials and then launches the MCP server with npx. In Claude Desktop, you add a configuration that runs the MCP server via npx with the required environment variables.
# Cursor example snippet (env command)
{
"mcpServers": {
"salesforce": {
"command": "env",
"args": [
"[email protected]",
"SALESFORCE_PASSWORD=YourActualPassword123",
"SALESFORCE_TOKEN=YourActualSecurityToken123",
"SALESFORCE_INSTANCE_URL=https://login.salesforce.com",
"npx",
"-y",
"@surajadsul02/mcp-server-salesforce"
]
}
}
}# Claude Desktop example snippet (env command)
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["-y", "@surajadsul02/mcp-server-salesforce"],
"env": {
"SALESFORCE_USERNAME": "your_username",
"SALESFORCE_PASSWORD": "your_password",
"SALESFORCE_TOKEN": "your_security_token",
"SALESFORCE_INSTANCE_URL": "https://login.salesforce.com"
}
}
}
}If authentication fails, verify credentials and tokens. For OAuth2, confirm the consumer key and secret. If you run into connection issues, check the Salesforce instance URL and network access. When integrating with tools like Cursor or Claude Desktop, restart the client after configuration changes and ensure the MCP server package is installed globally.
If you want to contribute, set up your development environment by installing dependencies and building the project. Then run the server locally to verify changes.
# Build steps (example flow)
git clone https://github.com/surajadsul02/mcp-server-salesforce.git
cd mcp-server-salesforce
npm install
npm run buildFind Salesforce objects using partial name matches or keywords, returning relevant objects and metadata.
Retrieve detailed schema information for a given object, including fields and relationships.
Execute flexible queries against Salesforce data, with support for relationships and filters.
Insert, update, delete, or upsert records across objects.
Perform searches across multiple objects, leveraging SOSL when needed.
Provide Salesforce-specific error details and guidance when operations fail.