salesforce-mcp-server

kazuki1213/salesforce-mcp-server

3.2

If you are the rightful owner of salesforce-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Salesforce through natural language commands.

Salesforce MCP Server

A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Salesforce through natural language commands.

πŸš€ Quick Start

1. Clone and Setup

git clone https://github.com/salesforce/mcp-server.git
cd salesforce-mcp-server
./setup.sh

2. The setup script will:

  • Collect your Salesforce credentials
  • Install dependencies
  • Build the project
  • Generate Claude Desktop configuration

3. Install in Claude Desktop

# macOS
cp claude_desktop_config.json ~/Library/Application\ Support/Claude/

# Windows
copy claude_desktop_config.json %APPDATA%\Claude\

# Linux
cp claude_desktop_config.json ~/.config/Claude/

4. Restart Claude Desktop and start using!

πŸ’¬ Natural Language Examples

In Claude Desktop, you can now use natural language:

"Show me all accounts created this month"
"Create a new contact named John Doe for Acme Corp"
"Find opportunities closing this quarter"
"Update the phone number for contact Jane Smith to 555-1234"
"List accounts without any opportunities"

πŸ”§ Available Tools

querySOQL

Execute SOQL queries or natural language searches:

"Show me all opportunities"
"SELECT Id, Name FROM Account LIMIT 10"
"Find contacts with email addresses"

getAccount

Retrieve account details by ID:

"Get account 001XX000003DHPl"

createContact

Create new contacts:

"Create contact John Doe with email john@example.com"

updateAccount

Update existing accounts:

"Update account 001XX000003DHPl set industry to Technology"

πŸ“‹ Prerequisites

  • Node.js 18 or higher
  • Claude Desktop app
  • Salesforce account with:
    • API access enabled
    • Security token (get from Setup β†’ Personal Information β†’ Reset Security Token)

πŸ” Manual Setup

If you prefer manual setup:

  1. Create .env file:
SF_INSTANCE_URL=https://login.salesforce.com
SF_USERNAME=your-email@example.com
SF_PASSWORD=your-password
SF_TOKEN=your-security-token
  1. Install and build:
npm install
npm run build
  1. Configure Claude Desktop: Edit claude_desktop_config.json with your credentials and absolute path to the server.

πŸ€” Troubleshooting

Connection Issues

  • Invalid credentials: Check username/password in .env
  • Missing security token: Reset in Salesforce Setup β†’ Personal Information
  • IP restrictions: Add your IP to Salesforce trusted ranges

Common Errors

  • INVALID_SESSION_ID: Re-run setup.sh to refresh credentials
  • INSUFFICIENT_ACCESS: Check API permissions for your Salesforce user
  • UNABLE_TO_LOCK_ROW: Retry the operation

Debug Mode

Add to .env for detailed logs:

LOG_LEVEL=debug

πŸ“¦ Resources

The server provides access to Salesforce metadata:

  • salesforce://objects - List of available Salesforce objects
  • salesforce://account-fields - Field definitions for Account object

πŸ“‘ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Claude Desktop  │────▢│  MCP Server     │────▢│  Salesforce  β”‚
β”‚                 │◀────│  (Node.js)      │◀────│  REST API    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β–²                        β”‚
        β”‚                        β–Ό
        β”‚                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        └─────────────────│ Natural     β”‚
                          β”‚ Language    β”‚
                          β”‚ Processing  β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“š Examples

Basic Queries

// In Claude Desktop:
"Show me all accounts"
"Find contacts without email"
"List opportunities closing this month"

Creating Records

"Create a contact named Jane Smith with email jane@example.com for account Acme Corp"
"Create an opportunity called 'Big Deal' for $50,000 closing next month"

Complex Queries

"Find accounts with open opportunities worth more than $100k"
"Show me contacts from companies in the technology industry"
"List all won opportunities from last quarter"

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

πŸ“„ License

MIT License - see for details.