A Model Context Protocol (MCP) server that provides seamless integration with Salesforce using OAuth authentication. This server enables AI assistants like Claude to interact with any Salesforce organization through a secure, generic interface.
- π― Seamless Authentication - Claude automatically detects when authentication is needed and handles it transparently
- π Zero Manual Setup - No need to run terminal commands or manual OAuth flows
- π OAuth-Only Authentication - Secure browser-based setup with automatic token refresh
- π Universal Salesforce Integration - Works with any Salesforce org, including custom objects and fields
- π§ Smart Installation Learning - Analyzes your complete Salesforce setup to provide intelligent assistance
- π Dynamic Schema Discovery - Automatically adapts to your Salesforce configuration
- π Secure Token Storage - File-based storage with strict permissions for production-grade security
- π Full CRUD Operations - Query, create, update, and delete any Salesforce records
- π Schema Inspection - Get detailed information about objects and fields
- π‘ Context-Aware Suggestions - Provides intelligent field and object name suggestions
- πΎ Comprehensive Backup System - Complete data and file backup with support for all Salesforce file systems
- β° Time Machine Feature - Point-in-time data recovery and historical analysis
- π Multi-Format File Support - Backs up ContentVersions, Attachments, and Documents with proper metadata
- Node.js 18+
- macOS (required for secure token storage)
- Salesforce Connected App with OAuth configured
Use NPX to run the MCP server without any permanent installation:
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["@aiondadotcom/mcp-salesforce"],
"env": {
"SALESFORCE_CLIENT_ID": "your-client-id",
"SALESFORCE_CLIENT_SECRET": "your-client-secret",
"SALESFORCE_INSTANCE_URL": "https://yourorg.salesforce.com"
}
}
}
}
β Benefits of NPX Usage:
- π Always Latest: Automatically uses the latest published version
- πΎ No Disk Space: No permanent installation required
- π‘οΈ No Conflicts: No global package conflicts
- β‘ Easy Updates: Just restart - gets latest version automatically
- π Simple Config: Copy-paste ready MCP configuration
NPX Command Line Usage:
# Get version
npx -p @aiondadotcom/mcp-salesforce mcp-salesforce --version
# Get help
npx -p @aiondadotcom/mcp-salesforce mcp-salesforce --help
# Run OAuth setup
npx -p @aiondadotcom/mcp-salesforce mcp-salesforce setup
For development or customization:
-
Clone and install dependencies:
git clone https://github.com/AiondaDotCom/mcp-salesforce.git cd mcp-salesforce npm install
-
Configure environment variables:
cp .env.example .env # Edit .env with your Salesforce Connected App details
-
Add to Claude Desktop using local path (see Configuration below)
That's it! Claude will automatically handle authentication when you first use any Salesforce tool.
β¨ No More Manual Setup!
- No need to run
npm run setup
- No terminal authentication required
- Claude automatically detects when authentication is needed
- Seamless OAuth flow directly from Claude Desktop
π§ Smart Learning System
- Use
salesforce_learn
to analyze your complete Salesforce installation - Claude learns all your custom objects, fields, and relationships
- Provides intelligent suggestions based on your specific setup
- Context-aware assistance for complex Salesforce environments
β Package Successfully Published!
The package @aiondadotcom/mcp-salesforce
is now live on NPM and ready for use.
NPX usage is now available for all users:
# Test the published package
npx -p @aiondadotcom/mcp-salesforce mcp-salesforce --version
npx -p @aiondadotcom/mcp-salesforce mcp-salesforce --help
# Run OAuth setup
npx -p @aiondadotcom/mcp-salesforce mcp-salesforce setup
- Package Name:
@aiondadotcom/mcp-salesforce
- Version:
1.0.7
(latest) - Registry: NPM Public Registry
- Organization:
@aiondadotcom
- Access: Public
Status:
- β Package published to NPM
- β NPX compatibility verified
- β Binary wrapper implemented
- β Setup command functional
- β MCP configuration ready
- β Available for immediate use
π All NPX functionality now works for end users worldwide!
-
In Salesforce Setup, create a new Connected App:
- App Name: MCP Salesforce Integration
- API Name: mcp_salesforce_integration
- Contact Email: Your email
- Enable OAuth Settings: β Yes
- Callback URL:
http://localhost:8080/callback
(will be auto-generated) - Selected OAuth Scopes:
- Manage user data via APIs (api)
- Perform requests at any time (refresh_token, offline_access)
-
After saving, copy the Consumer Key and Consumer Secret
Create a .env
file with your Salesforce details:
SALESFORCE_CLIENT_ID=3MVG9...your-consumer-key...
SALESFORCE_CLIENT_SECRET=1234567890...your-consumer-secret...
SALESFORCE_INSTANCE_URL=https://yourorg.salesforce.com
# Optional settings
SALESFORCE_API_VERSION=v58.0
SALESFORCE_TIMEOUT=30000
LOG_LEVEL=info
Add this to your Claude Desktop MCP configuration (~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["@aiondadotcom/mcp-salesforce"],
"env": {
"SALESFORCE_CLIENT_ID": "your-client-id",
"SALESFORCE_CLIENT_SECRET": "your-client-secret",
"SALESFORCE_INSTANCE_URL": "https://yourorg.salesforce.com"
}
}
}
}
For development or customized installations:
{
"mcpServers": {
"salesforce": {
"command": "node",
"args": ["/path/to/mcp-salesforce/src/index.js"],
"env": {
"SALESFORCE_CLIENT_ID": "your-client-id",
"SALESFORCE_CLIENT_SECRET": "your-client-secret",
"SALESFORCE_INSTANCE_URL": "https://yourorg.salesforce.com"
}
}
}
}
For VS Code with MCP extension:
{
"servers": {
"salesforce": {
"command": "npx",
"args": ["@aiondadotcom/mcp-salesforce"],
"env": {
"SALESFORCE_CLIENT_ID": "your-client-id",
"SALESFORCE_CLIENT_SECRET": "your-client-secret",
"SALESFORCE_INSTANCE_URL": "https://yourorg.salesforce.com"
}
}
}
}
Here's a step-by-step walkthrough of the MCP Salesforce Server in action, showing a real-world use case of verifying and updating company address information:
Claude checking if the Aionda GmbH account in Salesforce has the correct address by comparing it with their current website address
Claude identifying that the Salesforce address is outdated, showing detailed comparison between the current Salesforce data and the actual address from the company website
Claude successfully updating the Salesforce account with the correct current address, showing exactly which fields were changed
The updated account record in Salesforce showing the corrected address information is now accurate and up-to-date
π§ Learns your complete Salesforce installation - Analyzes all objects, fields and customizations once and stores this information locally for intelligent assistance.
// One-time analysis of the Salesforce installation
{}
// Force complete re-analysis
{
"force_refresh": true,
"detailed_relationships": true
}
Why important?
- Claude learns your Custom Objects like "TimeTracking__c", "Project__c", etc.
- Recognizes all Custom Fields and their data types
- Provides intelligent suggestions based on your specific configuration
- Run once, then the AI benefits from it permanently
π Overview of your learned Salesforce installation - Shows available objects, Custom Fields and customizations.
// Complete overview of the installation
{}
// Details about a specific object
{
"object_name": "TimeTracking__c"
}
// Search for specific fields
{
"field_search": "email",
"show_custom_only": true
}
Execute SOQL queries against any Salesforce object.
// Example: Get recent contacts
{
"query": "SELECT Id, FirstName, LastName, Email FROM Contact WHERE CreatedDate = THIS_MONTH ORDER BY CreatedDate DESC LIMIT 10"
}
π§ Smart Learning Integration:
- Automatically warns when installation has not been learned yet
- Suggests available objects and fields
- Helps with correct API names
Create new records in any Salesforce object.
// Example: Create a new contact
{
"sobject": "Contact",
"data": {
"FirstName": "John",
"LastName": "Doe",
"Email": "[email protected]",
"Phone": "555-1234"
}
}
π§ Smart Context: Automatically shows required fields for the selected object when the installation has been learned.
Update existing records.
// Example: Update a contact's email
{
"sobject": "Contact",
"id": "003XX000008b6cYAQ",
"data": {
"Email": "[email protected]",
"Phone": "555-5678"
}
}
π§ Smart Context: Considers field permissions and data types from the learned installation.
Delete records (
// Example: Delete a record
{
"sobject": "Contact",
"id": "003XX000008b6cYAQ"
}
Get schema information for objects and fields.
// Example: Get Contact object schema
{
"sobject": "Contact"
}
// Or get list of all available objects
{} // Empty parameters
πΎ Comprehensive Backup System for Salesforce - Creates complete backups of all data and files with detailed recovery information.
// Create complete backup
{}
// Incremental backup since specific date
{
"backup_type": "incremental",
"since_date": "2025-01-01T00:00:00Z"
}
// Backup with specific options
{
"options": {
"include_files": true,
"include_attachments": true,
"include_documents": true,
"parallel_downloads": 10
}
}
What is backed up:
- π All Object Data - All queryable objects with up to 20 fields per object
- π Modern Files - ContentVersions with complete metadata
- π Legacy Attachments - Classic attachments with correct file extensions
- π Documents - Folder-based documents from the legacy system
- ποΈ Schema Information - Complete object structures and relationships
- π Backup Manifest - Detailed statistics and recovery information
Backup Structure:
salesforce-backup-2025-06-04T16-16-35-660Z/
βββ metadata/ # Schema and object definitions
βββ data/ # JSON data of all objects
βββ files/
β βββ content-versions/ # Modern files
β βββ attachments/ # Legacy attachments
β βββ documents/ # Legacy documents
βββ backup-manifest.json # Backup overview
π Show Available Backups - Overview of all local backups with statistics and metadata.
// List all available backups
{}
// Details about a specific backup
{
"backup_name": "salesforce-backup-2025-06-04T16-16-35-660Z"
}
β° Time Travel Through Salesforce Data - Analyzes data changes between different backup time points and enables targeted recovery.
// Compare current state with a backup
{
"backup_timestamp": "2025-06-04T16:16:35.660Z",
"object_name": "Account"
}
// Show all changes since a specific backup
{
"backup_timestamp": "2025-06-04T16:16:35.660Z",
"show_all_changes": true
}
// Detailed analysis for specific records
{
"backup_timestamp": "2025-06-04T16:16:35.660Z",
"object_name": "Contact",
"record_id": "003XX000008b6cYAQ"
}
Time Machine Features:
- π Data Comparison - Shows differences between backup and current state
- π Change History - Which fields were changed when
- ποΈ Deleted Records - Finds records that were deleted since the backup
- π Growth Analysis - Statistical evaluation of data development
- π― Targeted Recovery - Precise identification of changes
Authenticate with Salesforce. Automatically detects if authentication is needed and handles OAuth flow.
// Example: Standard authentication (detects if needed)
{}
// Example: Force re-authentication even if tokens appear valid
{
"force": true
}
β¨ Key Features:
- Automatic Detection: Claude automatically suggests this tool when authentication is needed
- No Manual Setup: Eliminates the need to run
npm run setup
manually - Smart Authentication: Only authenticates when necessary, checks existing tokens first
- Seamless Integration: Works transparently in the background
This tool is automatically suggested when:
- You try to use Salesforce tools without authentication
- Your tokens have expired
- Authentication errors occur
- First-time setup is needed
Every Salesforce installation is unique with:
- Custom Objects like "TimeTracking__c", "Project__c", "CustomerCare__c"
- Custom Fields on standard objects
- Specific Workflows and validation rules
- Individual Data Structures
The AI's normal training model only knows standard Salesforce objects. Without knowledge of your specific installation, the AI cannot provide intelligent assistance.
- One-time Analysis:
salesforce_learn
analyzes your complete installation - Local Documentation: All objects, fields and relationships are stored locally
- Intelligent Support: Claude can then make precise suggestions and answer complex questions
You: "Are there any time tracking entries for July 2025?"
Without Learning:
β Claude: "I don't know any object called 'TimeTracking'"
With Learning:
β
Claude: "I'm checking the 'TimeTracking__c' object for entries from July 2025..."
Automatically executes the correct SOQL query
- During initial setup - Once after installation
- After major changes - When new Custom Objects are added
- When having problems - When Claude doesn't find objects or fields
- All SObjects (Standard and Custom)
- All Fields with data types and permissions
- Relationships between objects
- Picklist Values and validation rules
- Required Fields for better validation
π‘ Learning runs only once and then makes all further interactions much more intelligent!
- Authentication: Claude automatically detects when authentication is needed
- Start Learning:
You: "Learn my Salesforce installation" Claude: Automatically uses the salesforce_learn tool
- Explore Installation:
You: "Show me an overview of my Salesforce installation" Claude: Uses salesforce_installation_info for a summary
You: "Show me all projects from this year"
Claude: Automatically recognizes your "Project__c" Custom Object and creates:
SELECT Id, Name, StartDate__c, Status__c FROM Project__c WHERE CALENDAR_YEAR(CreatedDate) = 2025
You: "Are there any time tracking entries for July 2025?"
Claude: Finds your "TimeTracking__c" object and queries:
SELECT Id, Name, Month__c, Hours__c FROM TimeTracking__c WHERE Month__c = 'July 2025'
-- Get all accounts in the technology industry
SELECT Id, Name, Industry, Website FROM Account WHERE Industry = 'Technology'
-- Find contacts created this week
SELECT Id, Name, Email, CreatedDate FROM Contact WHERE CreatedDate = THIS_WEEK
-- Get opportunities closing this quarter
SELECT Id, Name, Amount, CloseDate FROM Opportunity WHERE CloseDate = THIS_QUARTER
The server automatically discovers custom objects:
// Describe a custom object
{
"sobject": "CustomProject__c"
}
// Query custom object
{
"query": "SELECT Id, Name, CustomField__c FROM CustomProject__c LIMIT 10"
}
// Create custom object record
{
"sobject": "CustomProject__c",
"data": {
"Name": "New Project",
"CustomField__c": "Custom Value"
}
}
The MCP Salesforce Server offers a professional backup system that can secure your complete Salesforce installation:
-
π― Complete Coverage: Backs up all three Salesforce file systems
- Modern Files (ContentDocument/ContentVersion)
- Legacy Attachments (classic attachments)
- Documents (folder-based legacy documents)
-
π Intelligent Data Collection:
- All queryable objects (Standard + Custom)
- Up to 20 fields per object for comprehensive data backup
- Automatic filtering of binary fields
-
β‘ High Performance:
- Parallel downloads with configurable concurrency
- Retry logic with exponential backoff
- Batch processing for large data volumes
You: "Create a backup of my Salesforce data"
Claude: Automatically starts the salesforce_backup tool
Backup Result:
β
Backup successfully created!
π Statistics:
- 7 objects backed up
- 1,247 records exported
- 6 files downloaded
- 4.07 MB total size
- Duration: 23 seconds
π Location: /backups/salesforce-backup-2025-06-04T16-16-35-660Z/
salesforce-backup-2025-06-04T16-16-35-660Z/
βββ backup-manifest.json # Backup overview with statistics
βββ metadata/
β βββ objects-schema.json # All object definitions
β βββ file-manifest.json # File download protocol
βββ data/ # JSON data of all objects
β βββ Account.json # Account records
β βββ Contact.json # Contact records
β βββ Opportunity.json # Opportunity records
β βββ CustomObject__c.json # Custom Object data
βββ files/ # All Salesforce files
βββ content-versions/ # Modern files (.pdf, .docx, etc.)
βββ attachments/ # Legacy attachments
βββ documents/ # Legacy documents
The Time Machine enables you to travel through time and analyze data changes:
- π Data Comparison: Compares current state with historical backups
- π Change Analysis: Shows exactly which fields have changed
- ποΈ Deleted Records: Finds records that were deleted since the backup
- π Trend Analysis: Statistical evaluation of data development
You: "Compare the current Account data with the backup from June 4th"
Claude: Uses salesforce_time_machine for detailed analysis
Example Result:
β° Time Machine Analysis - Account Object
π
Backup: 2025-06-04T16:16:35.660Z vs. Current
π Changes found:
β’ Modified records: 3
β’ New records: 2
β’ Deleted records: 1
π Details:
Account "Aionda GmbH" (001XX000003DHPF):
- BillingStreet: "Alte StraΓe 1" β "KΓΆnigstraΓe 10a"
- BillingCity: "MΓΌnchen" β "Stuttgart"
- LastModifiedDate: 2025-06-04 β 2025-06-04
Account "TechCorp Ltd" (001XX000003DHPG):
- Status: Active β Inactive
- LastModifiedDate: 2025-06-03 β 2025-06-04
- π Compliance & Audit: Evidence of data changes
- π§ Error Analysis: "What was different before the problem?"
- π Data Quality: Monitoring data integrity
- π¨ Change Management: Control over critical changes
- π‘ Business Intelligence: Trend analysis over time
1. Initial Setup:
You: "Learn my Salesforce installation"
β Claude analyzes your complete org
2. Regular Backups:
You: "Create a backup"
β Claude backs up all data and files
3. Monitoring:
You: "Show me all available backups"
β Claude lists backup history
4. Analysis:
You: "What has changed since the last backup?"
β Claude uses Time Machine for comparison
π‘ Pro Tip: Combine Learning + Backup + Time Machine for maximum Salesforce control!
- Token Storage: Refresh tokens stored securely in
cache/salesforce-tokens.json
with restricted file permissions (600) - No Plaintext Secrets: Access tokens kept in memory only
- Automatic Refresh: Tokens refreshed automatically before expiration
- Secure Cleanup: Tokens removed from memory after use
- Input Validation: All inputs validated and sanitized
- Migration: File-based token storage with 600 permissions for secure credential management
# Run tests
npm test
# Test authentication
npm run setup -- --test
# Validate configuration
npm run setup -- --validate
π― Automatic Authentication: Claude automatically detects authentication issues and suggests the salesforce_auth
tool. No manual troubleshooting needed!
Common Scenarios:
- First-time use: Claude will automatically suggest authentication when you first try to use Salesforce tools
- Token expiration: When tokens expire, Claude detects this and prompts for re-authentication
- Invalid credentials: Clear error messages guide you to fix configuration issues
- Session expired: Automatic detection with friendly prompts to re-authenticate
π Secure Token Storage: Authentication tokens are stored securely in the local file system with strict permissions.
Security Features:
- File Permissions: Token files are created with
0600
permissions (readable/writable only by owner) - Location: Tokens stored in
cache/salesforce-tokens.json
(excluded from git) - Automatic Security: Permission verification and automatic fixing if needed
- No Network Exposure: Tokens never leave your local machine
- File-based Security: Secure token storage with strict file permissions for credential protection
Security Verification:
# Check token file security
ls -la cache/salesforce-tokens.json
# Should show: -rw------- (600 permissions)
# Run security test
node test-token-security.js
What this means:
- Other users on your system cannot read your Salesforce tokens
- Only your user account has access to the authentication data
- Prevents unauthorized access to your Salesforce organization
- Complies with security best practices for credential storage
If you get authentication errors, simply tell Claude:
Authenticate with Salesforce
Or Claude will automatically suggest: Use the salesforce_auth tool to authenticate with Salesforce
β¨ No more manual terminal setup! Everything happens seamlessly through Claude Desktop.
- "Cannot connect to Salesforce": Verify your Instance URL
- "Insufficient permissions": Check user permissions in Salesforce
- "CORS errors": Ensure Connected App callback URL is correct
- Field not found: Use API names, not field labels
- Object not found: Check spelling and API name of objects
- Syntax errors: Ensure proper SOQL syntax with single quotes
- OAuth Setup Guide - Detailed Connected App configuration
- Setup Instructions - Step-by-step setup process
- Usage Examples - Comprehensive usage examples
- Architecture Plan - Technical architecture details
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes and test thoroughly
- Submit a pull request with detailed description
MIT License - see LICENSE file for details.
- Issues: Report bugs and feature requests via GitHub Issues
- Documentation: Check the
docs/
folder for detailed guides - Community: Join discussions in GitHub Discussions
Made with β€οΈ for the MCP ecosystem