This Salesforce MCP Server provides standardized tools for interacting with Salesforce data and metadata through Claude Desktop and other MCP clients.
Key Capabilities:
Run SOQL queries - Execute queries and return structured JSON results with records and total size
List and describe Salesforce objects - Get all available SObjects in your organization and retrieve detailed field information including types, labels, nillable status, and picklist values
Manage Salesforce flows - List all flows with status/version information and retrieve complete XML metadata for specific flows
Access reports and dashboards - List all Salesforce reports and dashboards with their folder and usage information
Provides tools for querying Salesforce data using SOQL, listing all Salesforce objects in an org, and describing detailed field information for any Salesforce object through the sf CLI.
Salesforce MCP Server
This server provides MCP (Model Context Protocol) tools for interacting with Salesforce using the sf
CLI. It exposes Salesforce data and metadata through standardized MCP tools that can be used with Claude Desktop and other MCP clients.
Features
Query Tool (
salesforce_query
) - Run SOQL queries and return structured resultsList Objects (
salesforce_list_objects
) - Get all Salesforce object names in your orgDescribe Objects (
salesforce_describe
) - Get detailed field information for any Salesforce objectList Flows (
salesforce_list_flows
) - Get all Salesforce flows with status and version informationDescribe Flow (
salesforce_describe_flow
) - Get the complete XML metadata for a specific flowList Reports (
salesforce_list_reports
) - Get all Salesforce reports with folder and usage informationList Dashboards (
salesforce_list_dashboards
) - Get all Salesforce dashboards with folder and usage information
Prerequisites
macOS (this setup is optimized for macOS)
Python 3.11+
Installation
One-command setup:
The installer will automatically:
Install Poetry and Python dependencies
Install Node.js Salesforce CLI (if needed)
Authenticate with your Salesforce org (or select existing auth)
Create
.env
configurationUpdate Claude Desktop configuration
That's it! The script handles everything needed to get you up and running.
Manual Setup (Alternative)
If you prefer to set up manually or the automatic installer doesn't work:
Install dependencies:
# Install Poetry (if needed) curl -sSL https://install.python-poetry.org | python3 - # Install Python dependencies poetry install # Install Salesforce CLI (if needed) npm install -g @salesforce/cliAuthenticate with Salesforce:
sf org login webConfigure Claude Desktop by adding this to your
claude_desktop_config.json
:{ "mcpServers": { "sfmcp": { "command": "/path/to/your/sfmcp/run-mcp.sh", "args": [] } } }Restart Claude Desktop to load the new MCP server.
Usage
Once configured, you can use these tools in Claude Desktop conversations:
"List all Salesforce objects" - Uses
salesforce_list_objects
"Describe the Account object" - Uses
salesforce_describe
"Query all active accounts" - Uses
salesforce_query
"List all flows" - Uses
salesforce_list_flows
"Describe the Contact_Last_Reply_Date flow" - Uses
salesforce_describe_flow
"List all reports" - Uses
salesforce_list_reports
"List all dashboards" - Uses
salesforce_list_dashboards
Example queries:
SELECT Id, Name FROM Account LIMIT 10
SELECT Id, Email FROM Contact WHERE Email != null
Development
Running the Server
STDIO Mode (for MCP clients):
HTTP Mode (for testing):
Code Quality
Configuration
The server uses environment variables from .env
file:
SF_INSTANCE_URL
- Your Salesforce instance URLSF_ACCESS_TOKEN
- Salesforce access token (automatically managed)SF_ORG_ALIAS
- Alias for your Salesforce orgSF_USERNAME
- Your Salesforce usernameSFMCP_HTTP_HOST
- HTTP server host (default: 127.0.0.1)SFMCP_HTTP_PORT
- HTTP server port (default: 3333)
Troubleshooting
"Salesforce CLI not found"
Re-run the installer:
python install.py
Or install manually:
npm install -g @salesforce/cli
"Authentication failed"
Run
sf org list
to check authenticated orgsRe-run
python install.py
to set up authentication
"Permission denied"
Make sure you have proper Salesforce org permissions
Check that your access token hasn't expired
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables interaction with Salesforce organizations through SOQL queries, object discovery, and metadata inspection. Provides seamless access to Salesforce data and schema information through the Salesforce CLI.