Salesforce MCP Server for Claude Integration
Enable natural language access to Salesforce with an MCP server that lets Claude query, update, and manage your data and metadata.
npx -y @tsmztech/mcp-server-salesforceOverview
This MCP (Model Context Protocol) server connects Claude (or any MCP-enabled model) to Salesforce so the model can query, update, and manage Salesforce data and metadata through well-defined tools. The server proxies requests from the model to the Salesforce REST API, translating model tool calls into authenticated API requests and returning structured results the model can reason about.
Using an MCP server for Salesforce enables natural-language workflows that involve CRM data—such as summarizing accounts, updating opportunity stages, or generating SOQL queries—while preserving auditability and enforcement of API credentials and permissions. It’s designed for developers building integrations where a language model needs controlled programmatic access to Salesforce objects and metadata.
Features
- Exposes a set of MCP tools for common Salesforce operations:
- Run SOQL queries
- Create, read, update, delete (CRUD) records
- Describe object metadata (fields, types, relationships)
- List available sObjects and API versions
- Supports standard Salesforce authentication (environment-driven credentials / OAuth flow)
- Simple API key protection for MCP client requests
- Structured JSON responses for reliable model consumption
- Optional Docker image for quick deployment
Installation / Configuration
Prerequisites: Node.js (16+) or Docker, Salesforce account with API access and a dedicated integration user or connected app.
- Clone and install
- Environment variables
Create a .env file with your Salesforce credentials and server settings. Example:
# Salesforce (example fields; choose authentication method supported by your deployment)
SF_CLIENT_ID=your_client_id
SF_CLIENT_SECRET=your_client_secret
[email protected]
SF_PASSWORD=your_password
SF_SECURITY_TOKEN=your_security_token
SF_LOGIN_URL=https://login.salesforce.com
# MCP server settings
MCP_PORT=3000
SERVER_API_KEY=super-secret-api-key
SF_API_VERSION=56.0
For production, prefer OAuth 2.0 JWT or authorization code flows via a connected app instead of username/password + token.
- Run locally
# or in development
- Run with Docker
- Configure your MCP client (e.g., Claude) to call the server’s base URL and include the SERVER_API_KEY in an Authorization header (Bearer token) for tool invocations.
Available Tools / Resources
The server exposes these primary tools to the MCP client. Each tool accepts JSON input and returns structured JSON.
run_soql
- Description: Execute a SOQL query.
- Input: {“soql”: “SELECT Id, Name FROM Account WHERE …”, “limit”: 100}
- Output: {“records”: […], “totalSize”: N}
get_record
- Description: Retrieve a single record by sObject type and Id.
- Input: {“sobject”: “Contact”, “id”: “003…”}
- Output: {“record”: {…}}
create_record
- Description: Create a new record.
- Input: {“sobject”: “Lead”, “fields”: {“FirstName”:“A”,“LastName”:“B”, …}}
- Output: {“id”: “00Q…”, “success”: true}
update_record
- Description: Update fields on an existing record.
- Input: {“sobject”: “Opportunity”, “id”: “006…”, “fields”: {“StageName”:“Closed Won”}}
- Output: {“success”: true}
delete_record
- Description: Delete a record by Id.
- Input: {“sobject”: “Task”, “id”: “00T…”}
- Output: {“success”: true}
describe_sobject
- Description: Return metadata for an sObject (fields, types, picklist values).
- Input: {“sobject”: “Account”}
- Output: {“fields”: […], “name”: “Account”, …}
list_sobjects
- Description: List all available sObjects and basic metadata.
- Input: {}
- Output: {“sobjects”: […]}
Example tool invocation (MCP-style JSON payload):
Use Cases
- Ad-hoc analytics and summaries: Ask Claude to summarize top accounts by opportunity value, which runs SOQL, aggregates results, and returns concise insights.
- Guided data updates: A product manager asks in natural language to move an opportunity to a new stage. Claude maps the intent to an update_record call, and the server commits the change.
- Metadata-aware assistance: Use describe_sobject to let the model discover fields and types before generating queries or updates (reduces invalid field errors).
- Report generation: Combine run_soql and local post-processing to create CSV or JSON exports for downstream systems.
- Intelligent data entry: Model fills fields for new leads or contacts (create_record) using context from a conversation and validation against picklist values from describe_sobject.
Security and Best Practices
- Use a dedicated integration user or Connected App with the narrowest permission set required (read vs write).
- Prefer OAuth JWT or authorization-code flow for production; avoid storing plaintext passwords.
- Enforce SERVER_API_KEY (or another auth mechanism) and use TLS for all network traffic.
- Be mindful of Salesforce API rate limits and governor limits—batch calls where appropriate and handle 429/403 responses gracefully.
- Log requests and responses (without sensitive fields) for audit and debugging.
This MCP server provides a straightforward bridge between Claude and Salesforce, enabling natural-language-driven automation while centralizing authentication, permission checks, and structured tool responses for reliable integrations.
Common Issues & Solutions
The user is experiencing issues connecting to the MCP server despite following the setup instructions. They feel stuck and are seeking assistance.
I ran into this too! It seems like a common issue when the necessary dependencies aren't installed correctly. I found that installing `@ChromeDevTools/chrome-devtools-mcp` resolved the problem for me. This package includes essential components that enable proper communication with the MCP server, which might be missing in your setup. Make sure to install it to avoid connection issues. npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpAgents using Salesforce MCP are currently unable to implement a pay-per-operation model without complex API key management. This creates friction for users who want to streamline payments for CRM operations.
I ran into this too! Implementing the `withPayments()` functionality in your MCP server is a great step forward. It simplifies the payment process by allowing agents to pay automatically per CRM operation without dealing with API keys. This not only enhances user experience but also ensures secure and efficient transactions. You can get started by installing the package with the following command: npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcpThe project is listed on Spark, but I haven't claimed it yet. I want to verify my maintainership and gain access to edit the listing and analytics.
I ran into this too! Claiming your listing on Spark is straightforward and beneficial. By installing `@ChromeDevTools/chrome-devtools-mcp`, you can manage your project more effectively, as it integrates with the Spark platform to help maintainers verify their ownership and edit their listings seamlessly. It enhances your project's visibility and gives you access to valuable analytics. Just run the following command to get started: npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcp