Provides a setup wizard that guides users through connecting to Salesforce via OAuth authentication, enabling querying and managing Salesforce data including accounts, opportunities, contacts, and cases.
Salesforce CLI Connect MCP
A Model Context Protocol (MCP) server that provides a user-friendly setup wizard for connecting Claude Desktop to Salesforce via the Salesforce CLI.
Overview
This MCP server acts as a setup assistant that guides non-technical users through connecting to Salesforce. It handles:
✅ Checking for Salesforce CLI installation
✅ Installing Salesforce CLI if needed
✅ Opening browser for secure OAuth authentication
✅ Verifying the connection
✅ Providing clear restart instructions
No technical knowledge required - users simply ask Claude to "Help me connect to Salesforce" and the setup wizard guides them through the entire process.
Features
Automatic Installation: Installs Salesforce CLI if not already present
Browser-Based Login: Secure OAuth flow through your default browser
No Plain-Text Credentials: All credentials stored securely via Salesforce CLI
Individual User Authentication: Each user authenticates with their own Salesforce account
Configurable: Supports any Salesforce instance URL
Cross-Platform: Works on Windows, macOS, and Linux
For IT Administrators
Quick Start
Install the package globally (optional):
Deploy the Claude Desktop configuration to users' machines at:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Configuration file:
Instruct users to:
Open Claude Desktop
Type: "Help me set up Salesforce" or "Connect to Salesforce"
Follow the on-screen instructions
Restart Claude Desktop when prompted
That's it! No manual CLI commands or config file editing required by end users.
Configuration Options
Environment Variable | Required | Default | Description |
| Yes |
| Your Salesforce instance URL |
| No |
| Alias for the authenticated org |
Important Notes
Both MCP servers (connect-to-salesforce and salesforce) should use the same
SALESFORCE_INSTANCE_URLThe org alias must match between the setup MCP and the Salesforce MCP configuration
Users need Node.js and npm installed on their machines
For End Users
Setup Instructions
Open Claude Desktop
Ask Claude: "Help me set up Salesforce" or "Connect to Salesforce"
Claude will guide you through the setup process
A browser window will open for you to log in to Salesforce
After successful login, completely close and reopen Claude Desktop
You're ready to use Salesforce with Claude!
What Gets Installed
Salesforce CLI: A command-line tool that securely stores your Salesforce credentials
Org Connection: Your connection is saved with the alias
mcp-server-connect(or custom alias set by IT)
How to Restart Claude Desktop
Mac: Press
Cmd+Qto quit, then reopen Claude DesktopWindows: Right-click the Claude icon in the taskbar → "Close window", then reopen
Linux: Select "Quit" from the menu, then reopen
Using Salesforce with Claude
After setup, you can ask Claude things like:
"How many accounts are in my Salesforce org?"
"Show me all opportunities created this month"
"Find contacts named John"
"Create a new account for Acme Corp"
"Update the status of case 00012345"
Technical Details
Requirements
Node.js 18.0.0 or higher
NPM (comes with Node.js)
Claude Desktop
Active Salesforce account with appropriate permissions
How It Works
The MCP server checks if Salesforce CLI is installed
If not installed, it automatically installs via npm
Runs
sf org login webwhich opens your browser for secure OAuth authenticationVerifies the connection by checking org status
Stores credentials securely via Salesforce CLI (not in plain text)
Authentication Method
This tool uses Salesforce CLI OAuth (browser-based authentication):
Opens your default browser to Salesforce login page
Uses OAuth 2.0 authorization code flow
Credentials are stored securely by Salesforce CLI
Each user authenticates with their own account
No passwords stored in config files
Security
✅ Credentials never stored in plain text
✅ Authentication uses Salesforce's OAuth flow
✅ Credentials managed by Salesforce CLI's secure storage
✅ Each user authenticates with their own Salesforce account
✅ No shared service accounts
Troubleshooting
"Setup Failed" Message
If setup fails, try these steps:
Close Claude Desktop completely
Open your terminal/command prompt
Run:
npm install -g @salesforce/cliRun:
sf org login web --instance-url https://your-org.my.salesforce.com --alias mcp-server-connectRestart Claude Desktop
Browser Doesn't Open
Check your default browser settings
Try running the manual command above in step 4
Ensure pop-ups are not blocked
Contact your IT administrator if issues persist
Connection Not Working After Restart
Make sure you completely quit Claude Desktop (not just closed the window)
Verify the org alias by running:
sf org listYou should see
mcp-server-connectin the listCheck that the instance URL in your config matches your Salesforce org
"Invalid JSON" Error
This usually means there's a version mismatch. Try:
Update Salesforce CLI:
npm install -g @salesforce/cli@latestRestart Claude Desktop
Run the setup again
Permission Errors During Installation
On some systems, you may need administrator privileges:
Windows: Run Command Prompt as Administrator
Mac/Linux: Use
sudo npm install -g @salesforce/cli
Development
Local Testing
Publishing Updates
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For technical support:
Contact your IT administrator
File an issue on the GitHub repository
Check the Salesforce MCP documentation
Related Projects
Salesforce MCP Server - The main MCP server for Salesforce operations
Model Context Protocol - Documentation for the MCP standard
License
MIT
Changelog
v1.0.0
Initial release
Automatic Salesforce CLI installation
Browser-based OAuth authentication
Connection verification
Cross-platform support (Windows, macOS, Linux)